Skip to content

Commit

Permalink
Fix the missing dark colorization in several components that have roo…
Browse files Browse the repository at this point in the history
…t selectors
  • Loading branch information
bundyo committed Sep 2, 2019
1 parent 91da2ba commit 4030401
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
11 changes: 10 additions & 1 deletion src/scss/mixins/_colorize.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
$enhancers: 'alternate', 'scale-alternate', 'contrasted', 'scale-contrasted';
$root-classes: '.ns-root', '.ns-android', '.ns-ios', '.ns-phone', '.ns-tablet', '.ns-portrait', '.ns-landscape';

@mixin enhance($name, $arguments, $colors) {
$args: ();
Expand All @@ -25,7 +26,15 @@ $enhancers: 'alternate', 'scale-alternate', 'contrasted', 'scale-contrasted';
@each $name, $arguments in keywords($args) {
@include enhance($name, $arguments, $light-colors);

.ns-dark & {
$is-at-root: false;

@each $class in $root-classes {
@if(str-index('#{&}', $class) == 1) {
$is-at-root: true;
}
}

@at-root .ns-dark#{if($is-at-root, #{&}, ' #{&}')} {
@include enhance($name, $arguments, $dark-colors);
}
}
Expand Down
22 changes: 5 additions & 17 deletions src/scss/mixins/components/_action-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
text-transform: none;
font-weight: normal;
background-color: transparent;

&:active {
opacity: .7;
@include colorize($color: ab-color);
}
}

& > Label {
Expand All @@ -51,18 +56,8 @@
@if not $compat {
.ns-android & Button,
.ns-android & .nt-button {
border-radius: 1;
padding: 12 6;

@include colorize(
$background-color: ab-background
);

&:active {
opacity: .7;
@include colorize($color: ab-color);
}

android-elevation: 0;
android-dynamic-elevation-offset: 0;
}
Expand Down Expand Up @@ -97,13 +92,6 @@
@include colorize(
$background-color: ab-background
);

&:active {
@include colorize(
$color: ab-color,
$background-color: ab-background
);
}
}
}
}
Expand Down

0 comments on commit 4030401

Please sign in to comment.