Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add color prefix to css-variables mixin #1762

Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ $text-primary: #202020 !default;
$text-secondary: #535353 !default;
$text-tertiary: #7f7f7f !default;

@mixin css-variables {
@mixin color-css-variables {
--spirit-color-background-backdrop: #{$background-backdrop};
--spirit-color-background-interactive-state-active: #{$background-interactive-state-active};
--spirit-color-background-interactive-state-default: #{$background-interactive-state-default};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ $text-primary: #f9f9f9 !default;
$text-secondary: #d9d9d9 !default;
$text-tertiary: #b2b2b2 !default;

@mixin css-variables {
@mixin color-css-variables {
--spirit-color-background-backdrop: #{$background-backdrop};
--spirit-color-background-interactive-state-active: #{$background-interactive-state-active};
--spirit-color-background-interactive-state-default: #{$background-interactive-state-default};
Expand Down
10 changes: 6 additions & 4 deletions packages/web/src/scss/tools/_themes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@

@each $theme-name, $theme-token-types in $themes {
$selector: if($is-default-theme, ':root, .#{$theme-name}', '.#{$theme-name}');
$sass-variables: map.get($theme-token-types, variables);
$css-variables: map.get($theme-token-types, mixins, css-variables);
$theme-variables: map.get($theme-token-types, variables);
$theme-mixins: map.get($theme-token-types, mixins);

#{$selector} {
@include meta.apply($css-variables);
@each $theme-mixin-name, $theme-mixin in $theme-mixins {
@include meta.apply($theme-mixin);
}

@if $add-background-image-urls {
@include generate-background-image-urls($themed-tokens: $sass-variables);
@include generate-background-image-urls($themed-tokens: $theme-variables);
}
}

Expand Down
Loading