-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample-custom.scss
95 lines (78 loc) · 3.15 KB
/
example-custom.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
@use '@bcgov-nr/nr-theme/design-tokens/light-theme.scss' as light;
@use '@bcgov-nr/nr-theme/design-tokens/dark-theme.scss' as dark;
@use '@bcgov-nr/nr-theme/design-tokens/colors.scss' as colors;
@use '@bcgov-nr/nr-theme/design-tokens/type-family.scss' as types;
@use '@bcgov-nr/nr-theme/style-sheets/carbon-components-overrides.scss';
@use '@carbon/type/scss/_font-family.scss' with (
$font-families: types.$type-family,
$font-weights: types.$font-weights
);
// Set the correct light theme
@use '@carbon/react/scss/themes';
@use '@carbon/react/scss/theme' with (
$fallback: themes.$white,
$theme: (
light.$light-theme,
)
);
@use '@carbon/themes/scss/utilities';
// Buttons, tags and notifications components tokens doesn't work properly
// when setting directly on the theme, so we override the tokens directly
// on the components
// (Open issue: https://github.com/carbon-design-system/carbon/issues/12376)
@use '@carbon/react/scss/components/button/tokens' as button-tokens;
@use '@bcgov-nr/nr-theme/design-tokens/light-buttons.scss' as
light-button-overrides;
@use '@bcgov-nr/nr-theme/design-tokens/dark-buttons.scss' as
dark-button-overrides;
@use '@carbon/react/scss/components/tag/tokens' as tag-tokens;
@use '@bcgov-nr/nr-theme/design-tokens/light-tags.scss' as light-tag-overrides;
@use '@bcgov-nr/nr-theme/design-tokens/dark-tags.scss' as dark-tag-overrides;
@use '@carbon/react/scss/components/notification/tokens' as notification-tokens;
@use '@bcgov-nr/nr-theme/design-tokens/light-notifications.scss' as
light-notification-overrides;
@use '@bcgov-nr/nr-theme/design-tokens/dark-notifications.scss' as
dark-notification-overrides;
@use '@carbon/react';
@use '@carbon/grid';
// Emit the flex-grid styles
@include grid.flex-grid();
:root {
@include theme.theme();
}
[data-carbon-theme='g100'] {
$button-tokens: utilities.merge(
button-tokens.$button-tokens,
dark-button-overrides.$dark-button-token-overrides
);
$tag-tokens: utilities.merge(
tag-tokens.$tag-tokens,
dark-tag-overrides.$dark-tag-token-overrides
);
$notification-tokens: utilities.merge(
notification-tokens.$notification-tokens,
dark-notification-overrides.$dark-notification-token-overrides
);
@include theme.add-component-tokens($button-tokens);
@include theme.add-component-tokens($tag-tokens);
@include theme.add-component-tokens($notification-tokens);
@include react.theme(dark.$dark-theme);
}
[data-carbon-theme='g10'] {
$button-tokens: utilities.merge(
button-tokens.$button-tokens,
light-button-overrides.$light-button-token-overrides
);
$tag-tokens: utilities.merge(
tag-tokens.$tag-tokens,
light-tag-overrides.$light-tag-token-overrides
);
$notification-tokens: utilities.merge(
notification-tokens.$notification-tokens,
light-notification-overrides.$light-notification-token-overrides
);
@include theme.add-component-tokens($button-tokens);
@include theme.add-component-tokens($tag-tokens);
@include theme.add-component-tokens($notification-tokens);
@include react.theme(light.$light-theme);
}