@navikt/ds-css 7.30.0 → 7.30.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.
Files changed (112) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/darkside/form/radio-checkbox.darkside.css +173 -176
  3. package/darkside/table.darkside.css +3 -23
  4. package/dist/darkside/component/form.css +101 -141
  5. package/dist/darkside/component/form.min.css +1 -1
  6. package/dist/darkside/component/table.css +3 -19
  7. package/dist/darkside/component/table.min.css +1 -1
  8. package/dist/darkside/components.css +104 -160
  9. package/dist/darkside/components.min.css +1 -1
  10. package/dist/darkside/global/tokens.css +1 -1
  11. package/dist/darkside/global/tokens.min.css +1 -1
  12. package/dist/darkside/index.css +105 -161
  13. package/dist/darkside/index.min.css +1 -1
  14. package/dist/darkside/version/{7.30.0 → 7.30.1}/component/form.css +101 -141
  15. package/dist/darkside/version/7.30.1/component/form.min.css +1 -0
  16. package/dist/darkside/version/{7.30.0 → 7.30.1}/component/table.css +3 -19
  17. package/dist/darkside/version/7.30.1/component/table.min.css +1 -0
  18. package/dist/darkside/version/{7.30.0 → 7.30.1}/components.css +104 -160
  19. package/dist/darkside/version/7.30.1/components.min.css +1 -0
  20. package/dist/darkside/version/{7.30.0 → 7.30.1}/global/tokens.css +1 -1
  21. package/dist/darkside/version/{7.30.0 → 7.30.1}/global/tokens.min.css +1 -1
  22. package/dist/darkside/version/{7.30.0 → 7.30.1}/index.css +105 -161
  23. package/dist/darkside/version/7.30.1/index.min.css +1 -0
  24. package/dist/global/tokens.css +1 -1
  25. package/dist/global/tokens.min.css +1 -1
  26. package/dist/index.css +1 -1
  27. package/dist/index.min.css +1 -1
  28. package/package.json +2 -2
  29. package/dist/darkside/version/7.30.0/component/form.min.css +0 -1
  30. package/dist/darkside/version/7.30.0/component/table.min.css +0 -1
  31. package/dist/darkside/version/7.30.0/components.min.css +0 -1
  32. package/dist/darkside/version/7.30.0/index.min.css +0 -1
  33. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/accordion.css +0 -0
  34. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/accordion.min.css +0 -0
  35. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/actionmenu.css +0 -0
  36. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/actionmenu.min.css +0 -0
  37. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/alert.css +0 -0
  38. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/alert.min.css +0 -0
  39. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/button.css +0 -0
  40. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/button.min.css +0 -0
  41. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/chat.css +0 -0
  42. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/chat.min.css +0 -0
  43. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/chips.css +0 -0
  44. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/chips.min.css +0 -0
  45. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/copybutton.css +0 -0
  46. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/copybutton.min.css +0 -0
  47. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/date.css +0 -0
  48. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/date.min.css +0 -0
  49. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/dropdown.css +0 -0
  50. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/dropdown.min.css +0 -0
  51. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/expansioncard.css +0 -0
  52. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/expansioncard.min.css +0 -0
  53. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/guidepanel.css +0 -0
  54. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/guidepanel.min.css +0 -0
  55. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/helptext.css +0 -0
  56. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/helptext.min.css +0 -0
  57. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/internalheader.css +0 -0
  58. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/internalheader.min.css +0 -0
  59. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/link.css +0 -0
  60. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/link.min.css +0 -0
  61. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/linkanchor.css +0 -0
  62. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/linkanchor.min.css +0 -0
  63. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/linkcard.css +0 -0
  64. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/linkcard.min.css +0 -0
  65. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/linkpanel.css +0 -0
  66. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/linkpanel.min.css +0 -0
  67. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/list.css +0 -0
  68. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/list.min.css +0 -0
  69. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/loader.css +0 -0
  70. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/loader.min.css +0 -0
  71. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/modal.css +0 -0
  72. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/modal.min.css +0 -0
  73. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/pagination.css +0 -0
  74. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/pagination.min.css +0 -0
  75. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/panel.css +0 -0
  76. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/panel.min.css +0 -0
  77. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/popover.css +0 -0
  78. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/popover.min.css +0 -0
  79. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/primitives.css +0 -0
  80. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/primitives.min.css +0 -0
  81. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/process.css +0 -0
  82. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/process.min.css +0 -0
  83. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/progressbar.css +0 -0
  84. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/progressbar.min.css +0 -0
  85. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/readmore.css +0 -0
  86. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/readmore.min.css +0 -0
  87. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/skeleton.css +0 -0
  88. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/skeleton.min.css +0 -0
  89. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/stepper.css +0 -0
  90. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/stepper.min.css +0 -0
  91. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/tabs.css +0 -0
  92. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/tabs.min.css +0 -0
  93. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/tag.css +0 -0
  94. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/tag.min.css +0 -0
  95. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/theme.css +0 -0
  96. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/theme.min.css +0 -0
  97. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/timeline.css +0 -0
  98. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/timeline.min.css +0 -0
  99. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/togglegroup.css +0 -0
  100. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/togglegroup.min.css +0 -0
  101. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/tooltip.css +0 -0
  102. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/tooltip.min.css +0 -0
  103. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/typography.css +0 -0
  104. /package/dist/darkside/version/{7.30.0 → 7.30.1}/component/typography.min.css +0 -0
  105. /package/dist/darkside/version/{7.30.0 → 7.30.1}/global/baseline.css +0 -0
  106. /package/dist/darkside/version/{7.30.0 → 7.30.1}/global/baseline.min.css +0 -0
  107. /package/dist/darkside/version/{7.30.0 → 7.30.1}/global/fonts.css +0 -0
  108. /package/dist/darkside/version/{7.30.0 → 7.30.1}/global/fonts.min.css +0 -0
  109. /package/dist/darkside/version/{7.30.0 → 7.30.1}/global/print.css +0 -0
  110. /package/dist/darkside/version/{7.30.0 → 7.30.1}/global/print.min.css +0 -0
  111. /package/dist/darkside/version/{7.30.0 → 7.30.1}/global/reset.css +0 -0
  112. /package/dist/darkside/version/{7.30.0 → 7.30.1}/global/reset.min.css +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @navikt/ds-css
2
2
 
3
+ ## 7.30.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Darkside: Improved screen reader experience in Radio and Checkbox by moving description out of label ([#4066](https://github.com/navikt/aksel/pull/4066))
8
+
3
9
  ## 7.30.0
4
10
 
5
11
  ### Minor Changes
@@ -1,294 +1,291 @@
1
1
  .aksel-checkbox,
2
2
  .aksel-radio {
3
+ --__axc-radio-checkbox-marker-size: 1.5rem;
4
+ --__axc-radio-checkbox-marker-target: 2.75rem; /* We want the click area to be a bit larger than the visible radio/checkbox */
5
+
3
6
  position: relative;
4
7
  width: fit-content;
8
+ display: grid;
9
+ grid-template-columns: auto 1fr;
10
+ gap: var(--ax-space-2) 0;
11
+ padding: var(--ax-space-12) 0; /* We need spacing even bellow the last element to allocate space for the clickable area */
12
+
13
+ /* Focus outline */
14
+ &:focus-within::after {
15
+ content: "";
16
+ position: absolute;
17
+ inset: var(--ax-space-12) 0;
18
+ pointer-events: none;
19
+ border-radius: var(--ax-radius-4);
20
+ outline: 3px solid var(--ax-border-focus);
21
+ outline-offset: 3px;
22
+ }
5
23
  }
6
24
 
7
- .aksel-checkbox__input,
8
- .aksel-radio__input {
9
- position: absolute;
10
- width: 3rem;
11
- height: 3rem;
12
- top: 0;
13
- left: -0.75rem;
14
- z-index: 1;
15
- opacity: 0;
16
- cursor: pointer;
25
+ /* Small */
26
+ .aksel-checkbox--small,
27
+ .aksel-radio--small {
28
+ --__axc-radio-checkbox-marker-size: 1.25rem;
29
+ --__axc-radio-checkbox-marker-target: 2rem;
30
+
31
+ padding: var(--ax-space-6) 0;
32
+
33
+ /* Focus outline */
34
+ &:focus-within::after {
35
+ inset: var(--ax-space-6) 0;
36
+ }
17
37
  }
18
38
 
39
+ /* Label */
19
40
  .aksel-checkbox__label,
20
41
  .aksel-radio__label {
21
- padding: var(--ax-space-12) 0;
22
42
  cursor: pointer;
23
- display: flex;
24
- gap: var(--ax-space-8);
25
-
26
- --__axc-radio-checkbox-readonly-bg: var(--ax-bg-neutral-moderate);
27
- --__axc-radio-checkbox-readonly-border: var(--ax-border-neutral-subtle);
28
43
  }
29
44
 
30
- .aksel-checkbox__label::before,
31
- .aksel-radio__label::before {
32
- content: "";
33
- border-radius: var(--ax-radius-4);
34
- background-color: var(--ax-bg-input);
35
- flex-shrink: 0;
36
- width: 1.5rem;
37
- height: 1.5rem;
38
- border: 2px solid var(--ax-border-neutral);
39
- }
40
-
41
- .aksel-radio__label::before {
42
- border-radius: var(--ax-radius-full);
45
+ /* Description */
46
+ .aksel-checkbox__description,
47
+ .aksel-radio__description {
48
+ grid-column-start: 2;
43
49
  }
44
50
 
45
- .aksel-checkbox__content,
46
- .aksel-radio__content {
47
- display: flex;
48
- flex-direction: column;
49
- gap: 0.125rem;
51
+ /* Spacing between marker and text */
52
+ .aksel-checkbox__label,
53
+ .aksel-radio__label,
54
+ .aksel-checkbox__description,
55
+ .aksel-radio__description {
56
+ padding-left: var(--ax-space-8);
50
57
  }
51
58
 
52
- .aksel-checkbox--small > .aksel-checkbox__input,
53
- .aksel-radio--small > .aksel-radio__input {
54
- width: 2rem;
55
- height: 2rem;
56
- top: 0;
57
- left: -0.375rem;
59
+ /* Checkbox has a wrapper around input and checkmark svg (consider creating the checkmark with css in the future) */
60
+ .aksel-checkbox__input-wrapper {
61
+ position: relative;
62
+ height: var(--__axc-radio-checkbox-marker-size);
58
63
  }
59
64
 
60
- .aksel-checkbox--small > .aksel-checkbox__label,
61
- .aksel-radio--small > .aksel-radio__label {
62
- padding: var(--ax-space-6) 0;
63
- }
65
+ /* The input acts as a container for the marker (since the click area should be larger than the visible marker) */
66
+ .aksel-checkbox__input,
67
+ .aksel-radio__input {
68
+ --__axc-radio-checkbox-marker-border: 2px;
64
69
 
65
- .aksel-checkbox--small > .aksel-checkbox__label::before,
66
- .aksel-radio--small > .aksel-radio__label::before {
67
- width: 1.25rem;
68
- height: 1.25rem;
70
+ -webkit-appearance: none; /* Safari <= 15.3 */
71
+ appearance: none;
72
+ cursor: pointer;
73
+ outline: none;
74
+ width: var(--__axc-radio-checkbox-marker-size);
75
+ height: var(--__axc-radio-checkbox-marker-size);
76
+ background-color: var(--ax-bg-input);
77
+ border: var(--__axc-radio-checkbox-marker-border) solid var(--ax-border-neutral);
78
+ border-radius: var(--ax-radius-4);
79
+ position: relative;
69
80
  }
70
81
 
71
- .aksel-checkbox__input:focus + .aksel-checkbox__label::after,
72
- .aksel-radio__input:focus + .aksel-radio__label::after {
82
+ /* Visible marker */
83
+ .aksel-checkbox__input::before,
84
+ .aksel-radio__input::before {
73
85
  content: "";
74
86
  position: absolute;
75
- width: 100%;
76
- height: calc(100% - var(--ax-space-24));
77
- border-radius: var(--ax-radius-4);
78
- outline: 3px solid var(--ax-border-focus);
79
- outline-offset: 3px;
80
- pointer-events: none;
87
+ inset: calc(
88
+ -1 * (var(--__axc-radio-checkbox-marker-border) +
89
+ (var(--__axc-radio-checkbox-marker-target) - var(--__axc-radio-checkbox-marker-size)) / 2)
90
+ );
81
91
  }
82
92
 
83
- .aksel-checkbox--small > .aksel-checkbox__input:focus + .aksel-checkbox__label::after,
84
- .aksel-radio--small > .aksel-radio__input:focus + .aksel-radio__label::after {
85
- height: calc(100% - var(--ax-space-12));
93
+ /* Radio marker should be round */
94
+ .aksel-radio__input {
95
+ border-radius: var(--ax-radius-full);
86
96
  }
87
97
 
88
- .aksel-checkbox__icon-indeterminate {
89
- display: none;
98
+ /* Checkbox indeterminate: Center the icon */
99
+ .aksel-checkbox__input:indeterminate {
100
+ display: flex;
101
+ align-items: center;
102
+ justify-content: center;
90
103
  }
91
104
 
92
- .aksel-checkbox__input:indeterminate + .aksel-checkbox__label > .aksel-checkbox__icon-indeterminate {
93
- display: block;
105
+ /* Checkbox indeterminate icon */
106
+ .aksel-checkbox__input:indeterminate::after {
107
+ content: "";
94
108
  width: 0.75rem;
95
109
  height: 0.25rem;
96
110
  background-color: var(--ax-bg-default);
97
111
  border-radius: 1px;
98
112
  position: absolute;
99
- transform: translate(var(--ax-space-6), -50%);
100
- top: var(--ax-space-24);
101
- pointer-events: none;
102
- }
103
-
104
- .aksel-checkbox--small .aksel-checkbox__input:indeterminate + .aksel-checkbox__label > .aksel-checkbox__icon-indeterminate {
105
- transform: translate(var(--ax-space-4), -50%);
106
- top: var(--ax-space-16);
107
- height: 0.1875rem;
108
113
  }
109
114
 
110
- .aksel-checkbox__input:where(:checked, :indeterminate) + .aksel-checkbox__label::before {
115
+ /* Checkbox marker colors in checked/indeterminate state */
116
+ .aksel-checkbox__input:where(:checked, :indeterminate) {
111
117
  background-color: var(--ax-bg-strong-pressed);
112
118
  border-color: var(--ax-bg-strong-pressed);
113
119
  }
114
120
 
115
- .aksel-checkbox__input:where(:checked, :indeterminate):not(:disabled):hover + .aksel-checkbox__label::before {
121
+ /* Checkbox marker colors in checked/indeterminate + hover state (unless disabled) */
122
+ .aksel-checkbox__input:where(:checked, :indeterminate):not(:disabled):hover {
116
123
  border-color: var(--ax-bg-strong-hover);
117
124
  background-color: var(--ax-bg-strong-hover);
118
125
  }
119
126
 
120
- .aksel-checkbox__input:where(:not(:checked)) + .aksel-checkbox__label > .aksel-checkbox__icon {
127
+ /* Checkbox checkmark: Hide when unchecked */
128
+ .aksel-checkbox__input:where(:not(:checked)) + .aksel-checkbox__icon {
121
129
  display: none;
122
130
  }
123
131
 
124
- .aksel-checkbox__input:checked + .aksel-checkbox__label > .aksel-checkbox__icon {
132
+ /* Checkbox checkmark */
133
+ .aksel-checkbox__icon {
125
134
  color: var(--ax-bg-default);
126
- position: absolute;
127
- height: 1.5rem;
128
- transform: translate(var(--ax-space-6));
129
135
  pointer-events: none;
130
-
131
- /* Fixed edcase where when using in shadow-dom, svg will not center */
132
- display: flex;
133
- align-items: center;
134
- }
135
-
136
- .aksel-checkbox--small .aksel-checkbox__input:checked + .aksel-checkbox__label > .aksel-checkbox__icon {
137
- transform: translate(0.25rem, -10%);
136
+ width: 0.8125rem; /* Safari does not support inline rem-values in SVG */
137
+ height: var(--__axc-radio-checkbox-marker-size);
138
+ position: absolute;
139
+ top: 0;
140
+ left: var(--ax-space-6);
138
141
  }
139
142
 
140
- .aksel-checkbox__icon > svg {
141
- display: block;
142
-
143
- /* Safari does not support inline rem-values in SVG */
144
- width: 0.8125rem;
145
- height: 0.625rem;
143
+ /* Small Checkbox checkmark position */
144
+ .aksel-checkbox--small .aksel-checkbox__input:checked + .aksel-checkbox__icon {
145
+ left: var(--ax-space-4);
146
146
  }
147
147
 
148
- .aksel-checkbox--small > .aksel-checkbox__input:checked + .aksel-checkbox__label::before {
149
- background-position: 0.25rem center;
150
- }
148
+ /* Radio marker colors in checked state */
149
+ .aksel-radio__input:checked {
150
+ --__axc-radio-checkbox-marker-border: 8px;
151
151
 
152
- .aksel-radio__input:checked + .aksel-radio__label::before {
152
+ border-color: var(--ax-bg-strong-pressed);
153
153
  background-color: var(--ax-bg-input);
154
- border: 8px solid var(--ax-bg-strong-pressed);
155
154
  }
156
155
 
157
- .aksel-radio--small > .aksel-radio__input:checked + .aksel-radio__label::before {
158
- border-width: 6px;
156
+ /* Small Radio dot size in checked state */
157
+ .aksel-radio--small > .aksel-radio__input:checked {
158
+ --__axc-radio-checkbox-marker-border: 7px;
159
159
  }
160
160
 
161
- .aksel-checkbox__input:hover:not(:disabled, :checked, :indeterminate) + .aksel-checkbox__label::before,
162
- .aksel-radio__input:hover:not(:disabled, :checked) + .aksel-radio__label::before {
161
+ /* Marker colors in unchecked hover state (unless disabled) */
162
+ .aksel-checkbox__input:hover:not(:disabled, :checked, :indeterminate),
163
+ .aksel-radio__input:hover:not(:disabled, :checked) {
163
164
  border-color: var(--ax-border-strong);
164
165
  background-color: var(--ax-bg-moderate-hoverA);
165
166
  }
166
167
 
167
- .aksel-checkbox--error > .aksel-checkbox__input:not(:disabled, :checked, :indeterminate) + .aksel-checkbox__label::before,
168
- .aksel-radio--error > .aksel-radio__input:not(:disabled, :checked) + .aksel-radio__label::before {
168
+ /* Marker colors in unchecked error state (unless disabled) */
169
+ .aksel-checkbox--error .aksel-checkbox__input:not(:disabled, :checked, :indeterminate),
170
+ .aksel-radio--error > .aksel-radio__input:not(:disabled, :checked) {
169
171
  border-color: var(--ax-border-danger-strong);
170
172
  }
171
173
 
172
- .aksel-radio--error > .aksel-radio__input:checked + .aksel-radio__label::before {
173
- border-color: var(--ax-bg-danger-strong-pressed);
174
- }
175
-
174
+ /* Opacity in disabled state */
176
175
  .aksel-checkbox--disabled,
177
176
  .aksel-radio--disabled {
178
177
  opacity: var(--ax-opacity-disabled);
179
178
  }
180
179
 
181
- .aksel-checkbox--disabled > .aksel-checkbox__input,
182
- .aksel-checkbox--disabled > .aksel-checkbox__label,
183
- .aksel-radio--disabled > .aksel-radio__input,
184
- .aksel-radio--disabled > .aksel-radio__label {
180
+ /* Cursor in disabled state on otherwise clickable elements */
181
+ .aksel-checkbox--disabled :where(.aksel-checkbox__input, .aksel-checkbox__label),
182
+ .aksel-radio--disabled > :where(.aksel-radio__input, .aksel-radio__label) {
185
183
  cursor: not-allowed;
186
184
  }
187
185
 
188
- /* Readonly */
189
- .aksel-checkbox--readonly > :where(.aksel-checkbox__input, .aksel-checkbox__label),
186
+ /* Cursor in readonly state on otherwise clickable elements */
187
+ .aksel-checkbox--readonly :where(.aksel-checkbox__input, .aksel-checkbox__label),
190
188
  .aksel-radio--readonly > :where(.aksel-radio__input, .aksel-radio__label) {
191
189
  cursor: default;
192
190
  }
193
191
 
194
- .aksel-checkbox--readonly .aksel-checkbox__label-text {
195
- display: inline-flex;
192
+ /* Marker colors in readonly state (`:not(:disabled)` is just to get same specificity as (hence override) hover colors) */
193
+ .aksel-checkbox--readonly .aksel-checkbox__input:not(:disabled),
194
+ .aksel-radio--readonly > .aksel-radio__input:not(:disabled) {
195
+ background-color: var(--ax-bg-neutral-moderate);
196
+ border-color: var(--ax-border-neutral-subtle);
196
197
  }
197
198
 
198
- .aksel-checkbox--readonly > .aksel-checkbox__input:not(:disabled) + .aksel-checkbox__label::before,
199
- .aksel-checkbox--readonly > .aksel-checkbox__input:hover .aksel-checkbox__label::before,
200
- .aksel-radio--readonly > .aksel-radio__input:not(:disabled, :checked) + .aksel-radio__label::before,
201
- .aksel-radio--readonly > .aksel-radio__input:hover:not(:checked, :focus) + .aksel-radio__label::before {
202
- background-color: var(--__axc-radio-checkbox-readonly-bg);
203
- border-color: var(--__axc-radio-checkbox-readonly-border);
204
- }
199
+ .aksel-checkbox--readonly {
200
+ /* Needed to center the lock icon on standalone checkbox */
201
+ .aksel-checkbox__label {
202
+ display: inline-flex;
203
+ }
205
204
 
206
- .aksel-checkbox--readonly > .aksel-checkbox__input:where(:checked, :indeterminate) + .aksel-checkbox__label::before {
207
- border-color: var(--__axc-radio-checkbox-readonly-border);
208
- background-color: var(--__axc-radio-checkbox-readonly-bg);
209
- }
205
+ /* Checkbox checkmark color in readonly + checked state */
206
+ .aksel-checkbox__input:checked + .aksel-checkbox__icon {
207
+ color: var(--ax-text-neutral-subtle);
208
+ }
210
209
 
211
- .aksel-checkbox--readonly > .aksel-checkbox__input:checked + .aksel-checkbox__label > .aksel-checkbox__icon {
212
- color: var(--ax-text-neutral-subtle);
210
+ /* Checkbox indeterminate icon color in readonly + indeterminate state */
211
+ .aksel-checkbox__input:indeterminate::after {
212
+ background-color: var(--ax-text-neutral-subtle);
213
+ }
213
214
  }
214
215
 
215
- .aksel-radio--readonly > .aksel-radio__input:checked + .aksel-radio__label::before {
216
+ /* Radio marker colors in readonly + checked state */
217
+ .aksel-radio--readonly > .aksel-radio__input:checked {
218
+ --__axc-radio-checkbox-marker-border: 0px; /* Needs unit for calc() to work */
219
+
216
220
  background-color: var(--ax-bg-neutral-strong);
217
- border-width: 0;
218
221
  box-shadow:
219
222
  inset 0 0 0 2px var(--ax-border-neutral-subtle),
220
223
  inset 0 0 0 8px var(--ax-bg-neutral-moderate);
221
224
  }
222
225
 
223
- .aksel-radio--small.aksel-radio--readonly > .aksel-radio__input:checked + .aksel-radio__label::before {
226
+ /* Small Radio dot size in readonly + checked state */
227
+ .aksel-radio--small.aksel-radio--readonly > .aksel-radio__input:checked {
224
228
  box-shadow:
225
229
  inset 0 0 0 2px var(--ax-border-neutral-subtle),
226
230
  inset 0 0 0 7px var(--ax-bg-neutral-moderate);
227
231
  }
228
232
 
229
- .aksel-checkbox--readonly > .aksel-checkbox__input:indeterminate + .aksel-checkbox__label > .aksel-checkbox__icon-indeterminate {
230
- background-color: var(--ax-text-neutral-subtle);
231
- }
232
-
233
+ /* High contrast mode */
233
234
  @media (forced-colors: active) {
234
- .aksel-checkbox,
235
- .aksel-radio {
236
- --__axc-radio-checkbox-high-contrast-bg: field;
237
- --__axc-radio-checkbox-high-contrast-text: fieldtext;
238
- --__axc-radio-checkbox-high-contrast-highlight: highlight;
239
-
240
- /* TODO: Consider adding this to global scope */
241
- --ax-border-focus: Highlight;
242
- }
243
-
244
- .aksel-checkbox__label::before,
245
- .aksel-radio__label::before {
246
- border: 1px solid var(--__axc-radio-checkbox-high-contrast-text);
247
- background-color: var(--__axc-radio-checkbox-high-contrast-bg);
235
+ /* Checkbox indeterminate icon color */
236
+ :is(.aksel-checkbox, .aksel-checkbox--readonly) .aksel-checkbox__input:indeterminate::after {
237
+ background-color: fieldtext;
248
238
  }
249
239
 
250
- .aksel-checkbox__input:checked + .aksel-checkbox__label > .aksel-checkbox__icon {
251
- color: var(--__axc-radio-checkbox-high-contrast-text);
240
+ /* Label color on hover (unless readonly/disabled) */
241
+ .aksel-checkbox:not(.aksel-checkbox--readonly):has(.aksel-checkbox__input:hover:not(:disabled)) > .aksel-checkbox__label,
242
+ .aksel-radio:not(.aksel-radio--readonly) > .aksel-radio__input:hover:not(:disabled) + .aksel-radio__label {
243
+ color: highlight;
252
244
  }
253
245
 
254
- .aksel-checkbox__input:indeterminate + .aksel-checkbox__label > .aksel-checkbox__icon-indeterminate {
255
- background-color: var(--__axc-radio-checkbox-high-contrast-text);
246
+ /* Marker border color on hover (unless readonly/disabled) */
247
+ .aksel-checkbox:not(.aksel-checkbox--readonly) .aksel-checkbox__input:hover:not(:disabled),
248
+ .aksel-radio:not(.aksel-radio--readonly) > .aksel-radio__input:hover:not(:disabled) {
249
+ border-color: highlight;
256
250
  }
257
251
 
258
- .aksel-radio__input:checked + .aksel-radio__label::before {
259
- border: 6px solid var(--__axc-radio-checkbox-high-contrast-text);
252
+ /* Checkbox checkmark color in readonly + checked state */
253
+ .aksel-checkbox--readonly .aksel-checkbox__input:checked + .aksel-checkbox__icon {
254
+ color: var(--ax-bg-default);
260
255
  }
261
256
 
262
- :not(.aksel-checkbox--readonly) > .aksel-checkbox__input:hover:not(:disabled) + .aksel-checkbox__label,
263
- :not(.aksel-radio--readonly) > .aksel-radio__input:hover:not(:disabled) + .aksel-radio__label {
264
- color: highlight;
257
+ /* Radio dot size in readonly + checked state */
258
+ .aksel-radio--readonly > .aksel-radio__input:checked {
259
+ --__axc-radio-checkbox-marker-border: 8px;
265
260
  }
266
261
 
267
- .aksel-checkbox--readonly > .aksel-checkbox__input:checked + .aksel-checkbox__label::before {
268
- border: 1px solid var(--__axc-radio-checkbox-high-contrast-text);
269
- background-color: var(--__axc-radio-checkbox-high-contrast-bg);
270
- }
271
-
272
- .aksel-checkbox--readonly
273
- > .aksel-checkbox__input:indeterminate
274
- + .aksel-checkbox__label
275
- > .aksel-checkbox__icon-indeterminate {
276
- background-color: var(--__axc-radio-checkbox-high-contrast-text);
277
- }
278
-
279
- .aksel-radio--readonly > .aksel-radio__input:checked + .aksel-radio__label::before {
280
- border-width: 6px;
262
+ /* Small Radio dot size in readonly + checked state */
263
+ .aksel-radio--small.aksel-radio--readonly > .aksel-radio__input:checked {
264
+ --__axc-radio-checkbox-marker-border: 7px;
281
265
  }
282
266
 
267
+ /* Turn off disabled state transparency */
283
268
  .aksel-checkbox--disabled,
284
269
  .aksel-radio--disabled {
285
270
  opacity: 1;
271
+ }
272
+
273
+ /* Marker colors in disabled state */
274
+ .aksel-checkbox--disabled .aksel-checkbox__input,
275
+ .aksel-radio--disabled .aksel-radio__input {
276
+ border-color: graytext;
277
+ background-color: field;
278
+ }
286
279
 
287
- --__axc-radio-checkbox-high-contrast-bg: field;
288
- --__axc-radio-checkbox-high-contrast-text: graytext;
280
+ /* Checkbox indeterminate icon color in disabled state */
281
+ .aksel-checkbox--disabled .aksel-checkbox__input:indeterminate::after {
282
+ background-color: graytext;
289
283
  }
290
284
 
291
- :is(.aksel-checkbox--disabled, .aksel-radio--disabled) :is(.aksel-checkbox__label, .aksel-radio__label) {
285
+ /* Text/icon color in disabled state */
286
+ .aksel-checkbox--disabled
287
+ :is(.aksel-checkbox__label, .aksel-checkbox__description, .aksel-checkbox__input:checked + .aksel-checkbox__icon),
288
+ .aksel-radio--disabled :is(.aksel-radio__label, .aksel-radio__description) {
292
289
  color: graytext;
293
290
  }
294
291
  }
@@ -131,32 +131,12 @@
131
131
  }
132
132
 
133
133
  /* TODO: Look to handle "inline"-checkbox better than custom CSS-overrides in the future. */
134
- .aksel-table tr:not(.aksel-table__expanded-row) .aksel-checkbox__input {
135
- top: -0.75rem;
136
- }
137
-
138
- .aksel-table tr:not(.aksel-table__expanded-row) .aksel-checkbox--small .aksel-checkbox__input {
139
- top: -0.375rem;
140
- }
141
-
142
- .aksel-table tr:not(.aksel-table__expanded-row) .aksel-checkbox__label {
134
+ .aksel-table tr:not(.aksel-table__expanded-row) .aksel-checkbox {
143
135
  padding: 0;
144
136
  }
145
137
 
146
- .aksel-table tr:not(.aksel-table__expanded-row) .aksel-checkbox__label > .aksel-checkbox__icon-indeterminate {
147
- top: var(--ax-space-12);
148
- }
149
-
150
- .aksel-table
151
- tr:not(.aksel-table__expanded-row)
152
- .aksel-checkbox--small
153
- .aksel-checkbox__label
154
- > .aksel-checkbox__icon-indeterminate {
155
- top: 0.6rem;
156
- }
157
-
158
- .aksel-table tr:not(.aksel-table__expanded-row) .aksel-checkbox__input:focus + .aksel-checkbox__label::after {
159
- height: 100%;
138
+ .aksel-table tr:not(.aksel-table__expanded-row) .aksel-checkbox:focus-within::after {
139
+ inset: 0;
160
140
  }
161
141
 
162
142
  .aksel-table__header-cell[aria-sort] {