Skip to content

Commit

Permalink
update disabled styling. Fix sbanken item height
Browse files Browse the repository at this point in the history
  • Loading branch information
snorrekim committed Oct 25, 2024
1 parent dc19eea commit 9f924ee
Show file tree
Hide file tree
Showing 32 changed files with 43 additions and 28 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ exports[`DrawerList scss has to match style dependencies css 1`] = `
--drawer-list-list-background: var(--color-white);
--drawer-list-list-line-height: var(--line-height-basis);
--drawer-bg-disabled: var(--color-black-8);
--drawer-color-disabled: var(--color-black-80);
--drawer-color-disabled: var(--color-black-55);
display: block;
position: relative;
width: inherit;
Expand Down Expand Up @@ -459,10 +459,10 @@ html[data-whatinput=mouse] .dnb-drawer-list__options--focusring {
content: "";
position: absolute;
z-index: 2;
top: auto;
top: 0;
left: 0;
right: 0;
bottom: 0;
bottom: auto;
height: var(--drawer-list-option-border-width);
background-color: var(--color-mint-green-25);
}
Expand Down Expand Up @@ -561,7 +561,7 @@ html[data-whatinput=keyboard] .dnb-drawer-list__option--selected.dnb-drawer-list
.dnb-drawer-list__option.last-of-type, .dnb-drawer-list__option--focus.last-of-type .dnb-drawer-list__option__inner, .dnb-drawer-list__option--focus.last-of-type .dnb-drawer-list__option__inner::before {
border-radius: 0 0 var(--drawer-list-options-border-radius) var(--drawer-list-options-border-radius);
}
.dnb-drawer-list__option.last-of-type:not(.dnb-drawer-list__option--focus) .dnb-drawer-list__option__inner::before {
.dnb-drawer-list__option.first-of-type:not(.dnb-drawer-list__option--focus) .dnb-drawer-list__option__inner::before {
content: none;
}
.dnb-drawer-list__option--selected .dnb-drawer-list__option__item .dnb-anchor:focus {
Expand Down Expand Up @@ -589,6 +589,9 @@ html[data-whatinput=keyboard] .dnb-drawer-list__option--selected .dnb-drawer-lis
.dnb-drawer-list--top .dnb-drawer-list__option--focus.closest-to-top .dnb-drawer-list__option__inner::before {
border-radius: var(--drawer-list-options-border-radius) var(--drawer-list-options-border-radius) 0 0;
}
.dnb-drawer-list__option[disabled] + .dnb-drawer-list__option[disabled]:not(.dnb-drawer-list__option--focus) .dnb-drawer-list__option__inner::before {
background-color: var(--color-black-20);
}
.dnb-drawer-list__status--error:not(.dnb-drawer-list--opened) .dnb-drawer-list__icon {
color: var(--color-fire-red);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
--drawer-list-list-background: var(--color-white);
--drawer-list-list-line-height: var(--line-height-basis);
--drawer-bg-disabled: var(--color-black-8);
--drawer-color-disabled: var(--color-black-80);
--drawer-color-disabled: var(--color-black-55);

display: block; // has to be block element so we can se the content
position: relative;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@
--drawer-list-options-border-radius: 0 0 0.5rem 0.5rem;
--drawer-list-options-border-radius-reversed: 0.5rem 0.5rem 0 0;
--drawer-list-option-border-width: 0.125rem;
--drawer-list-option-border-color: transparent;
--drawer-list-option-inner-border-display: none;
--drawer-list-option-inner-background: transparent;
--drawer-list-list-background: var(--sb-color-white);
--drawer-list-list-option-background: transparent;
--drawer-bg-disabled: var(--sb-color-gray-light);
--drawer-color-disabled: var(--sb-color-gray-dark-2);

&__list {
margin-top: calc(
Expand All @@ -31,14 +35,14 @@

&__option__inner {
overflow: visible;
background-color: inherit;
padding: 1rem 0.75rem;
margin: 0 var(--drawer-list-option-border-width);

&::before {
content: '';
display: block;
position: absolute;
bottom: -3px;
top: -1px;
left: 0.5rem;
width: calc(100% - 1rem);
height: 1px;
Expand All @@ -56,20 +60,17 @@
}

&__option {
border: var(--drawer-list-option-border-width) solid
var(--sb-color-gray-dark-2);
border-bottom-color: transparent;
border-top-color: transparent;
border-right-color: transparent; // Fix ugly border with scrollbar
background-color: transparent;
box-shadow: inset 0 0 0 var(--drawer-list-option-border-width)
var(--drawer-list-option-border-color);
background: var(--drawer-list-list-option-background);
z-index: 0;

&__item.item-nr-1 {
font-weight: var(--font-weight-medium);
}

@include hover() {
border-color: var(--sb-color-violet);
--drawer-list-option-border-color: var(--sb-color-violet);
z-index: 1;

.dnb-drawer-list__option__inner::before {
Expand All @@ -78,7 +79,7 @@
}

@include active() {
border-color: var(--sb-color-violet);
--drawer-list-option-border-color: var(--sb-color-violet);
z-index: 1;

.dnb-drawer-list__option__inner::before {
Expand All @@ -87,7 +88,7 @@
}

&--selected {
background-color: var(--sb-color-violet);
--drawer-list-list-option-background: var(--sb-color-violet);
color: var(--sb-color-white);
border-right-color: var(
--sb-color-gray-dark-2
Expand Down Expand Up @@ -122,28 +123,33 @@
@include allAbove(small) {
&--selected &__suffix {
z-index: 2; // over check icon
background-color: inherit; // to "hide" the check icon
background-color: var(
--drawer-list-list-option-background
); // to "hide" the check icon
}
}

&.first-of-type &__inner::before {
content: none;
}

&.last-of-type {
border-radius: var(--drawer-list-options-border-radius);

.dnb-drawer-list__option__inner::before {
display: none;
}
}

&:focus-visible,
&--focus {
border-color: var(--sb-color-blue-dark);
outline: 0.0625rem solid var(--sb-color-blue-dark);
background-color: var(--sb-color-blue-light-3);
--drawer-list-option-border-color: var(--sb-color-blue-dark);
--drawer-list-list-option-background: var(--sb-color-blue-light-3);
color: var(--sb-color-blue-dark);
font-weight: var(--sb-font-weight-medium);
z-index: 1;

/* stylelint-disable no-descending-specificity */
.dnb-drawer-list__option__inner {
--drawer-list-option-inner-background: transparent;
}

.dnb-drawer-list__option__inner::before {
display: var(--drawer-list-option-inner-border-display);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,16 @@
content: '';
position: absolute;
z-index: 2;
top: auto;
top: 0;
left: 0;
right: 0;
bottom: 0;
bottom: auto;

// width: 100%; // 100% width would result in no margin right
height: var(--drawer-list-option-border-width);

background-color: var(--color-mint-green-25);
}

&__item.item-nr-1 {
font-weight: var(--font-weight-medium);
}
Expand Down Expand Up @@ -197,7 +196,7 @@
}

// remove last bottom border
&.last-of-type:not(#{&}--focus) &__inner::before {
&.first-of-type:not(#{&}--focus) &__inner::before {
content: none;
}

Expand Down Expand Up @@ -234,6 +233,13 @@
var(--drawer-list-options-border-radius) 0 0;
}

// disabled
&__option[disabled]
+ &__option[disabled]:not(#{&}__option--focus)
&__option__inner::before {
background-color: var(--color-black-20);
}

// error status
&__status--error:not(#{&}--opened) &__icon {
color: var(--color-fire-red);
Expand Down

0 comments on commit 9f924ee

Please sign in to comment.