Skip to content

Commit f74c03a

Browse files
committed
chore: v11 Theme
This fixes the current `Theme` component. Note that the canonical implementation uses `GlobalTheme` for the same concept. See carbon-design-system#1702. Static CSS files are updated to use @carbon/styles including fonts via CDN. (cherry picked from commit 50f24b8)
1 parent 82f582c commit f74c03a

34 files changed

+114303
-61
lines changed

COMPONENT_INDEX.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4200,7 +4200,7 @@ None.
42004200
### Types
42014201

42024202
```ts
4203-
export type CarbonTheme = "white" | "g10" | "g80" | "g90" | "g100";
4203+
export type CarbonTheme = "white" | "g10" | "g90" | "g100";
42044204
```
42054205

42064206
### Props

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ Before importing components, you will need to first apply Carbon component style
4949

5050
- **white.css**: Default Carbon theme (light)
5151
- **g10.css**: Gray 10 theme (light)
52-
- **g80.css**: Gray 80 theme (dark)
5352
- **g90.css**: Gray 90 theme (dark)
5453
- **g100.css**: Gray 100 theme (dark)
5554
- **all.css**: All themes (White, Gray 10, Gray 90, Gray 100) using [CSS variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties)
@@ -60,7 +59,6 @@ The compiled CSS is generated from the following `.scss` files:
6059

6160
- [css/white.scss](css/white.scss)
6261
- [css/g10.scss](css/g10.scss)
63-
- [css/g80.scss](css/g80.scss)
6462
- [css/g90.scss](css/g90.scss)
6563
- [css/g100.scss](css/g100.scss)
6664
- [css/all.scss](css/all.scss)
@@ -74,9 +72,6 @@ import "carbon-components-svelte/css/white.css";
7472
// Gray 10 theme
7573
import "carbon-components-svelte/css/g10.css";
7674

77-
// Gray 80 theme
78-
import "carbon-components-svelte/css/g80.css";
79-
8075
// Gray 90 theme
8176
import "carbon-components-svelte/css/g90.css";
8277

@@ -147,7 +142,7 @@ Programmatically switch between each of the five Carbon themes by setting the "t
147142

148143
```html
149144
<script>
150-
let theme = "white"; // "white" | "g10" | "g80" | "g90" | "g100"
145+
let theme = "white"; // "white" | "g10" | "g90" | "g100"
151146
152147
$: document.documentElement.setAttribute("theme", theme);
153148
</script>

css/all.css

Lines changed: 23847 additions & 1 deletion
Large diffs are not rendered by default.

css/all.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/all.scss

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Use all Carbon themes
2+
@use '@carbon/styles/scss/config' with (
3+
$use-akamai-cdn: true,
4+
$use-flexbox-grid: true,
5+
$prefix: 'bx'
6+
);
7+
@use "@carbon/styles" as styles;
8+
9+
:root {
10+
@include styles.theme(styles.$white);
11+
}
12+
13+
[theme='g10'] {
14+
@include styles.theme(styles.$g10);
15+
}
16+
17+
[theme='g90'] {
18+
@include styles.theme(styles.$g90);
19+
}
20+
21+
[theme='g100'] {
22+
@include styles.theme(styles.$g100);
23+
}

css/g10.css

Lines changed: 22593 additions & 1 deletion
Large diffs are not rendered by default.

css/g10.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/g10.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@use '@carbon/styles/scss/config' with (
2+
$use-akamai-cdn: true,
3+
$use-flexbox-grid: true,
4+
$prefix: 'bx'
5+
);
6+
@use "@carbon/styles" as styles;
7+
8+
:root {
9+
@include styles.theme(styles.$g10);
10+
}

css/g100.css

Lines changed: 22593 additions & 1 deletion
Large diffs are not rendered by default.

css/g100.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)