File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed
examples/components/layer Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 9
9
< head >
10
10
< title > carbon-web-components example</ title >
11
11
< meta charset ="UTF-8 " />
12
-
12
+
13
13
< link rel ="stylesheet " href ="src/styles.scss " />
14
- < style >
15
- .example-layer-test-component {
16
- padding : 1rem ;
17
- }
18
- </ style >
19
14
< script type ="module " src ="src/index.js "> </ script >
20
15
</ head >
21
16
< body >
Original file line number Diff line number Diff line change 1
1
@use ' @carbon/styles/scss/reset' ;
2
2
@use ' @carbon/styles/scss/theme' ;
3
3
@use ' @carbon/styles/scss/themes' ;
4
+ @use ' @carbon/styles/scss/spacing' ;
4
5
5
6
:root {
6
7
@include theme .theme (themes .$white );
7
8
background-color : var (--cds-background );
8
9
color : var (--cds-text-primary );
9
10
}
11
+
12
+ .example-layer-test-component {
13
+ padding : spacing .$spacing-05 ;
14
+ background : theme .$layer ;
15
+ }
Original file line number Diff line number Diff line change @@ -36,11 +36,15 @@ import '@carbon/web-components/es/components/layer/index.js';
36
36
37
37
### HTML
38
38
39
- Here we define a custom test class to define a custom padding.
39
+ Here we define a custom test class to define a custom padding and background using tokens, which must be imported via Sass .
40
40
41
41
``` css
42
+ @use '@carbon/styles/scss/spacing';
43
+ @use '@carbon/styles/scss/theme';
44
+
42
45
.example-layer-test-component {
43
- padding : 1rem ;
46
+ padding : spacing.$spacing-05;
47
+ background : theme.$layer;
44
48
}
45
49
```
46
50
You can’t perform that action at this time.
0 commit comments