mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
fix(scss): use new component tokens to render low contrast notifications (#533)
This commit is contained in:
parent
d12442c797
commit
66a3fd10c2
6 changed files with 65 additions and 10 deletions
35
css/all.scss
35
css/all.scss
|
@ -18,21 +18,45 @@ $css--plex: true;
|
|||
|
||||
// Use all Carbon themes
|
||||
@import "carbon-components/scss/globals/scss/vendor/@carbon/themes/scss";
|
||||
@import "carbon-components/scss/globals/scss/component-tokens";
|
||||
@import "carbon-components/src/components/tag/tag";
|
||||
@import "carbon-components/src/components/notification/inline-notification";
|
||||
@import "carbon-components/src/components/notification/toast-notification";
|
||||
|
||||
// The default theme is "white" (White)
|
||||
:root { @include carbon--theme($carbon--theme--white, true); }
|
||||
:root {
|
||||
@include carbon--theme($carbon--theme--white, true) {
|
||||
@include emit-component-tokens($tag-colors);
|
||||
@include emit-component-tokens($notification-colors);
|
||||
}
|
||||
}
|
||||
|
||||
// Set the <html> theme attribute to "g10" to use the Gray 10 theme
|
||||
// <html theme="g10">
|
||||
:root[theme="g10"] { @include carbon--theme($carbon--theme--g10, true); }
|
||||
:root[theme="g10"] {
|
||||
@include carbon--theme($carbon--theme--g10, true) {
|
||||
@include emit-component-tokens($tag-colors);
|
||||
@include emit-component-tokens($notification-colors);
|
||||
}
|
||||
}
|
||||
|
||||
// Set the <html> theme attribute to "g90" to use the Gray 90 theme
|
||||
// <html theme="g90">
|
||||
:root[theme="g90"] { @include carbon--theme($carbon--theme--g90, true); }
|
||||
:root[theme="g90"] {
|
||||
@include carbon--theme($carbon--theme--g90, true) {
|
||||
@include emit-component-tokens($tag-colors);
|
||||
@include emit-component-tokens($notification-colors);
|
||||
}
|
||||
}
|
||||
|
||||
// Set the <html> theme attribute to "g100" to use the Gray 100 theme
|
||||
// <html theme="g100">
|
||||
:root[theme="g100"] { @include carbon--theme($carbon--theme--g100, true); }
|
||||
:root[theme="g100"] {
|
||||
@include carbon--theme($carbon--theme--g100, true) {
|
||||
@include emit-component-tokens($tag-colors);
|
||||
@include emit-component-tokens($notification-colors);
|
||||
}
|
||||
}
|
||||
|
||||
// Programmatically update the theme in JavaScript:
|
||||
// document.documentElement.setAttribute("theme", "g90");
|
||||
|
@ -44,5 +68,4 @@ $css--plex: true;
|
|||
@import "carbon-components/scss/globals/grid/grid";
|
||||
|
||||
// Import all component styles
|
||||
@import "carbon-components/scss/globals/scss/styles";
|
||||
|
||||
@import "carbon-components/scss/globals/scss/styles";
|
Loading…
Add table
Add a link
Reference in a new issue