Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 23 additions & 16 deletions packages/atlas/src/themesource/atlas_core/web/_color-variants.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,38 @@ $lightness-steps: (
900: -60%
);

// Guard against duplicate :root emission when this file is imported repeatedly.
$atlas-color-variants-root-emitted: false !default;

// generate corresponding CSS variables
:root {
@each $name, $bg-class, $text-class, $base-color in $brand-colors {
@each $shade, $adjustment in $lightness-steps {
--#{$name}-#{$shade}: #{adjust-color-lightness($base-color, $adjustment)};
}
@if $atlas-color-variants-root-emitted == false {
:root {
@each $name, $bg-class, $text-class, $base-color in $brand-colors {
@each $shade, $adjustment in $lightness-steps {
--#{$name}-#{$shade}: #{adjust-color-lightness($base-color, $adjustment)};
}

@if ($bg-class != "") {
.#{$bg-class} {
@each $shade, $adjustment in $lightness-steps {
&.shade-#{$shade} {
background-color: adjust-color-lightness($base-color, $adjustment);
@if ($bg-class != "") {
.#{$bg-class} {
@each $shade, $adjustment in $lightness-steps {
&.shade-#{$shade} {
background-color: adjust-color-lightness($base-color, $adjustment);
}
}
}
}
}

@if ($text-class != "") {
.#{$text-class} {
@each $shade, $adjustment in $lightness-steps {
&.shade-#{$shade} {
color: adjust-color-lightness($base-color, $adjustment);
@if ($text-class != "") {
.#{$text-class} {
@each $shade, $adjustment in $lightness-steps {
&.shade-#{$shade} {
color: adjust-color-lightness($base-color, $adjustment);
}
}
}
}
}
}

$atlas-color-variants-root-emitted: true !global;
}
Loading