@carbon/styles 0.9.0 → 0.10.0-rc.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/styles",
3
3
  "description": "Styles for the Carbon Design System",
4
- "version": "0.9.0",
4
+ "version": "0.10.0-rc.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -33,5 +33,5 @@
33
33
  "@carbon/test-utils": "^10.20.0",
34
34
  "css": "^3.0.0"
35
35
  },
36
- "gitHead": "1836ce1cac8d9a08314b62058a5ed258798901a8"
36
+ "gitHead": "919fcfc3b4e247d057c6112f8cacf8aec33fe234"
37
37
  }
@@ -15,7 +15,6 @@
15
15
  @use '../../utilities/focus-outline';
16
16
  @use '../../utilities/high-contrast-mode' as *;
17
17
  @use '../../utilities/skeleton' as *;
18
- @use '../../utilities/tooltip' as *;
19
18
  @use '../../utilities/visually-hidden' as *;
20
19
  @use 'tokens' as *;
21
20
 
@@ -145,118 +144,9 @@
145
144
  &.#{$prefix}--btn--md {
146
145
  padding: $button-padding-ghost-field;
147
146
  }
148
- }
149
-
150
- .#{$prefix}--btn.#{$prefix}--btn--icon-only.#{$prefix}--tooltip__trigger {
151
- @include tooltip--trigger('icon', 'bottom');
152
-
153
- svg,
154
- &:hover svg,
155
- &:focus svg {
156
- fill: currentColor;
157
- }
158
-
159
- &.#{$prefix}--btn--disabled.#{$prefix}--tooltip--a11y::before,
160
- &.#{$prefix}--btn--disabled.#{$prefix}--tooltip--a11y::after,
161
- &.#{$prefix}--btn--disabled .#{$prefix}--assistive-text {
162
- overflow: hidden;
163
- margin: -1px;
164
- clip: rect(0, 0, 0, 0);
165
- opacity: 0;
166
- }
167
- }
168
-
169
- // Allow pointer events on tooltip when tooltip is visible
170
- .#{$prefix}--btn.#{$prefix}--btn--icon-only:not(.#{$prefix}--tooltip--hidden)
171
- .#{$prefix}--assistive-text {
172
- pointer-events: all;
173
- }
174
-
175
- .#{$prefix}--btn.#{$prefix}--btn--icon-only.#{$prefix}--tooltip__trigger:focus {
176
- border-color: $focus;
177
- }
178
-
179
- .#{$prefix}--btn.#{$prefix}--btn--icon-only.#{$prefix}--tooltip__trigger:active:not([disabled]) {
180
- border-color: transparent;
181
- }
182
-
183
- .#{$prefix}--btn.#{$prefix}--btn--icon-only.#{$prefix}--tooltip__trigger:focus
184
- svg {
185
- outline-color: transparent;
186
- }
187
-
188
- .#{$prefix}--btn.#{$prefix}--btn--icon-only.#{$prefix}--tooltip__trigger[disabled]:hover,
189
- .#{$prefix}--btn.#{$prefix}--btn--icon-only.#{$prefix}--tooltip__trigger[disabled]:focus,
190
- .#{$prefix}--btn.#{$prefix}--btn--icon-only.#{$prefix}--tooltip__trigger[disabled]:active {
191
- cursor: not-allowed;
192
- fill: $icon-on-color-disabled;
193
- }
194
-
195
- .#{$prefix}--tooltip__trigger.#{$prefix}--btn--icon-only--top {
196
- @include tooltip--trigger('icon', 'top');
197
- @include tooltip--placement('icon', 'top', 'center');
198
-
199
- &.#{$prefix}--tooltip--align-start {
200
- @include tooltip--placement('icon', 'top', 'start');
201
- }
202
-
203
- &.#{$prefix}--tooltip--align-center {
204
- @include tooltip--placement('icon', 'top', 'center');
205
- }
206
-
207
- &.#{$prefix}--tooltip--align-end {
208
- @include tooltip--placement('icon', 'top', 'end');
209
- }
210
- }
211
-
212
- .#{$prefix}--tooltip__trigger.#{$prefix}--btn--icon-only--right {
213
- @include tooltip--trigger('icon', 'right');
214
- @include tooltip--placement('icon', 'right', 'center');
215
-
216
- &.#{$prefix}--tooltip--align-start {
217
- @include tooltip--placement('icon', 'right', 'start');
218
- }
219
-
220
- &.#{$prefix}--tooltip--align-center {
221
- @include tooltip--placement('icon', 'right', 'center');
222
- }
223
-
224
- &.#{$prefix}--tooltip--align-end {
225
- @include tooltip--placement('icon', 'right', 'end');
226
- }
227
- }
228
-
229
- .#{$prefix}--tooltip__trigger.#{$prefix}--btn--icon-only--bottom {
230
- @include tooltip--trigger('icon', 'bottom');
231
- @include tooltip--placement('icon', 'bottom', 'center');
232
-
233
- &.#{$prefix}--tooltip--align-start {
234
- @include tooltip--placement('icon', 'bottom', 'start');
235
- }
236
-
237
- &.#{$prefix}--tooltip--align-center {
238
- @include tooltip--placement('icon', 'bottom', 'center');
239
- }
240
-
241
- &.#{$prefix}--tooltip--align-end {
242
- @include tooltip--placement('icon', 'bottom', 'end');
243
- }
244
- }
245
-
246
- .#{$prefix}--tooltip__trigger.#{$prefix}--btn--icon-only--left {
247
- @include tooltip--trigger('icon', 'left');
248
- @include tooltip--placement('icon', 'left', 'center');
249
-
250
- &.#{$prefix}--tooltip--align-start {
251
- @include tooltip--placement('icon', 'left', 'start');
252
- }
253
-
254
- &.#{$prefix}--tooltip--align-center {
255
- @include tooltip--placement('icon', 'left', 'center');
256
- }
257
147
 
258
- &.#{$prefix}--tooltip--align-end {
259
- @include tooltip--placement('icon', 'left', 'end');
148
+ &:not([disabled]) svg {
149
+ fill: $icon-primary;
260
150
  }
261
151
  }
262
152
 
@@ -62,11 +62,11 @@ $button-secondary: (
62
62
  ),
63
63
  (
64
64
  theme: themes.$g10,
65
- value: #6f6f6f,
65
+ value: #393939,
66
66
  ),
67
67
  (
68
68
  theme: themes.$g90,
69
- value: #393939,
69
+ value: #6f6f6f,
70
70
  ),
71
71
  (
72
72
  theme: themes.$g100,
@@ -41,6 +41,9 @@
41
41
  // to match the specs.
42
42
  .#{$prefix}--checkbox {
43
43
  @include visually-hidden;
44
+ //even though its hidden, positioning is for native validation to be aligned to checkbox
45
+ top: 1.25rem;
46
+ left: 0.7rem;
44
47
  }
45
48
 
46
49
  // The label corresponds to the content inside of the `label` tag. Since we're
@@ -50,16 +50,19 @@ $input-label-weight: 400 !default;
50
50
  @include type-style('label-01');
51
51
 
52
52
  display: inline-block;
53
- @if not enabled('enable-v11-release') {
54
- margin-bottom: $spacing-03;
55
- }
56
-
53
+ margin-bottom: $spacing-03;
57
54
  color: $text-secondary;
58
55
  font-weight: $input-label-weight;
59
56
  line-height: 1rem;
60
57
  vertical-align: baseline;
61
58
  }
62
59
 
60
+ @if enabled('enable-v11-release') {
61
+ .#{$prefix}--label--no-margin {
62
+ margin-bottom: 0;
63
+ }
64
+ }
65
+
63
66
  .#{$prefix}--label .#{$prefix}--tooltip__trigger {
64
67
  // When tooltip trigger is put in form label the trigger button should fit in the size of label
65
68
  // https://github.com/IBM/carbon-components-react/issues/115
@@ -16,6 +16,7 @@
16
16
  @use '../../utilities/focus-outline' as *;
17
17
  @use '../../utilities/high-contrast-mode' as *;
18
18
  @use '../../utilities/convert' as *;
19
+ @use '../../utilities/z-index' as *;
19
20
 
20
21
  /// Overflow menu styles
21
22
  /// @access public
@@ -61,6 +61,15 @@ $popover-text-color: custom-property.get-var(
61
61
  // stylelint-disable-next-line length-zero-no-unit
62
62
  $popover-offset: custom-property.get-var('popover-offset', 0rem);
63
63
 
64
+ // Customize the dimensions of the caret by specifying its width or height.
65
+ // These values will be flipped in left or right directions to have the
66
+ // correct dimensions
67
+ $popover-caret-width: custom-property.get-var('popover-caret-width', rem(12px));
68
+ $popover-caret-height: custom-property.get-var(
69
+ 'popover-caret-height',
70
+ rem(6px)
71
+ );
72
+
64
73
  @mixin popover {
65
74
  // Container
66
75
  .#{$prefix}--popover-container {
@@ -202,8 +211,8 @@ $popover-offset: custom-property.get-var('popover-offset', 0rem);
202
211
  .#{$prefix}--popover--bottom-right .#{$prefix}--popover-caret {
203
212
  bottom: 0;
204
213
  left: 50%;
205
- width: rem(12px);
206
- height: rem(6px);
214
+ width: $popover-caret-width;
215
+ height: $popover-caret-height;
207
216
  clip-path: polygon(0% 100%, 50% 0%, 100% 100%);
208
217
  transform: translate(-50%, $popover-offset);
209
218
  }
@@ -248,8 +257,8 @@ $popover-offset: custom-property.get-var('popover-offset', 0rem);
248
257
  .#{$prefix}--popover--top-right .#{$prefix}--popover-caret {
249
258
  top: 0;
250
259
  left: 50%;
251
- width: rem(12px);
252
- height: rem(6px);
260
+ width: $popover-caret-width;
261
+ height: $popover-caret-height;
253
262
  clip-path: polygon(0% 0%, 50% 100%, 100% 0%);
254
263
  transform: translate(-50%, calc(-1 * $popover-offset));
255
264
  }
@@ -296,8 +305,8 @@ $popover-offset: custom-property.get-var('popover-offset', 0rem);
296
305
  .#{$prefix}--popover--right-bottom .#{$prefix}--popover-caret {
297
306
  top: 50%;
298
307
  left: 100%;
299
- width: rem(6px);
300
- height: rem(12px);
308
+ width: $popover-caret-height;
309
+ height: $popover-caret-width;
301
310
  clip-path: polygon(0% 50%, 100% 0%, 100% 100%);
302
311
  transform: translate(calc($popover-offset - 100%), -50%);
303
312
  }
@@ -348,8 +357,8 @@ $popover-offset: custom-property.get-var('popover-offset', 0rem);
348
357
  .#{$prefix}--popover--left-bottom .#{$prefix}--popover-caret {
349
358
  top: 50%;
350
359
  right: 100%;
351
- width: rem(6px);
352
- height: rem(12px);
360
+ width: $popover-caret-height;
361
+ height: $popover-caret-width;
353
362
  clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
354
363
  transform: translate(calc(-1 * $popover-offset + 100%), -50%);
355
364
  }
@@ -33,437 +33,8 @@
33
33
  /// @access public
34
34
  /// @group tabs
35
35
  @mixin tabs {
36
- .#{$prefix}--tabs {
37
- @include reset;
38
- @include type-style('body-short-01');
39
-
40
- position: relative;
41
- width: 100%;
42
- height: auto;
43
- color: $text-primary;
44
- @include breakpoint(md) {
45
- min-height: rem(40px);
46
- background: none;
47
- }
48
- }
49
-
50
- .#{$prefix}--tabs--container {
51
- @include breakpoint(md) {
52
- min-height: rem(48px);
53
- }
54
- }
55
-
56
- .#{$prefix}--tabs-trigger {
57
- display: flex;
58
- height: rem(40px);
59
- align-items: center;
60
- justify-content: space-between;
61
- padding: 0 $spacing-09 0 $spacing-05;
62
- border-bottom: 1px solid $border-strong;
63
- background-color: $layer;
64
- color: $text-primary;
65
- cursor: pointer;
66
- outline: 2px solid transparent;
67
-
68
- @include breakpoint(md) {
69
- display: none;
70
- }
71
- }
72
-
73
- .#{$prefix}--tabs-trigger:focus,
74
- .#{$prefix}--tabs-trigger:active {
75
- @include focus-outline('outline');
76
- }
77
-
78
- .#{$prefix}--tabs-trigger svg {
79
- position: absolute;
80
- right: $spacing-05;
81
- fill: $border-inverse;
82
- transition: transform $duration-fast-01 motion(standard, productive);
83
- }
84
-
85
- .#{$prefix}--tabs-trigger--open:focus,
86
- .#{$prefix}--tabs-trigger--open:active {
87
- @include focus-outline('reset');
88
-
89
- transition: outline $duration-fast-01 motion(standard, productive);
90
- }
91
-
92
- .#{$prefix}--tabs-trigger--open {
93
- background: $layer-accent;
94
- }
95
-
96
- .#{$prefix}--tabs-trigger--open svg {
97
- @include rotate(-180deg, $duration-fast-01, 50% 45%);
98
- }
99
-
100
- // There is only a difference in tab color when in mobile/dropdown view
101
- .#{$prefix}--tabs--light.#{$prefix}--tabs-trigger {
102
- background-color: $field-02;
103
- }
104
-
105
- .#{$prefix}--tabs-trigger-text {
106
- overflow: hidden;
107
- padding-top: 2px;
108
- color: $text-primary;
109
- font-weight: 400;
110
- text-decoration: none;
111
- text-overflow: ellipsis;
112
- white-space: nowrap;
113
- }
114
-
115
- .#{$prefix}--tabs-trigger-text:hover {
116
- color: $text-primary;
117
- }
118
-
119
- .#{$prefix}--tabs-trigger-text:focus {
120
- outline: none;
121
- }
122
-
123
- .#{$prefix}--tabs__nav {
124
- @include box-shadow;
125
-
126
- position: absolute;
127
- z-index: z('dropdown');
128
- display: flex;
129
- width: 100%;
130
- max-height: 600px;
131
- flex-direction: column;
132
- padding: 0;
133
- margin: 0;
134
- background: $layer;
135
- list-style: none;
136
- transition: max-height $duration-fast-01 motion(standard, productive);
137
-
138
- @include breakpoint(md) {
139
- z-index: auto;
140
- width: auto;
141
- flex-direction: row;
142
- background: none;
143
- box-shadow: none;
144
- transition: inherit;
145
- }
146
- }
147
-
148
- .#{$prefix}--tabs__nav--hidden {
149
- overflow: hidden;
150
- max-height: 0;
151
- transition: max-height $duration-fast-01 motion(standard, productive);
152
-
153
- @include breakpoint(md) {
154
- display: flex;
155
- max-width: 100%;
156
- max-height: none;
157
- overflow-x: auto;
158
- transition: inherit;
159
- }
160
- }
161
-
162
- //-----------------------------
163
- // Item
164
- //-----------------------------
165
- .#{$prefix}--tabs__nav-item {
166
- @include reset;
167
-
168
- display: flex;
169
- width: 100%;
170
- height: rem(40px);
171
- padding: 0;
172
- background-color: $layer;
173
- cursor: pointer;
174
- transition: background-color $duration-fast-01 motion(standard, productive);
175
-
176
- @include breakpoint(md) {
177
- height: auto;
178
- background: transparent;
179
-
180
- + .#{$prefix}--tabs__nav-item {
181
- margin-left: rem(1px);
182
- }
183
- }
184
- }
185
-
186
- .#{$prefix}--tabs--container .#{$prefix}--tabs__nav-item {
187
- @include breakpoint(md) {
188
- background-color: $layer-accent;
189
-
190
- + .#{$prefix}--tabs__nav-item {
191
- margin-left: 0;
192
- // Draws the border without affecting the inner-content
193
- box-shadow: -1px 0 0 0 $border-strong;
194
- }
195
-
196
- + .#{$prefix}--tabs__nav-item.#{$prefix}--tabs__nav-item--selected,
197
- &.#{$prefix}--tabs__nav-item--selected + .#{$prefix}--tabs__nav-item {
198
- box-shadow: none;
199
- }
200
- }
201
- }
202
-
203
- .#{$prefix}--tabs__nav-item .#{$prefix}--tabs__nav-link {
204
- transition: color $duration-fast-01 motion(standard, productive),
205
- border-bottom-color $duration-fast-01 motion(standard, productive),
206
- outline $duration-fast-01 motion(standard, productive);
207
- }
208
-
209
- //-----------------------------
210
- // Item Hover
211
- //-----------------------------
212
- .#{$prefix}--tabs__nav-item:hover:not(.#{$prefix}--tabs__nav-item--selected) {
213
- @include breakpoint(md) {
214
- background: transparent;
215
- }
216
- }
217
-
218
- .#{$prefix}--tabs__nav-item:hover:not(.#{$prefix}--tabs__nav-item--disabled) {
219
- background-color: $layer-hover;
220
- box-shadow: 0 -1px 0 $layer-hover;
221
-
222
- @include breakpoint(md) {
223
- background-color: transparent;
224
-
225
- + .#{$prefix}--tabs__nav-item {
226
- box-shadow: none;
227
- }
228
- }
229
- }
230
-
231
- .#{$prefix}--tabs--container
232
- .#{$prefix}--tabs__nav-item:hover:not(.#{$prefix}--tabs__nav-item--disabled) {
233
- @include breakpoint(md) {
234
- background-color: $layer-selected-hover;
235
- }
236
- }
237
-
238
- //---------------------------------------------
239
- // Item Disabled
240
- //---------------------------------------------
241
- .#{$prefix}--tabs__nav-item--disabled,
242
- .#{$prefix}--tabs__nav-item--disabled:hover {
243
- cursor: not-allowed;
244
- outline: none;
245
- }
246
-
247
- .#{$prefix}--tabs--container
248
- .#{$prefix}--tabs__nav-item.#{$prefix}--tabs__nav-item--disabled,
249
- .#{$prefix}--tabs--container
250
- .#{$prefix}--tabs__nav-item.#{$prefix}--tabs__nav-item--disabled:hover {
251
- @include breakpoint(md) {
252
- background-color: button.$button-disabled;
253
- }
254
- }
255
-
256
- .#{$prefix}--tabs--container
257
- .#{$prefix}--tabs__nav-item--disabled
258
- .#{$prefix}--tabs__nav-link {
259
- @include breakpoint(md) {
260
- border-bottom: none;
261
- color: $text-on-color-disabled;
262
- }
263
- }
264
-
265
- //-----------------------------
266
- // Item Selected
267
- //-----------------------------
268
- .#{$prefix}--tabs__nav-item--selected:not(.#{$prefix}--tabs__nav-item--disabled) {
269
- display: none;
270
- border: none;
271
- transition: color $duration-fast-01 motion(standard, productive);
272
-
273
- @include breakpoint(md) {
274
- display: flex;
275
- .#{$prefix}--tabs__nav-link,
276
- .#{$prefix}--tabs__nav-link:focus,
277
- .#{$prefix}--tabs__nav-link:active {
278
- @include type-style('productive-heading-01');
279
-
280
- border-bottom: 2px solid $border-interactive;
281
- color: $text-primary;
282
- }
283
- }
284
- }
285
-
286
- .#{$prefix}--tabs--container
287
- .#{$prefix}--tabs__nav-item--selected:not(.#{$prefix}--tabs__nav-item--disabled),
288
- .#{$prefix}--tabs--container
289
- .#{$prefix}--tabs__nav-item--selected:hover:not(.#{$prefix}--tabs__nav-item--disabled) {
290
- @include breakpoint(md) {
291
- background-color: $layer;
292
-
293
- .#{$prefix}--tabs__nav-link {
294
- padding: $spacing-03 $spacing-05;
295
- border-bottom: none;
296
- box-shadow: inset 0 2px 0 0 $border-interactive;
297
- // height - vertical padding
298
- // Draws the border without affecting the inner-content
299
- line-height: calc(#{rem(48px)} - (#{$spacing-03} * 2));
300
- }
301
-
302
- .#{$prefix}--tabs__nav-link:focus,
303
- .#{$prefix}--tabs__nav-link:active {
304
- box-shadow: none;
305
- }
306
- }
307
- }
308
-
309
- //-----------------------------
310
- // Link
311
- //-----------------------------
312
- a.#{$prefix}--tabs__nav-link {
313
- @include focus-outline('reset');
314
-
315
- display: inline-block;
316
- overflow: hidden;
317
- width: calc(100% - 32px);
318
- height: rem(40px);
319
- padding: $spacing-04 0;
320
- border-bottom: 1px solid $border-subtle;
321
- margin: 0 $spacing-05;
322
- color: $text-secondary;
323
- font-weight: 400;
324
- line-height: 1rem;
325
- text-decoration: none;
326
- text-overflow: ellipsis;
327
- transition: border $duration-fast-01 motion(standard, productive),
328
- outline $duration-fast-01 motion(standard, productive);
329
- white-space: nowrap;
330
-
331
- &:focus,
332
- &:active {
333
- @include focus-outline('outline');
334
-
335
- width: 100%;
336
- padding-left: 16px;
337
- margin: 0;
338
- }
339
-
340
- @include breakpoint(md) {
341
- width: rem(160px);
342
- padding: $spacing-04 $spacing-05 $spacing-03;
343
- border-bottom: $tab-underline-color;
344
- margin: 0;
345
- line-height: inherit;
346
-
347
- &:focus,
348
- &:active {
349
- width: rem(160px);
350
- border-bottom: 2px;
351
- }
352
- }
353
- }
354
-
355
- .#{$prefix}--tabs--container a.#{$prefix}--tabs__nav-link {
356
- @include breakpoint(md) {
357
- height: rem(48px);
358
- padding: $spacing-03 $spacing-05;
359
- border-bottom: none;
360
- // Height - vertical padding
361
- line-height: calc(#{rem(48px)} - (#{$spacing-03} * 2));
362
- }
363
- }
364
-
365
- //-----------------------------
366
- // Link Hover
367
- //-----------------------------
368
- .#{$prefix}--tabs__nav-item:hover:not(.#{$prefix}--tabs__nav-item--selected):not(.#{$prefix}--tabs__nav-item--disabled)
369
- .#{$prefix}--tabs__nav-link {
370
- color: $text-primary;
371
- @include breakpoint(md) {
372
- border-bottom: $tab-underline-color-hover;
373
- color: $text-primary;
374
- }
375
- }
376
-
377
- .#{$prefix}--tabs--container
378
- .#{$prefix}--tabs__nav-item:hover:not(.#{$prefix}--tabs__nav-item--selected):not(.#{$prefix}--tabs__nav-item--disabled)
379
- .#{$prefix}--tabs__nav-link {
380
- @include breakpoint(md) {
381
- border-bottom: none;
382
- }
383
- }
384
-
385
- //-----------------------------
386
- // Link Disabled
387
- //-----------------------------
388
- .#{$prefix}--tabs__nav-item--disabled .#{$prefix}--tabs__nav-link {
389
- border-bottom: $tab-underline-disabled;
390
- color: $tab-text-disabled;
391
- pointer-events: none;
392
- }
393
-
394
- .#{$prefix}--tabs__nav-item--disabled:hover .#{$prefix}--tabs__nav-link {
395
- border-bottom: $tab-underline-disabled;
396
- cursor: no-drop;
397
- }
398
-
399
- .#{$prefix}--tabs__nav-item--disabled .#{$prefix}--tabs__nav-link:focus,
400
- .#{$prefix}--tabs__nav-item--disabled a.#{$prefix}--tabs__nav-link:active {
401
- border-bottom: $tab-underline-disabled;
402
- outline: none;
403
- }
404
-
405
- //-----------------------------
406
- // Link Focus
407
- //-----------------------------
408
- .#{$prefix}--tabs__nav-item:not(.#{$prefix}--tabs__nav-item--selected):not(.#{$prefix}--tabs__nav-item--disabled):not(.#{$prefix}--tabs__nav-item--selected)
409
- .#{$prefix}--tabs__nav-link:focus,
410
- .#{$prefix}--tabs__nav-item:not(.#{$prefix}--tabs__nav-item--selected):not(.#{$prefix}--tabs__nav-item--disabled):not(.#{$prefix}--tabs__nav-item--selected)
411
- a.#{$prefix}--tabs__nav-link:active {
412
- color: $text-secondary;
413
- }
414
-
415
- //-----------------------------
416
- // Tab Content Container
417
- //-----------------------------
418
- .#{$prefix}--tab-content {
419
- padding: $spacing-05;
420
-
421
- &:focus {
422
- @include focus-outline('outline');
423
- }
424
- }
425
-
426
- //-----------------------------
427
- // Skeleton state
428
- //-----------------------------
429
- .#{$prefix}--tabs.#{$prefix}--skeleton {
430
- cursor: default;
431
- pointer-events: none;
432
- }
433
-
434
- .#{$prefix}--skeleton.#{$prefix}--tabs--scrollable:not(.#{$prefix}--tabs--scrollable--container)
435
- .#{$prefix}--tabs--scrollable__nav-item {
436
- border-bottom: 2px solid $skeleton-element;
437
- }
438
-
439
- .#{$prefix}--tabs.#{$prefix}--skeleton .#{$prefix}--tabs__nav-link {
440
- display: flex;
441
- width: 10rem;
442
- height: 100%;
443
- align-items: center;
444
- padding: 0 1rem;
445
- }
446
-
447
- .#{$prefix}--tabs.#{$prefix}--skeleton .#{$prefix}--tabs__nav-link span {
448
- @include skeleton;
449
-
450
- display: block;
451
- width: 100%;
452
- height: rem(14px);
453
- }
454
-
455
- .#{$prefix}--tabs.#{$prefix}--skeleton .#{$prefix}--tabs-trigger {
456
- @include skeleton;
457
-
458
- width: rem(100px);
459
- }
460
-
461
- .#{$prefix}--tabs.#{$prefix}--skeleton .#{$prefix}--tabs-trigger svg {
462
- @include visually-hidden;
463
- }
464
-
465
36
  // TODO: remove namespace and suffix in next major release
466
- .#{$prefix}--tabs--scrollable {
37
+ .#{$prefix}--tabs {
467
38
  @include reset;
468
39
  @include type-style('body-short-01');
469
40
 
@@ -473,11 +44,11 @@
473
44
  min-height: rem(40px);
474
45
  color: $text-primary;
475
46
 
476
- &.#{$prefix}--tabs--scrollable--container {
47
+ &.#{$prefix}--tabs--container {
477
48
  min-height: rem(48px);
478
49
  }
479
50
 
480
- .#{$prefix}--tabs--scrollable__nav {
51
+ .#{$prefix}--tabs__nav {
481
52
  display: flex;
482
53
  overflow: auto hidden;
483
54
  width: auto;
@@ -516,23 +87,19 @@
516
87
  background-image: linear-gradient(to right, transparent, $background);
517
88
  }
518
89
 
519
- .#{$prefix}--tabs--scrollable--light
520
- .#{$prefix}--tabs__overflow-indicator--left {
90
+ .#{$prefix}--tabs--light .#{$prefix}--tabs__overflow-indicator--left {
521
91
  background-image: linear-gradient(to left, transparent, $layer);
522
92
  }
523
93
 
524
- .#{$prefix}--tabs--scrollable--light
525
- .#{$prefix}--tabs__overflow-indicator--right {
94
+ .#{$prefix}--tabs--light .#{$prefix}--tabs__overflow-indicator--right {
526
95
  background-image: linear-gradient(to right, transparent, $layer);
527
96
  }
528
97
 
529
- &.#{$prefix}--tabs--scrollable--container
530
- .#{$prefix}--tabs__overflow-indicator--left {
98
+ &.#{$prefix}--tabs--container .#{$prefix}--tabs__overflow-indicator--left {
531
99
  background-image: linear-gradient(to left, transparent, $layer-accent);
532
100
  }
533
101
 
534
- &.#{$prefix}--tabs--scrollable--container
535
- .#{$prefix}--tabs__overflow-indicator--right {
102
+ &.#{$prefix}--tabs--container .#{$prefix}--tabs__overflow-indicator--right {
536
103
  background-image: linear-gradient(to right, transparent, $layer-accent);
537
104
  }
538
105
 
@@ -557,7 +124,7 @@
557
124
  );
558
125
  }
559
126
 
560
- &.#{$prefix}--tabs--scrollable--container
127
+ &.#{$prefix}--tabs--container
561
128
  .#{$prefix}--tabs__overflow-indicator--left {
562
129
  background-image: linear-gradient(
563
130
  to left,
@@ -566,7 +133,7 @@
566
133
  );
567
134
  }
568
135
 
569
- &.#{$prefix}--tabs--scrollable--container
136
+ &.#{$prefix}--tabs--container
570
137
  .#{$prefix}--tabs__overflow-indicator--right {
571
138
  background-image: linear-gradient(
572
139
  to right,
@@ -595,8 +162,7 @@
595
162
  display: none;
596
163
  }
597
164
 
598
- &.#{$prefix}--tabs--scrollable--container
599
- .#{$prefix}--tab--overflow-nav-button {
165
+ &.#{$prefix}--tabs--container .#{$prefix}--tab--overflow-nav-button {
600
166
  width: $spacing-09;
601
167
  margin: 0;
602
168
  background-color: $layer-accent;
@@ -609,7 +175,7 @@
609
175
  //-----------------------------
610
176
  // Item
611
177
  //-----------------------------
612
- .#{$prefix}--tabs--scrollable__nav-item {
178
+ .#{$prefix}--tabs__nav-item {
613
179
  @include reset;
614
180
 
615
181
  display: flex;
@@ -619,35 +185,32 @@
619
185
  motion(standard, productive);
620
186
  }
621
187
 
622
- .#{$prefix}--tabs--scrollable__nav-item
623
- + .#{$prefix}--tabs--scrollable__nav-item {
188
+ .#{$prefix}--tabs__nav-item + .#{$prefix}--tabs__nav-item {
624
189
  margin-left: rem(1px);
625
190
  }
626
191
 
627
- &.#{$prefix}--tabs--scrollable--container
628
- .#{$prefix}--tabs--scrollable__nav-item {
192
+ &.#{$prefix}--tabs--container .#{$prefix}--tabs__nav-item {
629
193
  background-color: $layer-accent;
630
194
  }
631
195
 
632
- &.#{$prefix}--tabs--scrollable--container
633
- .#{$prefix}--tabs--scrollable__nav-item
634
- + .#{$prefix}--tabs--scrollable__nav-item {
196
+ &.#{$prefix}--tabs--container
197
+ .#{$prefix}--tabs__nav-item
198
+ + .#{$prefix}--tabs__nav-item {
635
199
  margin-left: 0;
636
200
  // Draws the border without affecting the inner-content
637
201
  box-shadow: rem(-1px) 0 0 0 $border-strong;
638
202
  }
639
203
 
640
- &.#{$prefix}--tabs--scrollable--container
641
- .#{$prefix}--tabs--scrollable__nav-item
642
- + .#{$prefix}--tabs--scrollable__nav-item.#{$prefix}--tabs--scrollable__nav-item--selected,
643
- &.#{$prefix}--tabs--scrollable--container
644
- .#{$prefix}--tabs--scrollable__nav-item.#{$prefix}--tabs--scrollable__nav-item--selected
645
- + .#{$prefix}--tabs--scrollable__nav-item {
204
+ &.#{$prefix}--tabs--container
205
+ .#{$prefix}--tabs__nav-item
206
+ + .#{$prefix}--tabs__nav-item.#{$prefix}--tabs__nav-item--selected,
207
+ &.#{$prefix}--tabs--container
208
+ .#{$prefix}--tabs__nav-item.#{$prefix}--tabs__nav-item--selected
209
+ + .#{$prefix}--tabs__nav-item {
646
210
  box-shadow: none;
647
211
  }
648
212
 
649
- .#{$prefix}--tabs--scrollable__nav-item
650
- .#{$prefix}--tabs--scrollable__nav-link {
213
+ .#{$prefix}--tabs__nav-item .#{$prefix}--tabs__nav-link {
651
214
  transition: color $duration-fast-01 motion(standard, productive),
652
215
  border-bottom-color $duration-fast-01 motion(standard, productive),
653
216
  outline $duration-fast-01 motion(standard, productive);
@@ -656,79 +219,73 @@
656
219
  //-----------------------------
657
220
  // Item Hover
658
221
  //-----------------------------
659
- &.#{$prefix}--tabs--scrollable--container
660
- .#{$prefix}--tabs--scrollable__nav-item:hover {
222
+ &.#{$prefix}--tabs--container .#{$prefix}--tabs__nav-item:hover {
661
223
  background-color: $layer-selected-hover;
662
224
  }
663
225
 
664
226
  //---------------------------------------------
665
227
  // Item Disabled
666
228
  //---------------------------------------------
667
- .#{$prefix}--tabs--scrollable__nav-item--disabled,
668
- .#{$prefix}--tabs--scrollable__nav-item--disabled:hover {
229
+ .#{$prefix}--tabs__nav-item--disabled,
230
+ .#{$prefix}--tabs__nav-item--disabled:hover {
669
231
  background-color: transparent;
670
232
  cursor: not-allowed;
671
233
  outline: none;
672
234
  }
673
235
 
674
- &.#{$prefix}--tabs--scrollable--container
675
- .#{$prefix}--tabs--scrollable__nav-item.#{$prefix}--tabs--scrollable__nav-item--disabled,
676
- &.#{$prefix}--tabs--scrollable--container
677
- .#{$prefix}--tabs--scrollable__nav-item.#{$prefix}--tabs--scrollable__nav-item--disabled:hover {
236
+ &.#{$prefix}--tabs--container
237
+ .#{$prefix}--tabs__nav-item.#{$prefix}--tabs__nav-item--disabled,
238
+ &.#{$prefix}--tabs--container
239
+ .#{$prefix}--tabs__nav-item.#{$prefix}--tabs__nav-item--disabled:hover {
678
240
  background-color: button.$button-disabled;
679
241
  }
680
242
 
681
243
  //-----------------------------
682
244
  // Item Selected
683
245
  //-----------------------------
684
- .#{$prefix}--tabs--scrollable__nav-item--selected {
246
+ .#{$prefix}--tabs__nav-item--selected {
685
247
  transition: color $duration-fast-01 motion(standard, productive);
686
248
  }
687
249
 
688
- .#{$prefix}--tabs--scrollable__nav-item--selected
689
- .#{$prefix}--tabs--scrollable__nav-link,
690
- .#{$prefix}--tabs--scrollable__nav-item--selected
691
- .#{$prefix}--tabs--scrollable__nav-link:focus,
692
- .#{$prefix}--tabs--scrollable__nav-item--selected
693
- .#{$prefix}--tabs--scrollable__nav-link:active {
250
+ .#{$prefix}--tabs__nav-item--selected .#{$prefix}--tabs__nav-link,
251
+ .#{$prefix}--tabs__nav-item--selected .#{$prefix}--tabs__nav-link:focus,
252
+ .#{$prefix}--tabs__nav-item--selected .#{$prefix}--tabs__nav-link:active {
694
253
  @include type-style('productive-heading-01');
695
254
 
696
255
  border-bottom: 2px solid $border-interactive;
697
256
  color: $text-primary;
698
257
  }
699
258
 
700
- &.#{$prefix}--tabs--scrollable--container
701
- .#{$prefix}--tabs--scrollable__nav-item--selected,
702
- &.#{$prefix}--tabs--scrollable--container
703
- .#{$prefix}--tabs--scrollable__nav-item--selected:hover {
259
+ &.#{$prefix}--tabs--container .#{$prefix}--tabs__nav-item--selected,
260
+ &.#{$prefix}--tabs--container .#{$prefix}--tabs__nav-item--selected:hover {
704
261
  background-color: $layer;
705
262
 
706
- .#{$prefix}--tabs--scrollable__nav-link:focus,
707
- .#{$prefix}--tabs--scrollable__nav-link:active {
263
+ .#{$prefix}--tabs__nav-link:focus,
264
+ .#{$prefix}--tabs__nav-link:active {
708
265
  box-shadow: none;
709
266
  }
710
267
  }
711
268
 
712
- &.#{$prefix}--tabs--scrollable--container
713
- .#{$prefix}--tabs--scrollable__nav-item--selected
714
- .#{$prefix}--tabs--scrollable__nav-link {
269
+ &.#{$prefix}--tabs--container
270
+ .#{$prefix}--tabs__nav-item--selected
271
+ .#{$prefix}--tabs__nav-link {
715
272
  // Draws the border without affecting the inner-content
716
273
  box-shadow: inset 0 2px 0 0 $border-interactive;
717
274
  // height - vertical padding
718
275
  line-height: calc(#{rem(48px)} - (#{$spacing-03} * 2));
719
276
  }
720
277
 
721
- &.#{$prefix}--tabs--scrollable--light.#{$prefix}--tabs--scrollable--container
722
- .#{$prefix}--tabs--scrollable__nav-item--selected,
723
- &.#{$prefix}--tabs--scrollable--light.#{$prefix}--tabs--scrollable--container
724
- .#{$prefix}--tabs--scrollable__nav-item--selected:hover {
278
+ &.#{$prefix}--tabs--light.#{$prefix}--tabs--container
279
+ .#{$prefix}--tabs__nav-item--selected,
280
+ &.#{$prefix}--tabs--light.#{$prefix}--tabs--container
281
+ .#{$prefix}--tabs__nav-item--selected:hover {
725
282
  background-color: $background;
726
283
  }
727
284
 
728
285
  //-----------------------------
729
286
  // Link
730
287
  //-----------------------------
731
- .#{$prefix}--tabs--scrollable__nav-link {
288
+ .#{$prefix}--tabs__nav-link {
732
289
  @include button-reset.reset($width: false);
733
290
  @include focus-outline('reset');
734
291
  @include type-style('body-short-01');
@@ -754,8 +311,7 @@
754
311
  }
755
312
  }
756
313
 
757
- &.#{$prefix}--tabs--scrollable--container
758
- .#{$prefix}--tabs--scrollable__nav-link {
314
+ &.#{$prefix}--tabs--container .#{$prefix}--tabs__nav-link {
759
315
  height: rem(48px);
760
316
  padding: $spacing-03 $spacing-05;
761
317
  border-bottom: 0;
@@ -766,116 +322,117 @@
766
322
  //-----------------------------
767
323
  // Link Hover
768
324
  //-----------------------------
769
- .#{$prefix}--tabs--scrollable__nav-item:hover
770
- .#{$prefix}--tabs--scrollable__nav-link {
325
+ .#{$prefix}--tabs__nav-item:hover .#{$prefix}--tabs__nav-link {
771
326
  border-bottom: $tab-underline-color-hover;
772
327
  color: $text-primary;
773
328
  }
774
329
 
775
- &.#{$prefix}--tabs--scrollable--container
776
- .#{$prefix}--tabs--scrollable__nav-item
777
- .#{$prefix}--tabs--scrollable__nav-link {
330
+ &.#{$prefix}--tabs--container
331
+ .#{$prefix}--tabs__nav-item
332
+ .#{$prefix}--tabs__nav-link {
778
333
  border-bottom: none;
779
334
  }
780
335
 
781
336
  //-----------------------------
782
337
  // Link Disabled
783
338
  //-----------------------------
784
- .#{$prefix}--tabs--scrollable__nav-item--disabled
785
- .#{$prefix}--tabs--scrollable__nav-link {
339
+ .#{$prefix}--tabs__nav-item--disabled .#{$prefix}--tabs__nav-link {
786
340
  border-bottom: $tab-underline-disabled;
787
341
  color: $tab-text-disabled;
788
342
  }
789
343
 
790
- .#{$prefix}--tabs--scrollable__nav-item--disabled:hover
791
- .#{$prefix}--tabs--scrollable__nav-link {
344
+ .#{$prefix}--tabs__nav-item--disabled:hover .#{$prefix}--tabs__nav-link {
792
345
  border-bottom: $tab-underline-disabled;
793
346
  color: $tab-text-disabled;
794
347
  cursor: not-allowed;
795
348
  pointer-events: none;
796
349
  }
797
350
 
798
- .#{$prefix}--tabs--scrollable__nav-item--disabled
799
- .#{$prefix}--tabs--scrollable__nav-link:focus,
800
- .#{$prefix}--tabs--scrollable__nav-item--disabled
801
- .#{$prefix}--tabs--scrollable__nav-link:active {
351
+ .#{$prefix}--tabs__nav-item--disabled .#{$prefix}--tabs__nav-link:focus,
352
+ .#{$prefix}--tabs__nav-item--disabled .#{$prefix}--tabs__nav-link:active {
802
353
  border-bottom: $tab-underline-disabled;
803
354
  outline: none;
804
355
  }
805
356
 
806
- .#{$prefix}--tabs--scrollable--light
807
- .#{$prefix}--tabs--scrollable__nav-item--disabled
808
- .#{$prefix}--tabs--scrollable__nav-link {
357
+ .#{$prefix}--tabs--light
358
+ .#{$prefix}--tabs__nav-item--disabled
359
+ .#{$prefix}--tabs__nav-link {
809
360
  border-bottom-color: $border-subtle;
810
361
  }
811
362
 
812
- .#{$prefix}--tabs--scrollable--light
813
- .#{$prefix}--tabs--scrollable__nav-item--disabled:hover
814
- .#{$prefix}--tabs--scrollable__nav-link {
363
+ .#{$prefix}--tabs--light
364
+ .#{$prefix}--tabs__nav-item--disabled:hover
365
+ .#{$prefix}--tabs__nav-link {
815
366
  border-bottom-color: $border-subtle;
816
367
  }
817
368
 
818
- .#{$prefix}--tabs--scrollable--light
819
- .#{$prefix}--tabs--scrollable__nav-item--disabled
820
- .#{$prefix}--tabs--scrollable__nav-link:focus,
821
- .#{$prefix}--tabs--scrollable--light
822
- .#{$prefix}--tabs--scrollable__nav-item--disabled
823
- .#{$prefix}--tabs--scrollable__nav-link:active {
369
+ .#{$prefix}--tabs--light
370
+ .#{$prefix}--tabs__nav-item--disabled
371
+ .#{$prefix}--tabs__nav-link:focus,
372
+ .#{$prefix}--tabs--light
373
+ .#{$prefix}--tabs__nav-item--disabled
374
+ .#{$prefix}--tabs__nav-link:active {
824
375
  border-bottom-color: $border-subtle;
825
376
  }
826
377
 
827
- &.#{$prefix}--tabs--scrollable--container
828
- .#{$prefix}--tabs--scrollable__nav-item--disabled
829
- .#{$prefix}--tabs--scrollable__nav-link {
378
+ &.#{$prefix}--tabs--container
379
+ .#{$prefix}--tabs__nav-item--disabled
380
+ .#{$prefix}--tabs__nav-link {
830
381
  border-bottom: none;
831
382
  color: $text-on-color-disabled;
832
383
  }
384
+ }
385
+ //-----------------------------
386
+ // Tab Content Container
387
+ //-----------------------------
388
+ .#{$prefix}--tab-content {
389
+ padding: $spacing-05;
833
390
 
834
- //-----------------------------
835
- // Tab Content Container
836
- //-----------------------------
837
- .#{$prefix}--tab-content {
838
- padding: $spacing-05;
839
- }
840
-
841
- //-----------------------------
842
- // Skeleton state
843
- //-----------------------------
844
- .#{$prefix}--tabs.#{$prefix}--skeleton {
845
- cursor: default;
846
- pointer-events: none;
391
+ &:focus {
392
+ @include focus-outline('outline');
847
393
  }
394
+ }
848
395
 
849
- .#{$prefix}--tabs.#{$prefix}--skeleton
850
- .#{$prefix}--tabs--scrollable__nav-link {
851
- @include skeleton;
396
+ //-----------------------------
397
+ // Skeleton state
398
+ //-----------------------------
399
+ .#{$prefix}--tabs.#{$prefix}--skeleton {
400
+ cursor: default;
401
+ pointer-events: none;
402
+ }
852
403
 
853
- width: rem(75px);
854
- }
404
+ .#{$prefix}--skeleton.#{$prefix}--tabs:not(.#{$prefix}--tabs--container)
405
+ .#{$prefix}--tabs__nav-link {
406
+ border-bottom: 2px solid $skeleton-element;
407
+ }
855
408
 
856
- .#{$prefix}--tabs.#{$prefix}--skeleton .#{$prefix}--tabs-trigger {
857
- @include skeleton;
409
+ .#{$prefix}--tabs.#{$prefix}--skeleton .#{$prefix}--tabs__nav-link {
410
+ display: flex;
411
+ width: 10rem;
412
+ height: 100%;
413
+ align-items: center;
414
+ padding: 0 1rem;
415
+ }
858
416
 
859
- width: rem(75px);
860
- margin-right: rem(1px);
861
- }
417
+ .#{$prefix}--tabs.#{$prefix}--skeleton .#{$prefix}--tabs__nav-link span {
418
+ @include skeleton;
862
419
 
863
- .#{$prefix}--tabs.#{$prefix}--skeleton .#{$prefix}--tabs-trigger svg {
864
- @include visually-hidden;
865
- }
420
+ display: block;
421
+ width: 100%;
422
+ height: rem(14px);
866
423
  }
867
424
 
868
425
  // Windows HCM fix
869
- .#{$prefix}--tabs--scrollable__nav-item
426
+ .#{$prefix}--tabs__nav-item
870
427
  .#{$prefix}--tabs__nav-item--selected
871
- .#{$prefix}--tabs--scrollable__nav-item--selected {
428
+ .#{$prefix}--tabs__nav-item--selected {
872
429
  @include high-contrast-mode('focus');
873
430
  }
874
431
 
875
432
  // stylelint-disable-next-line no-duplicate-selectors
876
- .#{$prefix}--tabs--scrollable
877
- .#{$prefix}--tabs--scrollable__nav-item--disabled
878
- .#{$prefix}--tabs--scrollable__nav-link {
433
+ .#{$prefix}--tabs
434
+ .#{$prefix}--tabs__nav-item--disabled
435
+ .#{$prefix}--tabs__nav-link {
879
436
  @include high-contrast-mode('disabled');
880
437
  }
881
438
  }
@@ -9,3 +9,4 @@
9
9
  @use 'tooltip';
10
10
 
11
11
  @include tooltip.tooltip;
12
+ @include tooltip.icon-tooltip;
@@ -12,6 +12,16 @@
12
12
  @use '../../utilities/custom-property';
13
13
  @use '../../utilities/convert';
14
14
 
15
+ $tooltip-padding-block: custom-property.get-var(
16
+ 'tooltip-padding-block',
17
+ spacing.$spacing-05
18
+ );
19
+
20
+ $tooltip-padding-inline: custom-property.get-var(
21
+ 'tooltip-padding-inline',
22
+ spacing.$spacing-05
23
+ );
24
+
15
25
  @mixin tooltip {
16
26
  .#{$prefix}--tooltip {
17
27
  @include custom-property.declaration('popover-offset', 12px);
@@ -21,7 +31,7 @@
21
31
  @include type.type-style('body-long-01');
22
32
 
23
33
  max-width: convert.rem(288px);
24
- padding: spacing.$spacing-05;
34
+ padding: $tooltip-padding-block $tooltip-padding-inline;
25
35
 
26
36
  color: theme.$text-inverse;
27
37
  }
@@ -29,6 +39,22 @@
29
39
 
30
40
  @mixin icon-tooltip {
31
41
  .#{$prefix}--icon-tooltip {
32
- padding: 3px spacing.$spacing-05;
42
+ @include custom-property.declaration(
43
+ 'tooltip-padding-block',
44
+ convert.rem(2px)
45
+ );
46
+ @include custom-property.declaration(
47
+ 'popover-caret-width',
48
+ convert.rem(8px)
49
+ );
50
+ @include custom-property.declaration(
51
+ 'popover-caret-height',
52
+ convert.rem(4px)
53
+ );
54
+ @include custom-property.declaration('popover-offset', convert.rem(8px));
55
+ }
56
+
57
+ .#{$prefix}--icon-tooltip .#{$prefix}--tooltip-content {
58
+ @include type.type-style('body-short-01');
33
59
  }
34
60
  }