@carbon/styles 0.12.0-rc.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -10
- package/scss/_config.scss +6 -0
- package/scss/components/tabs/_tabs.scss +21 -0
- package/scss/fonts/_src.scss +100 -28
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/styles",
|
|
3
3
|
"description": "Styles for the Carbon Design System",
|
|
4
|
-
"version": "0.12.0
|
|
4
|
+
"version": "0.12.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -20,18 +20,18 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@carbon/colors": "^10.35.0
|
|
24
|
-
"@carbon/feature-flags": "^0.7.0
|
|
25
|
-
"@carbon/grid": "^10.40.0
|
|
26
|
-
"@carbon/layout": "^10.35.0
|
|
27
|
-
"@carbon/motion": "^10.27.0
|
|
28
|
-
"@carbon/themes": "^10.49.0
|
|
29
|
-
"@carbon/type": "^10.40.0
|
|
23
|
+
"@carbon/colors": "^10.35.0",
|
|
24
|
+
"@carbon/feature-flags": "^0.7.0",
|
|
25
|
+
"@carbon/grid": "^10.40.0",
|
|
26
|
+
"@carbon/layout": "^10.35.0",
|
|
27
|
+
"@carbon/motion": "^10.27.0",
|
|
28
|
+
"@carbon/themes": "^10.49.0",
|
|
29
|
+
"@carbon/type": "^10.40.0",
|
|
30
30
|
"@ibm/plex": "6.0.0-next.6"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@carbon/test-utils": "^10.21.0
|
|
33
|
+
"@carbon/test-utils": "^10.21.0",
|
|
34
34
|
"css": "^3.0.0"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "ac4b4bf03cf93cb8463916231619fbfdc72f0be5"
|
|
37
37
|
}
|
package/scss/_config.scss
CHANGED
|
@@ -36,6 +36,12 @@ $font-display: 'swap' !default;
|
|
|
36
36
|
/// @group config
|
|
37
37
|
$font-path: '~@ibm/plex' !default;
|
|
38
38
|
|
|
39
|
+
/// Specify if IBM Plex should be provided by Google Fonts
|
|
40
|
+
/// @access public
|
|
41
|
+
/// @type String
|
|
42
|
+
/// @group config
|
|
43
|
+
$use-google-fonts: false !default;
|
|
44
|
+
|
|
39
45
|
/// The value used to prefix selectors and CSS Custom Properties across the
|
|
40
46
|
/// codebase
|
|
41
47
|
/// @access public
|
|
@@ -23,12 +23,15 @@
|
|
|
23
23
|
@use '../../utilities/rotate' as *;
|
|
24
24
|
@use '../../utilities/box-shadow' as *;
|
|
25
25
|
@use '../../utilities/component-tokens' as *;
|
|
26
|
+
@use '../../utilities/custom-property';
|
|
26
27
|
@use '../../utilities/skeleton' as *;
|
|
27
28
|
@use '../../utilities/visually-hidden' as *;
|
|
28
29
|
@use '../../utilities/button-reset';
|
|
29
30
|
@use '../../utilities/high-contrast-mode' as *;
|
|
30
31
|
@use '../../utilities/convert' as *;
|
|
31
32
|
|
|
33
|
+
$icon-tab-size: custom-property.get-var('icon-tab-size', rem(40px));
|
|
34
|
+
|
|
32
35
|
/// Tabs styles
|
|
33
36
|
/// @access public
|
|
34
37
|
/// @group tabs
|
|
@@ -244,6 +247,24 @@
|
|
|
244
247
|
text-align: left;
|
|
245
248
|
}
|
|
246
249
|
|
|
250
|
+
//-----------------------------
|
|
251
|
+
// Icon Item
|
|
252
|
+
//-----------------------------
|
|
253
|
+
|
|
254
|
+
.#{$prefix}--tabs__nav-item--icon,
|
|
255
|
+
&.#{$prefix}--tabs--contained .#{$prefix}--tabs__nav-item--icon {
|
|
256
|
+
display: flex;
|
|
257
|
+
width: $icon-tab-size;
|
|
258
|
+
height: $icon-tab-size;
|
|
259
|
+
align-items: center;
|
|
260
|
+
justify-content: center;
|
|
261
|
+
padding: 0;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
&.#{$prefix}--tabs__icon--lg {
|
|
265
|
+
@include custom-property.declaration('icon-tab-size', rem(48px));
|
|
266
|
+
}
|
|
267
|
+
|
|
247
268
|
//-----------------------------
|
|
248
269
|
// Item Hover
|
|
249
270
|
//-----------------------------
|
package/scss/fonts/_src.scss
CHANGED
|
@@ -21,6 +21,57 @@ $-filenames: (
|
|
|
21
21
|
IBM-Plex-Serif: 'IBMPlexSerif',
|
|
22
22
|
);
|
|
23
23
|
|
|
24
|
+
$-google-filenames: (
|
|
25
|
+
IBM-Plex-Mono: (
|
|
26
|
+
name: 'ibmplexmono',
|
|
27
|
+
version: 'v7',
|
|
28
|
+
hash: '-F63fjptAgt5VM-kVkqdyU8n1i8q131nj-otFQ',
|
|
29
|
+
),
|
|
30
|
+
IBM-Plex-Sans-Arabic: (
|
|
31
|
+
name: 'ibmplexsansarabic',
|
|
32
|
+
version: 'v5',
|
|
33
|
+
hash: 'Qw3CZRtWPQCuHme67tEYUIx3Kh0PHR9N6Ys43PW5fslBEg0',
|
|
34
|
+
),
|
|
35
|
+
IBM-Plex-Sans-Devanagari: (
|
|
36
|
+
name: 'ibmplexsansdevanagari',
|
|
37
|
+
version: 'v5',
|
|
38
|
+
hash: 'XRXH3JCMvG4IDoS9SubXB6W-UX5iehIMBFR2-O_PX0j1Uc7wCWQq',
|
|
39
|
+
),
|
|
40
|
+
IBM-Plex-Sans-Hebrew: (
|
|
41
|
+
name: 'ibmplexsanshebrew',
|
|
42
|
+
version: 'v5',
|
|
43
|
+
hash: 'BCa2qYENg9Kw1mpLpO0bGM5lfHAAZHhDXE2v-lgVrjaNzC4',
|
|
44
|
+
),
|
|
45
|
+
IBM-Plex-Sans-Thai-Looped: (
|
|
46
|
+
name: 'ibmplexsansthailooped',
|
|
47
|
+
version: 'v5',
|
|
48
|
+
hash: 'tss_AoJJRAhL3BTrK3r2xxbFhvKfyBB6l7hHT30L9BiKoXOrFCUb6Q',
|
|
49
|
+
),
|
|
50
|
+
IBM-Plex-Sans-Thai: (
|
|
51
|
+
name: 'ibmplexsansthai',
|
|
52
|
+
version: 'v5',
|
|
53
|
+
hash: 'm8JPje1VVIzcq1HzJq2AEdo2Tj_qvLqMBNYgR8BKU4cX',
|
|
54
|
+
),
|
|
55
|
+
IBM-Plex-Sans: (
|
|
56
|
+
name: 'ibmplexsans',
|
|
57
|
+
version: 'v9',
|
|
58
|
+
hash: 'zYXgKVElMYYaJe8bpLHnCwDKhdzeFaxOedfTDw',
|
|
59
|
+
),
|
|
60
|
+
IBM-Plex-Serif: (
|
|
61
|
+
name: 'ibmplexserif',
|
|
62
|
+
version: 'v10',
|
|
63
|
+
hash: 'jizDREVNn1dOx-zrZ2X3pZvkTiUS2zcZiVbJsNo',
|
|
64
|
+
),
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
@function -get-google-filename($map, $keys...) {
|
|
68
|
+
@each $key in $keys {
|
|
69
|
+
$map: map-get($map, $key);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@return $map;
|
|
73
|
+
}
|
|
74
|
+
|
|
24
75
|
@function -get-base-filename($name) {
|
|
25
76
|
@return map.get($-filenames, $name);
|
|
26
77
|
}
|
|
@@ -37,44 +88,65 @@ $-filenames: (
|
|
|
37
88
|
/// @param {List} $formats
|
|
38
89
|
/// @returns List
|
|
39
90
|
@function -default-resolver($name, $weight, $style, $unicode-range, $formats) {
|
|
40
|
-
|
|
91
|
+
@if (config.$use-google-fonts) {
|
|
92
|
+
$filename: -get-google-filename($-google-filenames, $name, 'name');
|
|
93
|
+
$version: -get-google-filename($-google-filenames, $name, 'version');
|
|
94
|
+
$hash: -get-google-filename($-google-filenames, $name, 'hash');
|
|
41
95
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
@
|
|
45
|
-
$
|
|
46
|
-
|
|
47
|
-
|
|
96
|
+
$filenames: ();
|
|
97
|
+
|
|
98
|
+
@each $format in $formats {
|
|
99
|
+
$url: 'https://fonts.gstatic.com/s/#{$filename}/#{$version}/#{$hash}';
|
|
100
|
+
|
|
101
|
+
// Add extension
|
|
102
|
+
$url: '#{$url}.#{$format}';
|
|
103
|
+
$filenames: list.append(
|
|
104
|
+
$filenames,
|
|
105
|
+
url('#{$url}') format('#{$format}'),
|
|
106
|
+
$separator: comma
|
|
107
|
+
);
|
|
48
108
|
}
|
|
109
|
+
|
|
110
|
+
@return $filenames;
|
|
49
111
|
} @else {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
112
|
+
$filename: -get-base-filename($name);
|
|
113
|
+
|
|
114
|
+
// Special case for weight = Regular (400)
|
|
115
|
+
@if $weight == Regular {
|
|
116
|
+
@if $style == italic {
|
|
117
|
+
$filename: '#{$filename}-Italic';
|
|
118
|
+
} @else {
|
|
119
|
+
$filename: '#{$filename}-Regular';
|
|
120
|
+
}
|
|
121
|
+
} @else {
|
|
122
|
+
// Otherwise add weight + optional style (italic)
|
|
123
|
+
$filename: '#{$filename}-#{$weight}';
|
|
124
|
+
@if $style == italic {
|
|
125
|
+
$filename: '#{$filename}Italic';
|
|
126
|
+
}
|
|
54
127
|
}
|
|
55
|
-
}
|
|
56
128
|
|
|
57
|
-
|
|
129
|
+
$filenames: ();
|
|
58
130
|
|
|
59
|
-
|
|
60
|
-
|
|
131
|
+
@each $format in $formats {
|
|
132
|
+
$url: $filename;
|
|
133
|
+
@if $unicode-range {
|
|
134
|
+
$url: '#{config.$font-path}/#{$name}/fonts/split/#{$format}/#{$filename}-#{$unicode-range}';
|
|
135
|
+
} @else {
|
|
136
|
+
$url: '#{config.$font-path}/#{$name}/fonts/complete/#{$format}/#{$filename}';
|
|
137
|
+
}
|
|
61
138
|
|
|
62
|
-
|
|
63
|
-
$url: '#{
|
|
64
|
-
|
|
65
|
-
|
|
139
|
+
// Add extension
|
|
140
|
+
$url: '#{$url}.#{$format}';
|
|
141
|
+
$filenames: list.append(
|
|
142
|
+
$filenames,
|
|
143
|
+
url('#{$url}') format('#{$format}'),
|
|
144
|
+
$separator: comma
|
|
145
|
+
);
|
|
66
146
|
}
|
|
67
147
|
|
|
68
|
-
|
|
69
|
-
$url: '#{$url}.#{$format}';
|
|
70
|
-
$filenames: list.append(
|
|
71
|
-
$filenames,
|
|
72
|
-
url('#{$url}') format('#{$format}'),
|
|
73
|
-
$separator: comma
|
|
74
|
-
);
|
|
148
|
+
@return $filenames;
|
|
75
149
|
}
|
|
76
|
-
|
|
77
|
-
@return $filenames;
|
|
78
150
|
}
|
|
79
151
|
|
|
80
152
|
/// The resolver used for locating the filepaths in `url() format()` values in
|