|
41 | 41 | user-select: none;
|
42 | 42 | cursor: default;
|
43 | 43 |
|
44 |
| - /* calcs wrapping --spectrum-colorwheel-border-width are used to properly position the border drawn using this ::before pseudo element over the exterior edge of the colorwheel. The size is reduced and positioning adjusted to create the border effect. */ |
| 44 | + /** |
| 45 | + * Color wheel exterior border |
| 46 | + * - Calcs for `inline-size` and `block-size` subtract 4 times the component's border width |
| 47 | + * (to account for the inset width of the exterior border) from the component's width. |
| 48 | + */ |
45 | 49 | &::before {
|
46 | 50 | inline-size: calc(var(--spectrum-colorwheel-width) - calc(4 * var(--spectrum-colorwheel-border-width)));
|
47 | 51 | block-size: calc(var(--spectrum-colorwheel-width) - calc(4 * var(--spectrum-colorwheel-border-width)));
|
|
56 | 60 | z-index: 1;
|
57 | 61 | }
|
58 | 62 |
|
| 63 | + /** |
| 64 | + * Color wheel interior border |
| 65 | + * - Calcs for `inset` 2 times the component's border width from the |
| 66 | + * track width (to account for the inset width of the interior border) |
| 67 | + */ |
| 68 | + &::after { |
| 69 | + inset: calc(var(--spectrum-colorwheel-track-width) - (calc(2 * var(--spectrum-colorwheel-border-width)))); |
| 70 | + content: ""; |
| 71 | + position: absolute; |
| 72 | + border-width: var(--spectrum-colorwheel-border-width); |
| 73 | + border-style: solid; |
| 74 | + border-color: var(--mod-colorwheel-border-color, var(--spectrum-colorwheel-border-color)); |
| 75 | + border-radius: 100%; |
| 76 | + z-index: 1; |
| 77 | + } |
| 78 | + |
59 | 79 | &.is-focused {
|
60 | 80 | z-index: 2;
|
61 | 81 | }
|
|
85 | 105 | inline-size: var(--mod-colorwheel-colorarea-container-size, var(--spectrum-colorwheel-colorarea-container-size));
|
86 | 106 | block-size: var(--mod-colorwheel-colorarea-container-size, var(--spectrum-colorwheel-colorarea-container-size));
|
87 | 107 | margin: auto;
|
88 |
| - |
89 |
| - /* calcs wrapping --spectrum-colorwheel-border-width are used to properly position the border drawn using this ::before pseudo element over the interior edge of the colorwheel. The size is increased and positioning adjusted to create the border effect. */ |
90 |
| - &::before { |
91 |
| - inline-size: var(--mod-colorwheel-colorarea-container-size, var(--spectrum-colorwheel-colorarea-container-size)); |
92 |
| - block-size: var(--mod-colorwheel-colorarea-container-size, var(--spectrum-colorwheel-colorarea-container-size)); |
93 |
| - inset: calc(-1 * var(--spectrum-colorwheel-border-width)); |
94 |
| - content: ""; |
95 |
| - position: absolute; |
96 |
| - border-width: var(--spectrum-colorwheel-border-width); |
97 |
| - border-style: solid; |
98 |
| - border-color: var(--mod-colorwheel-border-color, var(--spectrum-colorwheel-border-color)); |
99 |
| - border-radius: 100%; |
100 |
| - z-index: 1; |
101 |
| - } |
102 | 108 | }
|
103 | 109 |
|
104 | 110 | .spectrum-ColorWheel-colorarea-container {
|
|
0 commit comments