chore: Update dropdown chevron styles

This commit is contained in:
Susmitha Girumala committed 2020-08-11 10:00:31 -04:00
1 parent 26795b9359
commit 23c97c1f15
6 files changed
+42 -27

No files matched your search

@@ -13,7 +13,7 @@ export default Component.extend({
/**
* Closes the details element by setting its `open` attribute to `false`.
* While the details element handles open/close functionality when clicking
* directly on the summar elemenet without JavaScript, we include this helper
* directly on the summary element without JavaScript, we include this helper
* action to ensure that when the user clicks _outside_ of the element,
* or _inside_ the content, it still closes.
* @param {HTMLElement} element
@@ -12,13 +12,22 @@ A simple dropdown component with support for links and buttons. Dropdown buttons
<Preview>
<Story name="Basic Dropdown" height="5rem">{{
template: hbs`
<Rose::Dropdown @text="Choose One&hellip;" @icon="user-organization" as |dropdown|>
<Rose::Dropdown @text="Choose One&hellip;" @icon="user-organization" @style={{style}} as |dropdown|>
<dropdown.link @route="index">Menu item</dropdown.link>
<dropdown.link @route="about">Menu item</dropdown.link>
<dropdown.button>Button menu item</dropdown.button>
</Rose::Dropdown>
`,
context: {}
context: {
style: select(
'style',
{
'light': 'light',
'dark': 'dark',
},
'dark'
),
}
}}</Story>
</Preview>
@@ -2,6 +2,22 @@
@use '../utilities/type';
@use '../utilities/dropdown';
@include dropdown.dropdown-style(
'light',
(
color: var(--white),
chevron: 'light',
)
);
@include dropdown.dropdown-style(
'dark',
(
color: var(--black),
chevron: 'dark',
)
);
.rose-dropdown {
position: relative;
display: inline-block;
@@ -27,9 +43,6 @@
display: none;
}
// color: var(--subtle);
background: url("data:image/svg+xml;utf-8,<svg viewBox='0 0 24 24' fill='%231b1f26' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z'></path></svg>")
no-repeat right sizing.rems(s) center;
background-size: sizing.rems(m);
&:hover {
@@ -121,5 +134,15 @@
.rose-dropdown-button {
width: 100%;
&.rose-button-warning {
color: unset;
}
// &.rose-button-warning {
// &:hover, &:focus {
// color: unset;
// }
// }
}
}
@@ -1,22 +1,5 @@
@use '../../variables/sizing';
@use '../../utilities/type';
@use '../../utilities/dropdown';
@include dropdown.dropdown-style(
'light',
(
color: var(--white),
chevron: 'light',
)
);
@include dropdown.dropdown-style(
'dark',
(
color: var(--black),
chevron: 'dark',
)
);
.rose-header-utilities,
.rose-header-nav {
@@ -24,7 +7,6 @@
.rose-dropdown-trigger {
background-size: sizing.rems(m);
padding-right: sizing.rems(l) - sizing.rems(xxs);
$lineHeight: 48 / 16;
line-height: $lineHeight;
@@ -41,7 +23,7 @@
}
}
&:hover {
&:hover, &:focus {
background-color: unset;
}
}
@@ -1,4 +1,5 @@
@use 'sass:map';
@use '../variables/sizing';
$dropdown-chevron: (
'light':
@@ -12,7 +13,7 @@ $dropdown-chevron: (
.rose-dropdown-trigger {
color: map.get($default, color);
background: url(map.get($dropdown-chevron, map.get($default, chevron)))
no-repeat right center;
no-repeat right sizing.rems(s) center;
}
}
}
@@ -1,6 +1,6 @@
<details
...attributes
class="rose-dropdown {{if @alignRight " rose-dropdown-right"}} {{if @style (concat "rose-dropdown-" @style)}}"
class="rose-dropdown {{if @alignRight " rose-dropdown-right"}} {{if @style (concat "rose-dropdown-" @style)}} {{unless @style (concat "rose-dropdown-dark")}}"
{{on-click-outside this.close}}
>