@itwin/itwinui-css 0.46.0 → 0.48.1

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.
@@ -55,7 +55,8 @@
55
55
  border-left:none;
56
56
  border-right:none;
57
57
  overflow:hidden;
58
- justify-content:flex-start; }
58
+ justify-content:flex-start;
59
+ --_iui-button-active-stripe-inset:0 calc(100% - 2px) 0 0; }
59
60
  .iui-side-navigation .iui-sidenav-button:not(.iui-expand){
60
61
  height:55px; }
61
62
  @supports (padding: max(0px)){
@@ -75,9 +76,6 @@
75
76
  .iui-side-navigation .iui-sidenav-button.iui-submenu-open .iui-button-icon{
76
77
  fill:#008BE1;
77
78
  fill:var(--iui-color-foreground-primary); }
78
- .iui-side-navigation .iui-sidenav-button.iui-active{
79
- box-shadow:inset 2px 0 0 0 #008BE1;
80
- box-shadow:inset 2px 0 0 0 var(--iui-icons-color-primary); }
81
79
  .iui-side-navigation .iui-sidenav-button[disabled], .iui-side-navigation .iui-sidenav-button:disabled{
82
80
  background-color:#F8F9FB;
83
81
  background-color:var(--iui-color-background-2); }
@@ -0,0 +1,51 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ .iui-skip-to-content-link{
6
+ background-color:rgba(0, 0, 0, 0.8);
7
+ background-color:rgba(0, 0, 0, var(--iui-opacity-2));
8
+ color:#FFF;
9
+ color:var(--iui-color-foreground-accessory);
10
+ border-radius:9999px;
11
+ text-decoration:none;
12
+ -webkit-user-select:none;
13
+ -moz-user-select:none;
14
+ -ms-user-select:none;
15
+ user-select:none;
16
+ padding:8.25px 16px;
17
+ position:fixed;
18
+ text-align:center;
19
+ left:50%;
20
+ top:22px;
21
+ transform:translateX(-50%) translateY(-170%);
22
+ transition:background-color 0.2s ease-in-out; }
23
+ @supports ((-webkit-backdrop-filter: blur(5px)) or (backdrop-filter: blur(5px))){
24
+ .iui-skip-to-content-link{
25
+ background-color:rgba(0, 0, 0, var(--iui-opacity-3));
26
+ -webkit-backdrop-filter:blur(5px);
27
+ backdrop-filter:blur(5px); } }
28
+ .iui-skip-to-content-link:focus-visible{
29
+ outline:2px solid var(--iui-color-foreground-primary);
30
+ outline-offset:2px; }
31
+ @supports not selector(*:focus-visible){
32
+ .iui-skip-to-content-link:focus{
33
+ outline:2px solid var(--iui-color-foreground-primary);
34
+ outline-offset:2px; } }
35
+ @media (prefers-reduced-motion: no-preference){
36
+ .iui-skip-to-content-link{
37
+ transition:background-color 0.2s ease-in-out, transform 0.8s ease-in-out, box-shadow 0.2s ease-in-out; } }
38
+ .iui-skip-to-content-link:hover{
39
+ background-color:black;
40
+ background-color:rgba(0, 0, 0, var(--iui-opacity-1)); }
41
+ @supports ((-webkit-backdrop-filter: blur(5px)) or (backdrop-filter: blur(5px))){
42
+ .iui-skip-to-content-link:hover{
43
+ background-color:rgba(0, 0, 0, var(--iui-opacity-2));
44
+ -webkit-backdrop-filter:blur(5px);
45
+ backdrop-filter:blur(5px); } }
46
+ .iui-skip-to-content-link:focus{
47
+ transform:translateX(-50%) translateY(0);
48
+ box-shadow:0 6px 30px rgba(0, 0, 0, 0.25); }
49
+ @media (prefers-reduced-motion: no-preference){
50
+ .iui-skip-to-content-link:focus{
51
+ transition:transform 0.2s ease-in-out; } }
package/css/table.css CHANGED
@@ -398,56 +398,10 @@
398
398
  .iui-paginator-pages-group{
399
399
  display:inline-flex;
400
400
  align-items:center;
401
- isolation:isolate;
402
401
  margin:0 8px; }
403
- .iui-paginator-pages-group > *{
404
- display:flex; }
405
- .iui-paginator-pages-group > * input, .iui-paginator-pages-group > * button{
406
- position:relative;
407
- transition-duration:0ms; }
408
- .iui-paginator-pages-group > * input:hover, .iui-paginator-pages-group > * button:hover{
409
- z-index:1; }
410
- .iui-paginator-pages-group > * input:focus, .iui-paginator-pages-group > * button:focus{
411
- z-index:2; }
412
- .iui-paginator-pages-group > * input:focus:where(:not(:focus-visible):not(:hover)), .iui-paginator-pages-group > * button:focus:where(:not(:focus-visible):not(:hover)){
413
- z-index:revert; }
414
- .iui-paginator-pages-group > * input:disabled, .iui-paginator-pages-group > * button:disabled{
415
- z-index:-1; }
416
- .iui-paginator-pages-group > * input:hover, .iui-paginator-pages-group > * input:focus, .iui-paginator-pages-group > * button:hover, .iui-paginator-pages-group > * button:focus{
417
- transition-duration:0.2s; }
418
- .iui-paginator-pages-group > * input.iui-active::after, .iui-paginator-pages-group > * button.iui-active::after{
419
- content:'';
420
- position:absolute;
421
- height:2px;
422
- opacity:1;
423
- top:2px;
424
- left:2px;
425
- width:calc(100% - 4px);
426
- background-color:#008BE1;
427
- background-color:var(--iui-color-foreground-primary); }
428
- .iui-paginator-pages-group > * input.iui-active:disabled::after, .iui-paginator-pages-group > * button.iui-active:disabled::after{
429
- background-color:rgba(0, 0, 0, 0.2);
430
- background-color:rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-5)); }
431
- .iui-paginator-pages-group > * input:not(.iui-borderless), .iui-paginator-pages-group > * button:not(.iui-borderless){
432
- border-radius:0; }
433
- .iui-paginator-pages-group > *:first-child input, .iui-paginator-pages-group > *:first-child button:not(.iui-borderless){
434
- border-top-left-radius:3px;
435
- border-bottom-left-radius:3px; }
436
- .iui-paginator-pages-group > *:last-child input, .iui-paginator-pages-group > *:last-child button:not(.iui-borderless){
437
- border-top-right-radius:3px;
438
- border-bottom-right-radius:3px; }
439
- .iui-paginator-pages-group > * + *{
440
- margin-left:-1px; }
441
- .iui-paginator-pages-group > *:not(:first-child) .iui-default:disabled{
442
- border-left-color:#DCE0E3;
443
- border-left-color:var(--iui-color-background-4); }
444
- .iui-paginator-pages-group > * + *{
445
- margin-left:0; }
446
- .iui-paginator-pages-group button.iui-active::after{
447
- top:auto;
448
- bottom:2px; }
449
402
 
450
403
  .iui-paginator-page-button{
404
+ --_iui-button-active-stripe-inset:initial;
451
405
  margin:0;
452
406
  padding:0;
453
407
  border:none;
@@ -479,7 +433,8 @@
479
433
  padding:0 8px;
480
434
  height:38px;
481
435
  gap:8px;
482
- width:38px; }
436
+ width:38px;
437
+ --_iui-button-active-stripe-inset:calc(100% - 4px) 2px 2px; }
483
438
  @media (prefers-reduced-motion: no-preference){
484
439
  .iui-paginator-page-button{
485
440
  transition:color 0.2s ease-out, background-color 0.2s ease-out, border-color 0.2s ease-out; } }
@@ -502,6 +457,13 @@
502
457
  background:var(--iui-color-background-disabled);
503
458
  border-color:var(--iui-color-background-disabled);
504
459
  color:rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-5)); }
460
+ .iui-paginator-page-button.iui-active::after{
461
+ content:'';
462
+ position:absolute;
463
+ inset:var(--_iui-button-active-stripe-inset);
464
+ background-color:var(--iui-color-foreground-primary); }
465
+ .iui-paginator-page-button.iui-active[disabled]::after, .iui-paginator-page-button.iui-active:disabled::after{
466
+ background-color:rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-5)); }
505
467
  .iui-paginator-page-button > .iui-button-icon:only-child{
506
468
  margin-left:3px;
507
469
  margin-right:3px; }
package/css/tile.css CHANGED
@@ -17,10 +17,26 @@
17
17
  color:rgba(0, 0, 0, 0.8);
18
18
  background-color:var(--iui-color-background-1);
19
19
  color:var(--iui-text-color); }
20
+ .iui-tile:focus-visible{
21
+ outline:2px solid var(--iui-color-foreground-primary);
22
+ outline-offset:2px; }
23
+ @supports not selector(*:focus-visible){
24
+ .iui-tile:focus{
25
+ outline:2px solid var(--iui-color-foreground-primary);
26
+ outline-offset:2px; } }
27
+ .iui-tile:hover .iui-tile-more-options, .iui-tile:focus-within .iui-tile-more-options{
28
+ -webkit-clip-path:revert;
29
+ clip-path:revert;
30
+ overflow:visible;
31
+ position:static;
32
+ white-space:normal;
33
+ height:auto;
34
+ width:auto;
35
+ padding:0;
36
+ margin:0;
37
+ position:absolute; }
20
38
  .iui-tile:hover .iui-tile-metadata:not(:last-child), .iui-tile:focus-within .iui-tile-metadata:not(:last-child){
21
39
  width:calc(100% - 32px); }
22
- .iui-tile:hover .iui-tile-more-options, .iui-tile:focus-within .iui-tile-more-options{
23
- visibility:visible; }
24
40
  .iui-tile:hover .iui-tile-thumbnail-picture, .iui-tile:focus-within .iui-tile-thumbnail-picture{
25
41
  transform:translateZ(0) scale(1.1); }
26
42
  .iui-tile.iui-new .iui-tile-name,
@@ -31,6 +47,13 @@
31
47
  background:linear-gradient(rgba(0, 139, 225, 0.1), rgba(0, 139, 225, 0.1)), linear-gradient(#FFF, #FFF);
32
48
  outline:solid 2px var(--iui-color-foreground-primary);
33
49
  background:linear-gradient(rgba(var(--iui-color-foreground-primary-rgb), var(--iui-opacity-6)), rgba(var(--iui-color-foreground-primary-rgb), var(--iui-opacity-6))), linear-gradient(var(--iui-color-background-1), var(--iui-color-background-1)); }
50
+ .iui-tile.iui-selected:focus-visible{
51
+ outline:4px solid var(--iui-color-foreground-primary);
52
+ outline-offset:0; }
53
+ @supports not selector(*:focus-visible){
54
+ .iui-tile.iui-selected:focus{
55
+ outline:4px solid var(--iui-color-foreground-primary);
56
+ outline-offset:0; } }
34
57
  .iui-tile.iui-selected .iui-tile-thumbnail-picture{
35
58
  transform:translateZ(0) scale(1.1); }
36
59
  .iui-tile.iui-folder{
@@ -242,11 +265,9 @@
242
265
  @supports ((-webkit-backdrop-filter: blur(5px)) or (backdrop-filter: blur(5px))){
243
266
  .iui-tile-thumbnail-picture ~ .iui-tile-thumbnail-type-indicator,
244
267
  .iui-tile-thumbnail-picture ~ .iui-tile-thumbnail-quick-action{
245
- background-color:rgba(0, 0, 0, 0.2);
246
- -webkit-backdrop-filter:blur(5px);
247
- backdrop-filter:blur(5px);
248
268
  background-color:rgba(0, 0, 0, var(--iui-opacity-5));
249
- backdrop-filter:blur(5px); } }
269
+ -webkit-backdrop-filter:blur(5px);
270
+ backdrop-filter:blur(5px); } }
250
271
  .iui-tile-thumbnail-picture ~ .iui-tile-thumbnail-type-indicator > .iui-button-icon,
251
272
  .iui-tile-thumbnail-picture ~ .iui-tile-thumbnail-quick-action > .iui-button-icon{
252
273
  fill:#FFF;
@@ -367,13 +388,19 @@
367
388
  white-space:nowrap;
368
389
  overflow:hidden;
369
390
  text-overflow:ellipsis; }
370
- .iui-tile-content .iui-tile-more-options{
371
- padding:0 2px;
372
- height:27px;
373
- gap:4px;
391
+
392
+ .iui-tile-more-options{
393
+ position:absolute;
394
+ bottom:5.5px;
395
+ right:8px; }
396
+ .iui-tile-more-options:not(.iui-visible){
397
+ -webkit-clip-path:inset(50%);
398
+ clip-path:inset(50%);
399
+ overflow:hidden;
374
400
  position:absolute;
375
- bottom:5.5px;
376
- right:8px;
377
- visibility:hidden; }
378
- .iui-tile-content .iui-tile-more-options.iui-visible{
379
- visibility:visible; }
401
+ white-space:nowrap;
402
+ height:1px;
403
+ width:1px;
404
+ padding:0;
405
+ margin:-1px;
406
+ border-width:0; }
package/css/tree.css CHANGED
@@ -16,10 +16,30 @@
16
16
  vertical-align:baseline;
17
17
  list-style:none; }
18
18
 
19
+ .iui-tree-item:focus-visible{
20
+ outline:none; }
21
+ .iui-tree-item:focus-visible > .iui-tree-node{
22
+ outline:1px solid var(--iui-color-foreground-primary);
23
+ outline-offset:-1px; }
24
+ .iui-tree-item:focus-visible > .iui-tree-node.iui-active{
25
+ outline:2px solid var(--iui-color-foreground-primary);
26
+ outline-offset:-2px; }
27
+
28
+ @supports not selector(*:focus-visible){
29
+ .iui-tree-item:focus{
30
+ outline:none; }
31
+ .iui-tree-item:focus > .iui-tree-node{
32
+ outline:1px solid var(--iui-color-foreground-primary);
33
+ outline-offset:-1px; }
34
+ .iui-tree-item:focus > .iui-tree-node.iui-active{
35
+ outline:2px solid var(--iui-color-foreground-primary);
36
+ outline-offset:-2px; } }
37
+
19
38
  .iui-tree-node{
20
39
  display:flex;
21
40
  cursor:pointer;
22
- padding:0 8px; }
41
+ padding:0 8px;
42
+ align-items:center; }
23
43
  .iui-tree-node-checkbox{
24
44
  margin-right:8px; }
25
45
  .iui-tree-node-content{
@@ -72,13 +92,6 @@
72
92
  font-size:12px;
73
93
  color:rgba(0, 0, 0, 0.4);
74
94
  color:var(--iui-text-color-muted); }
75
- .iui-tree-node:focus-visible{
76
- outline:1px solid var(--iui-color-foreground-primary);
77
- outline-offset:-1px; }
78
- @supports not selector(*:focus-visible){
79
- .iui-tree-node:focus{
80
- outline:1px solid var(--iui-color-foreground-primary);
81
- outline-offset:-1px; } }
82
95
  .iui-tree-node:hover{
83
96
  background-color:rgba(0, 139, 225, 0.1);
84
97
  background-color:rgba(var(--iui-color-foreground-primary-rgb), var(--iui-opacity-6)); }
@@ -93,13 +106,6 @@
93
106
  background-color:rgba(var(--iui-color-foreground-primary-rgb), var(--iui-opacity-5));
94
107
  outline:thin solid var(--iui-color-foreground-primary);
95
108
  outline-offset:-1px; }
96
- .iui-tree-node.iui-active:focus-visible{
97
- outline:2px solid var(--iui-color-foreground-primary);
98
- outline-offset:-2px; }
99
- @supports not selector(*:focus-visible){
100
- .iui-tree-node.iui-active:focus{
101
- outline:2px solid var(--iui-color-foreground-primary);
102
- outline-offset:-2px; } }
103
109
  .iui-tree-node.iui-disabled{
104
110
  cursor:not-allowed;
105
111
  outline:none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/itwinui-css",
3
- "version": "0.46.0",
3
+ "version": "0.48.1",
4
4
  "author": "Bentley Systems",
5
5
  "license": "MIT",
6
6
  "main": "src/index.scss",
@@ -68,7 +68,7 @@
68
68
  "html-minifier": "^4.0.0",
69
69
  "husky": "=4",
70
70
  "lint-staged": "^11.2.6",
71
- "node-sass": "^5.0.0",
71
+ "node-sass": "^7.0.0",
72
72
  "postcss": "^8.4.5",
73
73
  "postcss-cli": "^8.3.1",
74
74
  "postcss-discard-comments": "^5.0.1",
@@ -11,14 +11,17 @@ $iui-badge-background-primary: $iui-color-foreground-primary--dark;
11
11
  $iui-badge-text-color: rgba($iui-color-foreground-body--light, $iui-opacity-3--light);
12
12
 
13
13
  @mixin iui-badge {
14
+ --iui-badge-background-color: #{$iui-badge-background-default};
15
+ --_iui-badge-text-color: #{$iui-badge-text-color};
16
+
14
17
  @include iui-reset;
15
18
  display: inline-block;
16
19
  font-size: $iui-font-size-small;
17
20
  padding: 0 $iui-xs * 1.5;
18
21
  margin: round($iui-baseline * 0.5) 0;
19
22
  border-radius: $iui-border-radius;
20
- background-color: var(--badge-color, $iui-badge-background-default);
21
- color: var(--badge-text-color, $iui-badge-text-color);
23
+ background-color: var(--iui-badge-background-color);
24
+ color: var(--_iui-badge-text-color);
22
25
  text-transform: uppercase;
23
26
  user-select: none;
24
27
  max-width: 20ch;
@@ -7,29 +7,36 @@
7
7
  align-items: center;
8
8
  isolation: isolate;
9
9
 
10
- $childSelector: 'input, button'; // target nested inputs and buttons
10
+ $childZindexSelector: '.iui-input-container, .iui-button, .iui-input:where(:not(.iui-input-container .iui-input))';
11
+ $childBorderSelector: '.iui-input, .iui-button:where(:not(.iui-borderless))';
12
+ $disabledSelector: '&:disabled, &.iui-disabled, &[aria-disabled="true"]';
11
13
 
12
14
  > * {
13
15
  display: flex;
14
16
 
15
- #{$childSelector} {
17
+ #{$childZindexSelector} {
16
18
  position: relative;
17
19
 
20
+ // Adds stripe above active button
21
+ --_iui-button-active-stripe-inset: #{$iui-xxs} #{$iui-xxs} calc(100% - #{$iui-xs});
22
+
18
23
  &:hover {
19
24
  z-index: 1;
20
25
  }
21
26
 
22
- &:focus {
27
+ &:focus,
28
+ &:focus-within {
23
29
  z-index: 2;
24
-
25
- &:where(:not(:focus-visible):not(:hover)) {
26
- z-index: revert;
27
- }
28
30
  }
29
31
 
30
- &:disabled {
32
+ #{$disabledSelector} {
31
33
  z-index: -1;
32
34
  }
35
+ }
36
+
37
+ #{$childBorderSelector} {
38
+ // Reset border radius
39
+ border-radius: 0;
33
40
 
34
41
  transition-duration: 0ms; // disable exit animation to avoid border flicker
35
42
 
@@ -37,47 +44,18 @@
37
44
  &:focus {
38
45
  transition-duration: $iui-speed-fast; // re-enable enter animation
39
46
  }
40
-
41
- // Adds stripe above active button
42
- &.iui-active {
43
- &::after {
44
- content: '';
45
- position: absolute;
46
- height: $iui-xxs;
47
- opacity: 1;
48
- top: $iui-xxs;
49
- left: $iui-xxs;
50
- width: calc(100% - #{$iui-xs});
51
- @include themed {
52
- background-color: t(iui-color-foreground-primary);
53
- }
54
- }
55
-
56
- &:disabled {
57
- &::after {
58
- @include themed {
59
- background-color: rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-5));
60
- }
61
- }
62
- }
63
- }
64
-
65
- // Reset border radius only for non-borderless items
66
- &:not(.iui-borderless) {
67
- border-radius: 0;
68
- }
69
47
  }
70
48
 
71
49
  // Add rounded corners to first and last items
72
50
  &:first-child {
73
- #{$childSelector}:not(.iui-borderless) {
51
+ #{$childBorderSelector} {
74
52
  border-top-left-radius: $iui-border-radius;
75
53
  border-bottom-left-radius: $iui-border-radius;
76
54
  }
77
55
  }
78
56
 
79
57
  &:last-child {
80
- #{$childSelector}:not(.iui-borderless) {
58
+ #{$childBorderSelector} {
81
59
  border-top-right-radius: $iui-border-radius;
82
60
  border-bottom-right-radius: $iui-border-radius;
83
61
  }
@@ -89,8 +67,8 @@
89
67
  }
90
68
 
91
69
  // Add slight border between disabled items
92
- &:not(:first-child) {
93
- .iui-default:disabled {
70
+ &:not(:first-child) :where(.iui-button.iui-default) {
71
+ #{$disabledSelector} {
94
72
  @include themed {
95
73
  border-left-color: t(iui-color-background-4);
96
74
  }
@@ -10,6 +10,8 @@ $iui-button-padding-small: $iui-xs * 2;
10
10
  $iui-button-padding-large: $iui-xs * 6;
11
11
 
12
12
  @mixin iui-button {
13
+ --_iui-button-active-stripe-inset: initial;
14
+
13
15
  @include iui-reset;
14
16
  font-family: inherit;
15
17
  display: inline-flex;
@@ -50,6 +52,23 @@ $iui-button-padding-large: $iui-xs * 6;
50
52
  &:disabled {
51
53
  @include iui-button-disabled;
52
54
  }
55
+
56
+ &.iui-active {
57
+ // Shows active stripe only if --_iui-button-active-stripe-inset is set (from outside)
58
+ &::after {
59
+ content: '';
60
+ position: absolute;
61
+ inset: var(--_iui-button-active-stripe-inset);
62
+ background-color: var(--iui-color-foreground-primary);
63
+ }
64
+
65
+ &[disabled],
66
+ &:disabled {
67
+ &::after {
68
+ background-color: rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-5));
69
+ }
70
+ }
71
+ }
53
72
  }
54
73
 
55
74
  /// Mixin for applying padding and margins to various button sizes.
@@ -50,7 +50,6 @@
50
50
  }
51
51
 
52
52
  .iui-button-split-menu {
53
- @include iui-button-group;
54
53
  @include iui-button-split-menu;
55
54
  }
56
55
 
@@ -43,6 +43,7 @@
43
43
  color: t(iui-color-foreground-primary);
44
44
  }
45
45
 
46
+ // Used for combining overlay background color with base background
46
47
  &::before {
47
48
  content: '';
48
49
  position: absolute;
package/scss/classes.scss CHANGED
@@ -41,3 +41,4 @@
41
41
  @import './tree/classes';
42
42
  @import './user-icon/classes';
43
43
  @import './wizard/classes';
44
+ @import './skip-to-content/classes';
@@ -7,11 +7,13 @@
7
7
  $iui-color-picker-content-width: ($iui-l * 9) + ($iui-s * 8); // (9 swatches per row) + (gaps)
8
8
  $iui-color-picker-max-width: ($iui-l * 10) + ($iui-s * 9); // (10 swatches per row) + (gaps)
9
9
  $iui-color-swatch-border-radius: 5px;
10
- $iui-inset-box-shadow: inset 0 0 0 1px rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-5));
11
- $iui-active-box-shadow: 0 0 0 $iui-xxs rgba(t(iui-color-foreground-primary-rgb), t(iui-opacity-3));
12
- $iui-hover-box-shadow: 0 0 1px $iui-xxs + 1 rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-5));
10
+ $iui-inset-box-shadow: inset 0 0 0 1px rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-5));
11
+ $iui-active-box-shadow: 0 0 0 $iui-xxs rgba(var(--iui-color-foreground-primary-rgb), var(--iui-opacity-3));
12
+ $iui-hover-box-shadow: 0 0 1px $iui-xxs + 1 rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-5));
13
13
 
14
14
  @mixin iui-color-picker {
15
+ --iui-color-picker-selected-color: initial;
16
+
15
17
  @include iui-dropdown;
16
18
  box-sizing: border-box;
17
19
  border-radius: $iui-border-radius;
@@ -37,40 +39,43 @@ $iui-hover-box-shadow: 0 0 1px $iui-xxs + 1 rgba(t(iui-color-foreground-body-rgb
37
39
  }
38
40
 
39
41
  @mixin iui-color-swatch {
42
+ --iui-color-swatch-background: initial;
43
+
40
44
  height: $iui-l;
41
45
  width: $iui-l;
42
46
  cursor: pointer;
43
47
  border-radius: $iui-color-swatch-border-radius;
44
- background-color: var(--swatch-color);
45
48
  margin-bottom: $iui-xs;
46
49
  margin-right: $iui-xs;
47
-
50
+ position: relative;
51
+ background-color: var(--iui-color-swatch-background);
52
+ @include iui-transparent-background;
48
53
  @supports (gap: $iui-s) {
49
54
  margin-bottom: 0;
50
55
  margin-right: 0;
51
56
  }
52
57
 
53
- @include themed {
58
+ &::after {
59
+ content: '';
60
+ position: absolute;
61
+ width: inherit;
62
+ height: inherit;
63
+ border-radius: inherit;
64
+ background-color: inherit;
54
65
  box-shadow: $iui-inset-box-shadow;
55
66
  }
56
67
 
57
68
  &:hover {
58
- @include themed {
59
- box-shadow: $iui-hover-box-shadow, $iui-inset-box-shadow;
60
- }
69
+ box-shadow: $iui-hover-box-shadow, $iui-inset-box-shadow;
61
70
  }
62
71
 
63
- @include iui-focus($offset: 0, $thickness: 2px);
72
+ @include iui-focus($offset: 1px, $thickness: 2px);
64
73
 
65
74
  &.iui-active {
66
- @include themed {
67
- box-shadow: $iui-active-box-shadow, $iui-inset-box-shadow;
68
- }
75
+ box-shadow: $iui-active-box-shadow, $iui-inset-box-shadow;
69
76
 
70
77
  &:hover {
71
- @include themed {
72
- box-shadow: $iui-hover-box-shadow, $iui-inset-box-shadow, $iui-active-box-shadow;
73
- }
78
+ box-shadow: $iui-hover-box-shadow, $iui-inset-box-shadow, $iui-active-box-shadow;
74
79
  }
75
80
  }
76
81
  }
@@ -159,14 +164,14 @@ $iui-hover-box-shadow: 0 0 1px $iui-xxs + 1 rgba(t(iui-color-foreground-body-rgb
159
164
  }
160
165
 
161
166
  @mixin iui-color-field {
167
+ --iui-color-field-hue: initial;
168
+
162
169
  position: relative;
163
170
  cursor: crosshair;
164
171
  width: 100%;
165
172
  height: $iui-baseline * 19;
166
- @include themed {
167
- background-image: linear-gradient(0deg, rgb(0, 0, 0), transparent),
168
- linear-gradient(90deg, rgb(255, 255, 255), var(--hue));
169
- }
173
+ background-image: linear-gradient(0deg, rgb(0, 0, 0), transparent),
174
+ linear-gradient(90deg, rgb(255, 255, 255), var(--iui-color-field-hue));
170
175
 
171
176
  &:not(:last-child) {
172
177
  margin-bottom: round($iui-baseline * 0.5);
@@ -198,34 +203,14 @@ $iui-hover-box-shadow: 0 0 1px $iui-xxs + 1 rgba(t(iui-color-foreground-body-rgb
198
203
  @mixin iui-opacity-slider {
199
204
  .iui-slider-rail {
200
205
  height: $iui-s;
201
- @include themed {
202
- // Checkered transparency background pattern.
203
- background-image: repeating-linear-gradient(
204
- 45deg,
205
- t(iui-color-background-3) 25%,
206
- transparent 25%,
207
- transparent 75%,
208
- t(iui-color-background-3) 75%,
209
- t(iui-color-background-3)
210
- ),
211
- repeating-linear-gradient(
212
- 45deg,
213
- t(iui-color-background-3) 25%,
214
- t(iui-color-background-5) 25%,
215
- t(iui-color-background-5) 75%,
216
- t(iui-color-background-3) 75%,
217
- t(iui-color-background-3)
218
- );
219
- background-position: 0 0, ($iui-s * 0.5) ($iui-s * 0.5);
220
- background-size: $iui-s $iui-s;
221
- }
206
+ @include iui-transparent-background($size: $iui-s);
222
207
 
223
208
  &::before {
224
209
  display: block;
225
210
  content: '';
226
211
  width: 100%;
227
212
  height: 100%;
228
- background-image: linear-gradient(to right, transparent 0%, var(--selected-color) 100%);
213
+ background-image: linear-gradient(to right, transparent 0%, var(--iui-color-picker-selected-color) 100%);
229
214
  }
230
215
  }
231
216
 
@@ -235,25 +220,45 @@ $iui-hover-box-shadow: 0 0 1px $iui-xxs + 1 rgba(t(iui-color-foreground-body-rgb
235
220
  }
236
221
 
237
222
  @mixin iui-color-dot {
223
+ --iui-color-dot-inset: initial;
224
+
238
225
  position: absolute;
239
- top: var(--top, 0%);
240
- left: var(--left, 0%);
226
+ inset: var(--iui-color-dot-inset);
241
227
  width: $iui-m;
242
228
  height: $iui-m;
243
229
  border-radius: 50%;
244
230
  transform: translate(-$iui-s, -$iui-s);
245
231
  cursor: crosshair;
246
- @include themed {
247
- box-shadow: rgba(t(iui-color-foreground-accessory-rgb), t(iui-opacity-1)) 0 0 0 $iui-xxs - 1,
248
- inset 0 0 0 $iui-xxs - 1 rgba(t(iui-color-foreground-accessory-rgb), t(iui-opacity-6));
249
- background-color: var(--selected-color);
250
- }
232
+ box-shadow: rgba(var(--iui-color-foreground-accessory-rgb), var(--iui-opacity-1)) 0 0 0 $iui-xxs - 1,
233
+ inset 0 0 0 $iui-xxs - 1 rgba(var(--iui-color-foreground-accessory-rgb), var(--iui-opacity-6));
234
+ background-color: var(--iui-color-picker-selected-color);
251
235
 
252
236
  &:hover {
253
- @include themed {
254
- box-shadow: $iui-hover-box-shadow;
255
- }
237
+ box-shadow: $iui-hover-box-shadow;
256
238
  }
257
239
 
258
240
  @include iui-focus($offset: 0, $thickness: 2px);
259
241
  }
242
+
243
+ @mixin iui-transparent-background($size: $iui-m) {
244
+ background-position: 0 0, ($size * 0.5) ($size * 0.5);
245
+ background-size: $size $size;
246
+ @include themed {
247
+ background-image: repeating-linear-gradient(
248
+ 45deg,
249
+ t(iui-color-background-3) 25%,
250
+ transparent 25%,
251
+ transparent 75%,
252
+ t(iui-color-background-3) 75%,
253
+ t(iui-color-background-3)
254
+ ),
255
+ repeating-linear-gradient(
256
+ 45deg,
257
+ t(iui-color-background-3) 25%,
258
+ t(iui-color-background-5) 25%,
259
+ t(iui-color-background-5) 75%,
260
+ t(iui-color-background-3) 75%,
261
+ t(iui-color-background-3)
262
+ );
263
+ }
264
+ }