|
| 1 | +/* stylelint-disable primer/colors */ |
| 2 | +@define-mixin lightThemeIssueLabel { |
| 3 | + --lightness-threshold: 0.453; |
| 4 | + --border-threshold: 0.96; |
| 5 | + --border-alpha: max(0, min(calc((var(--perceived-lightness) - var(--border-threshold)) * 100), 1)); |
| 6 | + |
| 7 | + background: rgb(var(--label-r), var(--label-g), var(--label-b)); |
| 8 | + color: hsl(0deg, 0%, calc(var(--lightness-switch) * 100%)); |
| 9 | + border-color: hsla(var(--label-h), calc(var(--label-s) * 1%), calc((var(--label-l) - 25) * 1%), var(--border-alpha)); |
| 10 | + |
| 11 | + /* Selected state */ |
| 12 | + &:where([data-selected='true']) { |
| 13 | + background: hsl(var(--label-h), calc(var(--label-s) * 1%), calc((var(--label-l) - 5) * 1%)); |
| 14 | + } |
| 15 | + |
| 16 | + &:where([data-selected='true'])::after { |
| 17 | + /* stylelint-disable-next-line primer/box-shadow */ |
| 18 | + box-shadow: 0 0 0 2px rgb(var(--label-r), var(--label-g), var(--label-b)); |
| 19 | + } |
| 20 | + |
| 21 | + /* Interactive hover states */ |
| 22 | + &:where([data-cursor-is-interactive='true']:hover) { |
| 23 | + background-image: linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15)), |
| 24 | + linear-gradient( |
| 25 | + rgb(var(--label-r), var(--label-g), var(--label-b)), |
| 26 | + rgb(var(--label-r), var(--label-g), var(--label-b)) |
| 27 | + ); |
| 28 | + box-shadow: var(--shadow-resting-medium); |
| 29 | + } |
| 30 | +} |
| 31 | + |
| 32 | +@define-mixin darkThemeIssueLabel { |
| 33 | + --lightness-threshold: 0.6; |
| 34 | + --background-alpha: 0.18; |
| 35 | + --border-alpha: 0.3; |
| 36 | + --lighten-by: calc(((var(--lightness-threshold) - var(--perceived-lightness)) * 100) * var(--lightness-switch)); |
| 37 | + |
| 38 | + background: rgba(var(--label-r), var(--label-g), var(--label-b), var(--background-alpha)); |
| 39 | + color: hsl(var(--label-h), calc(var(--label-s) * 1%), calc((var(--label-l) + var(--lighten-by)) * 1%)); |
| 40 | + border-color: hsla( |
| 41 | + var(--label-h), |
| 42 | + calc(var(--label-s) * 1%), |
| 43 | + calc((var(--label-l) + var(--lighten-by)) * 1%), |
| 44 | + var(--border-alpha) |
| 45 | + ); |
| 46 | + |
| 47 | + /* Selected state */ |
| 48 | + &:where([data-selected='true'])::after { |
| 49 | + /* stylelint-disable-next-line primer/box-shadow */ |
| 50 | + box-shadow: 0 0 0 2px |
| 51 | + hsl(var(--label-h), calc(var(--label-s) * 1%), calc((var(--label-l) + var(--lighten-by)) * 1%)); |
| 52 | + } |
| 53 | + |
| 54 | + /* Interactive hover states */ |
| 55 | + &:where([data-cursor-is-interactive='true']:hover) { |
| 56 | + background: hsla(var(--label-h), calc(var(--label-s) * 1%), calc(calc(var(--label-l) + 10) * 1%), 0.3); |
| 57 | + box-shadow: var(--shadow-resting-medium); |
| 58 | + } |
| 59 | +} |
| 60 | + |
1 | 61 | .IssueLabel { |
2 | 62 | /* Color variables - dynamically set via inline CSS custom properties */ |
3 | 63 | --label-r: 153; |
|
16 | 76 | border-style: solid; |
17 | 77 | } |
18 | 78 |
|
| 79 | +@media (prefers-color-scheme: light) { |
| 80 | + [data-color-mode='auto'][data-light-theme*='light'] .IssueLabel { |
| 81 | + @mixin lightThemeIssueLabel; |
| 82 | + } |
| 83 | + |
| 84 | + [data-color-mode='auto'][data-light-theme*='dark'] .IssueLabel { |
| 85 | + @mixin darkThemeIssueLabel; |
| 86 | + } |
| 87 | +} |
| 88 | + |
| 89 | +@media (prefers-color-scheme: dark) { |
| 90 | + [data-color-mode='auto'][data-dark-theme*='light'] .IssueLabel { |
| 91 | + @mixin lightThemeIssueLabel; |
| 92 | + } |
| 93 | + |
| 94 | + [data-color-mode='auto'][data-dark-theme*='dark'] .IssueLabel { |
| 95 | + @mixin darkThemeIssueLabel; |
| 96 | + } |
| 97 | +} |
| 98 | + |
19 | 99 | /* Light mode styles */ |
20 | | -.IssueLabel:where([data-in-color-mode*='light'], [data-in-color-mode='auto']) { |
21 | | - --lightness-threshold: 0.453; |
22 | | - --border-threshold: 0.96; |
23 | | - --border-alpha: max(0, min(calc((var(--perceived-lightness) - var(--border-threshold)) * 100), 1)); |
24 | | - /* stylelint-disable-next-line primer/colors */ |
25 | | - background: rgb(var(--label-r), var(--label-g), var(--label-b)); |
26 | | - /* stylelint-disable-next-line primer/colors */ |
27 | | - color: hsl(0deg, 0%, calc(var(--lightness-switch) * 100%)); |
28 | | - /* stylelint-disable-next-line primer/colors */ |
29 | | - border-color: hsla(var(--label-h), calc(var(--label-s) * 1%), calc((var(--label-l) - 25) * 1%), var(--border-alpha)); |
| 100 | +[data-color-mode='light'] .IssueLabel { |
| 101 | + @mixin lightThemeIssueLabel; |
30 | 102 | } |
31 | 103 |
|
32 | 104 | /* Dark mode styles */ |
33 | | -.IssueLabel:where([data-in-color-mode*='dark']) { |
34 | | - --lightness-threshold: 0.6; |
35 | | - --background-alpha: 0.18; |
36 | | - --border-alpha: 0.3; |
37 | | - --lighten-by: calc(((var(--lightness-threshold) - var(--perceived-lightness)) * 100) * var(--lightness-switch)); |
38 | | - |
39 | | - /* stylelint-disable-next-line primer/colors */ |
40 | | - background: rgba(var(--label-r), var(--label-g), var(--label-b), var(--background-alpha)); |
41 | | - /* stylelint-disable-next-line primer/colors */ |
42 | | - color: hsl(var(--label-h), calc(var(--label-s) * 1%), calc((var(--label-l) + var(--lighten-by)) * 1%)); |
43 | | - /* stylelint-disable primer/colors */ |
44 | | - border-color: hsla( |
45 | | - var(--label-h), |
46 | | - calc(var(--label-s) * 1%), |
47 | | - calc((var(--label-l) + var(--lighten-by)) * 1%), |
48 | | - var(--border-alpha) |
49 | | - ); |
50 | | - /* stylelint-enable primer/colors */ |
| 105 | +[data-color-mode='dark'] .IssueLabel { |
| 106 | + @mixin darkThemeIssueLabel; |
51 | 107 | } |
52 | 108 |
|
53 | 109 | /* Selected state */ |
54 | | -.IssueLabel:where( |
55 | | - [data-selected='true'][data-in-color-mode*='light'], |
56 | | - [data-selected='true'][data-in-color-mode='auto'] |
57 | | - ) { |
58 | | - /* stylelint-disable-next-line primer/colors */ |
59 | | - background: hsl(var(--label-h), calc(var(--label-s) * 1%), calc((var(--label-l) - 5) * 1%)); |
60 | | -} |
61 | 110 |
|
62 | 111 | .IssueLabel:where([data-selected='true']) { |
63 | 112 | outline: none; |
|
76 | 125 | border-radius: var(--borderRadius-full); |
77 | 126 | } |
78 | 127 |
|
79 | | -.IssueLabel:where( |
80 | | - [data-selected='true'][data-in-color-mode*='light'], |
81 | | - [data-selected='true'][data-in-color-mode='auto'] |
82 | | - )::after { |
83 | | - /* stylelint-disable-next-line primer/box-shadow */ |
84 | | - box-shadow: 0 0 0 2px rgb(var(--label-r), var(--label-g), var(--label-b)); |
85 | | -} |
86 | | - |
87 | | -.IssueLabel:where([data-selected='true'][data-in-color-mode='dark'])::after { |
88 | | - /* stylelint-disable-next-line primer/box-shadow */ |
89 | | - box-shadow: 0 0 0 2px hsl(var(--label-h), calc(var(--label-s) * 1%), calc((var(--label-l) + var(--lighten-by)) * 1%)); |
90 | | -} |
91 | | - |
92 | | -/* Interactive hover states */ |
93 | | -.IssueLabel:where( |
94 | | - [data-cursor-is-interactive='true']:hover[data-in-color-mode*='light'], |
95 | | - [data-cursor-is-interactive='true']:hover[data-in-color-mode='auto'] |
96 | | - ) { |
97 | | - background-image: linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15)), |
98 | | - linear-gradient( |
99 | | - rgb(var(--label-r), var(--label-g), var(--label-b)), |
100 | | - rgb(var(--label-r), var(--label-g), var(--label-b)) |
101 | | - ); |
102 | | - box-shadow: var(--shadow-resting-medium); |
103 | | -} |
104 | | - |
105 | | -.IssueLabel:where([data-cursor-is-interactive='true']:hover[data-in-color-mode='dark']) { |
106 | | - /* stylelint-disable-next-line primer/colors */ |
107 | | - background: hsla(var(--label-h), calc(var(--label-s) * 1%), calc(calc(var(--label-l) + 10) * 1%), 0.3); |
108 | | - box-shadow: var(--shadow-resting-medium); |
109 | | -} |
110 | | - |
111 | 128 | /* Remove button styling */ |
112 | 129 | .IssueLabel:where([data-has-remove-button='true']) { |
113 | 130 | padding-right: 0; |
|
0 commit comments