@navikt/ds-css 3.0.0 → 3.1.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/button.css +87 -12
  3. package/chat.css +0 -5
  4. package/chips.css +24 -0
  5. package/date.css +42 -8
  6. package/dist/component/button.css +87 -12
  7. package/dist/component/button.min.css +1 -1
  8. package/dist/component/chat.css +0 -5
  9. package/dist/component/chat.min.css +1 -1
  10. package/dist/component/chips.css +24 -0
  11. package/dist/component/chips.min.css +1 -1
  12. package/dist/component/date.css +42 -8
  13. package/dist/component/date.min.css +1 -1
  14. package/dist/component/expansioncard.css +7 -3
  15. package/dist/component/expansioncard.min.css +1 -1
  16. package/dist/component/form.css +161 -33
  17. package/dist/component/form.min.css +1 -1
  18. package/dist/component/helptext.css +20 -4
  19. package/dist/component/helptext.min.css +1 -1
  20. package/dist/component/index.css +420 -77
  21. package/dist/component/index.min.css +2 -2
  22. package/dist/component/link.css +11 -1
  23. package/dist/component/link.min.css +1 -1
  24. package/dist/component/linkpanel.css +8 -1
  25. package/dist/component/linkpanel.min.css +1 -1
  26. package/dist/component/modal.css +9 -1
  27. package/dist/component/modal.min.css +1 -1
  28. package/dist/component/pagination.css +7 -1
  29. package/dist/component/pagination.min.css +1 -1
  30. package/dist/component/popover.css +8 -1
  31. package/dist/component/popover.min.css +1 -1
  32. package/dist/component/readmore.css +8 -1
  33. package/dist/component/readmore.min.css +1 -1
  34. package/dist/component/stepper.css +9 -1
  35. package/dist/component/stepper.min.css +1 -1
  36. package/dist/component/table.css +15 -2
  37. package/dist/component/table.min.css +1 -1
  38. package/dist/component/tabs.css +16 -1
  39. package/dist/component/tabs.min.css +1 -1
  40. package/dist/component/togglegroup.css +22 -2
  41. package/dist/component/togglegroup.min.css +1 -1
  42. package/dist/components.css +419 -76
  43. package/dist/components.min.css +2 -2
  44. package/dist/global/tokens.css +1 -1
  45. package/dist/index.css +420 -77
  46. package/dist/index.min.css +2 -2
  47. package/expansioncard.css +7 -3
  48. package/form/error-summary.css +8 -1
  49. package/form/fieldset.css +1 -1
  50. package/form/form.css +5 -1
  51. package/form/radio-checkbox.css +79 -16
  52. package/form/search.css +39 -7
  53. package/form/select.css +8 -1
  54. package/form/switch.css +8 -2
  55. package/form/text-field.css +15 -2
  56. package/form/textarea.css +16 -2
  57. package/help-text.css +20 -4
  58. package/link-panel.css +8 -1
  59. package/link.css +11 -1
  60. package/modal.css +9 -1
  61. package/package.json +2 -2
  62. package/pagination.css +7 -1
  63. package/popover.css +8 -1
  64. package/read-more.css +8 -1
  65. package/stepper.css +9 -1
  66. package/table.css +15 -2
  67. package/tabs.css +16 -1
  68. package/toggle-group.css +22 -2
@@ -43,7 +43,7 @@
43
43
  .navds-radio__content {
44
44
  display: flex;
45
45
  flex-direction: column;
46
- gap: var(--a-spacing-1);
46
+ gap: 0.125rem;
47
47
  }
48
48
 
49
49
  .navds-checkbox--small > .navds-checkbox__input,
@@ -65,16 +65,30 @@
65
65
  height: 1.25rem;
66
66
  }
67
67
 
68
- .navds-checkbox__input:focus + .navds-checkbox__label::before,
69
- .navds-radio__input:focus + .navds-radio__label::before {
68
+ .navds-checkbox__input:focus-visible + .navds-checkbox__label::before,
69
+ .navds-radio__input:focus-visible + .navds-radio__label::before {
70
70
  box-shadow: inset 0 0 0 2px var(--ac-radio-checkbox-border, var(--a-border-default)), var(--a-shadow-focus);
71
71
  }
72
72
 
73
- .navds-checkbox__input:hover:focus + .navds-checkbox__label::before,
74
- .navds-radio__input:hover:focus + .navds-radio__label::before {
73
+ @supports not selector(:focus-visible) {
74
+ .navds-checkbox__input:focus + .navds-checkbox__label::before,
75
+ .navds-radio__input:focus + .navds-radio__label::before {
76
+ box-shadow: inset 0 0 0 2px var(--ac-radio-checkbox-border, var(--a-border-default)), var(--a-shadow-focus);
77
+ }
78
+ }
79
+
80
+ .navds-checkbox__input:hover:focus-visible + .navds-checkbox__label::before,
81
+ .navds-radio__input:hover:focus-visible + .navds-radio__label::before {
75
82
  box-shadow: inset 0 0 0 2px var(--ac-radio-checkbox-action, var(--a-surface-action)), var(--a-shadow-focus);
76
83
  }
77
84
 
85
+ @supports not selector(:focus-visible) {
86
+ .navds-checkbox__input:hover:focus + .navds-checkbox__label::before,
87
+ .navds-radio__input:hover:focus + .navds-radio__label::before {
88
+ box-shadow: inset 0 0 0 2px var(--ac-radio-checkbox-action, var(--a-surface-action)), var(--a-shadow-focus);
89
+ }
90
+ }
91
+
78
92
  .navds-checkbox__input:indeterminate + .navds-checkbox__label::before {
79
93
  box-shadow: none;
80
94
  background-color: var(--ac-radio-checkbox-action, var(--a-surface-action));
@@ -109,32 +123,54 @@
109
123
  background-position: 4px center;
110
124
  }
111
125
 
112
- .navds-checkbox__input:indeterminate:focus + .navds-checkbox__label::before,
113
- .navds-checkbox__input:checked:focus + .navds-checkbox__label::before {
126
+ .navds-checkbox__input:indeterminate:focus-visible + .navds-checkbox__label::before,
127
+ .navds-checkbox__input:checked:focus-visible + .navds-checkbox__label::before {
114
128
  box-shadow: inset 0 0 0 1px var(--ac-radio-checkbox-bg, var(--a-surface-default)), var(--a-shadow-focus);
115
129
  }
116
130
 
131
+ @supports not selector(:focus-visible) {
132
+ .navds-checkbox__input:indeterminate:focus + .navds-checkbox__label::before,
133
+ .navds-checkbox__input:checked:focus + .navds-checkbox__label::before {
134
+ box-shadow: inset 0 0 0 1px var(--ac-radio-checkbox-bg, var(--a-surface-default)), var(--a-shadow-focus);
135
+ }
136
+ }
137
+
117
138
  .navds-radio__input:checked + .navds-radio__label::before {
118
139
  box-shadow: inset 0 0 0 2px var(--ac-radio-checkbox-action, var(--a-surface-action)),
119
140
  inset 0 0 0 4px var(--ac-radio-checkbox-bg, var(--a-surface-default));
120
141
  background-color: var(--ac-radio-checkbox-action, var(--a-surface-action));
121
142
  }
122
143
 
123
- .navds-radio__input:checked:focus + .navds-radio__label::before {
144
+ .navds-radio__input:checked:focus-visible + .navds-radio__label::before {
124
145
  box-shadow: inset 0 0 0 2px var(--ac-radio-checkbox-action, var(--a-surface-action)),
125
146
  inset 0 0 0 4px var(--ac-radio-checkbox-bg, var(--a-surface-default)), var(--a-shadow-focus);
126
147
  }
127
148
 
149
+ @supports not selector(:focus-visible) {
150
+ .navds-radio__input:checked:focus + .navds-radio__label::before {
151
+ box-shadow: inset 0 0 0 2px var(--ac-radio-checkbox-action, var(--a-surface-action)),
152
+ inset 0 0 0 4px var(--ac-radio-checkbox-bg, var(--a-surface-default)), var(--a-shadow-focus);
153
+ }
154
+ }
155
+
128
156
  .navds-checkbox__input:hover:not(:disabled) + .navds-checkbox__label,
129
157
  .navds-radio__input:hover:not(:disabled) + .navds-radio__label {
130
158
  color: var(--ac-radio-checkbox-action, var(--a-surface-action));
131
159
  }
132
160
 
133
- .navds-checkbox__input:hover:not(:disabled):not(:checked):not(:indeterminate):not(:focus) + .navds-checkbox__label::before,
134
- .navds-radio__input:hover:not(:disabled):not(:checked):not(:focus) + .navds-radio__label::before {
161
+ .navds-checkbox__input:hover:not(:disabled):not(:checked):not(:indeterminate):not(:focus-visible)
162
+ + .navds-checkbox__label::before,
163
+ .navds-radio__input:hover:not(:disabled):not(:checked):not(:focus-visible) + .navds-radio__label::before {
135
164
  box-shadow: inset 0 0 0 2px var(--ac-radio-checkbox-action, var(--a-surface-action));
136
165
  }
137
166
 
167
+ @supports not selector(:focus-visible) {
168
+ .navds-checkbox__input:hover:not(:disabled):not(:checked):not(:indeterminate):not(:focus) + .navds-checkbox__label::before,
169
+ .navds-radio__input:hover:not(:disabled):not(:checked):not(:focus) + .navds-radio__label::before {
170
+ box-shadow: inset 0 0 0 2px var(--ac-radio-checkbox-action, var(--a-surface-action));
171
+ }
172
+ }
173
+
138
174
  .navds-checkbox__input:hover:not(:disabled):not(:checked):not(:indeterminate) + .navds-checkbox__label::before,
139
175
  .navds-radio__input:hover:not(:disabled):not(:checked) + .navds-radio__label::before {
140
176
  background-color: var(--ac-radio-checkbox-action-hover-bg, var(--a-surface-action-subtle));
@@ -148,28 +184,55 @@
148
184
  }
149
185
 
150
186
  .navds-checkbox--error
151
- > .navds-checkbox__input:focus:not(:hover):not(:disabled):not(:checked):not(:indeterminate)
187
+ > .navds-checkbox__input:focus-visible:not(:hover):not(:disabled):not(:checked):not(:indeterminate)
152
188
  + .navds-checkbox__label::before,
153
- .navds-radio--error > .navds-radio__input:focus:not(:hover):not(:disabled):not(:checked) + .navds-radio__label::before {
189
+ .navds-radio--error > .navds-radio__input:focus-visible:not(:hover):not(:disabled):not(:checked) + .navds-radio__label::before {
154
190
  box-shadow: inset 0 0 0 2px var(--ac-radio-checkbox-error-border, var(--a-border-danger)), var(--a-shadow-focus);
155
191
  }
156
192
 
193
+ @supports not selector(:focus-visible) {
194
+ .navds-checkbox--error
195
+ > .navds-checkbox__input:focus:not(:hover):not(:disabled):not(:checked):not(:indeterminate)
196
+ + .navds-checkbox__label::before,
197
+ .navds-radio--error > .navds-radio__input:focus:not(:hover):not(:disabled):not(:checked) + .navds-radio__label::before {
198
+ box-shadow: inset 0 0 0 2px var(--ac-radio-checkbox-error-border, var(--a-border-danger)), var(--a-shadow-focus);
199
+ }
200
+ }
201
+
157
202
  .navds-checkbox--error
158
- > .navds-checkbox__input:hover:not(:disabled):not(:checked):not(:indeterminate):not(:focus)
203
+ > .navds-checkbox__input:hover:not(:disabled):not(:checked):not(:indeterminate):not(:focus-visible)
159
204
  + .navds-checkbox__label::before,
160
- .navds-radio--error > .navds-radio__input:hover:not(:disabled):not(:checked):not(:focus) + .navds-radio__label::before {
205
+ .navds-radio--error > .navds-radio__input:hover:not(:disabled):not(:checked):not(:focus-visible) + .navds-radio__label::before {
161
206
  background-color: var(--ac-radio-checkbox-error-hover-bg, var(--a-surface-danger-subtle));
162
207
  box-shadow: inset 0 0 0 2px var(--ac-radio-checkbox-error-border, var(--a-border-danger));
163
208
  }
164
209
 
165
210
  .navds-checkbox--error
166
- > .navds-checkbox__input:focus:hover:not(:disabled):not(:checked):not(:indeterminate)
211
+ > .navds-checkbox__input:focus-visible:hover:not(:disabled):not(:checked):not(:indeterminate)
167
212
  + .navds-checkbox__label::before,
168
- .navds-radio--error > .navds-radio__input:focus:hover:not(:disabled):not(:checked) + .navds-radio__label::before {
213
+ .navds-radio--error > .navds-radio__input:focus-visible:hover:not(:disabled):not(:checked) + .navds-radio__label::before {
169
214
  background-color: var(--ac-radio-checkbox-error-hover-bg, var(--a-surface-danger-subtle));
170
215
  box-shadow: inset 0 0 0 2px var(--ac-radio-checkbox-error-border, var(--a-border-danger)), var(--a-shadow-focus);
171
216
  }
172
217
 
218
+ @supports not selector(:focus-visible) {
219
+ .navds-checkbox--error
220
+ > .navds-checkbox__input:hover:not(:disabled):not(:checked):not(:indeterminate):not(:focus)
221
+ + .navds-checkbox__label::before,
222
+ .navds-radio--error > .navds-radio__input:hover:not(:disabled):not(:checked):not(:focus) + .navds-radio__label::before {
223
+ background-color: var(--ac-radio-checkbox-error-hover-bg, var(--a-surface-danger-subtle));
224
+ box-shadow: inset 0 0 0 2px var(--ac-radio-checkbox-error-border, var(--a-border-danger));
225
+ }
226
+
227
+ .navds-checkbox--error
228
+ > .navds-checkbox__input:focus:hover:not(:disabled):not(:checked):not(:indeterminate)
229
+ + .navds-checkbox__label::before,
230
+ .navds-radio--error > .navds-radio__input:focus:hover:not(:disabled):not(:checked) + .navds-radio__label::before {
231
+ background-color: var(--ac-radio-checkbox-error-hover-bg, var(--a-surface-danger-subtle));
232
+ box-shadow: inset 0 0 0 2px var(--ac-radio-checkbox-error-border, var(--a-border-danger)), var(--a-shadow-focus);
233
+ }
234
+ }
235
+
173
236
  .navds-checkbox--disabled,
174
237
  .navds-radio--disabled {
175
238
  opacity: 0.3;
package/form/search.css CHANGED
@@ -86,11 +86,18 @@
86
86
  color: var(--ac-search-clear-icon-hover, var(--a-text-action));
87
87
  }
88
88
 
89
- .navds-search__button-clear:focus {
89
+ .navds-search__button-clear:focus-visible {
90
90
  box-shadow: var(--a-shadow-focus);
91
91
  outline: none;
92
92
  }
93
93
 
94
+ @supports not selector(:focus-visible) {
95
+ .navds-search__button-clear:focus {
96
+ box-shadow: var(--a-shadow-focus);
97
+ outline: none;
98
+ }
99
+ }
100
+
94
101
  .navds-search__button-search {
95
102
  flex-shrink: 0;
96
103
  min-width: 64px;
@@ -126,31 +133,56 @@
126
133
  z-index: auto;
127
134
  }
128
135
 
129
- .navds-search__button-search.navds-button--secondary:focus {
136
+ .navds-search__button-search.navds-button--secondary:focus-visible {
130
137
  box-shadow: 0 0 0 1px var(--ac-search-button-border, var(--a-border-default)) inset, var(--a-shadow-focus);
131
138
  }
132
139
 
133
- .navds-search__button-search.navds-button--secondary:focus:hover {
140
+ .navds-search__button-search.navds-button--secondary:focus-visible:hover {
134
141
  box-shadow: 0 0 0 1px var(--ac-search-button-border-hover, var(--a-border-action)) inset, var(--a-shadow-focus);
135
142
  }
136
143
 
137
- .navds-search__button-search.navds-button--secondary:focus:active {
144
+ .navds-search__button-search.navds-button--secondary:focus-visible:active {
138
145
  box-shadow: 0 0 0 1px var(--ac-search-button-focus-active-border, var(--a-surface-default)) inset, var(--a-shadow-focus);
139
146
  }
140
147
 
148
+ @supports not selector(:focus-visible) {
149
+ .navds-search__button-search.navds-button--secondary:focus {
150
+ box-shadow: 0 0 0 1px var(--ac-search-button-border, var(--a-border-default)) inset, var(--a-shadow-focus);
151
+ }
152
+
153
+ .navds-search__button-search.navds-button--secondary:focus:hover {
154
+ box-shadow: 0 0 0 1px var(--ac-search-button-border-hover, var(--a-border-action)) inset, var(--a-shadow-focus);
155
+ }
156
+
157
+ .navds-search__button-search.navds-button--secondary:focus:active {
158
+ box-shadow: 0 0 0 1px var(--ac-search-button-focus-active-border, var(--a-surface-default)) inset, var(--a-shadow-focus);
159
+ }
160
+ }
161
+
141
162
  /* Error-handling */
142
163
  .navds-search--error .navds-search__input:not(:hover):not(:disabled) {
143
164
  border-color: var(--ac-search-error-border, var(--a-border-danger));
144
165
  box-shadow: inset 0 0 0 1px var(--ac-search-error-border, var(--a-border-danger));
145
166
  }
146
167
 
147
- .navds-search--error .navds-search__input:focus:not(:hover):not(:disabled) {
168
+ .navds-search--error .navds-search__input:focus-visible:not(:hover):not(:disabled) {
148
169
  box-shadow: inset 0 0 0 1px var(--ac-search-error-border, var(--a-border-danger)), var(--a-shadow-focus);
149
170
  }
150
171
 
151
172
  /* Focus layering */
152
- .navds-search__input:focus,
173
+ .navds-search__input:focus-visible,
153
174
  .navds-search__button-clear,
154
- .navds-search__button-search:focus {
175
+ .navds-search__button-search:focus-visible {
155
176
  z-index: 1;
156
177
  }
178
+
179
+ @supports not selector(:focus-visible) {
180
+ .navds-search--error .navds-search__input:focus:not(:hover):not(:disabled) {
181
+ box-shadow: inset 0 0 0 1px var(--ac-search-error-border, var(--a-border-danger)), var(--a-shadow-focus);
182
+ }
183
+
184
+ .navds-search__input:focus,
185
+ .navds-search__button-search:focus {
186
+ z-index: 1;
187
+ }
188
+ }
package/form/select.css CHANGED
@@ -17,11 +17,18 @@
17
17
  border-color: var(--ac-select-hover-bg, var(--a-border-action));
18
18
  }
19
19
 
20
- .navds-select__input:focus {
20
+ .navds-select__input:focus-visible {
21
21
  outline: none;
22
22
  box-shadow: var(--a-shadow-focus);
23
23
  }
24
24
 
25
+ @supports not selector(:focus-visible) {
26
+ .navds-select__input:focus {
27
+ outline: none;
28
+ box-shadow: var(--a-shadow-focus);
29
+ }
30
+ }
31
+
25
32
  .navds-select__container {
26
33
  position: relative;
27
34
  display: flex;
package/form/switch.css CHANGED
@@ -38,7 +38,7 @@
38
38
  .navds-switch__content {
39
39
  display: flex;
40
40
  flex-direction: column;
41
- gap: var(--a-spacing-1);
41
+ gap: 0.125rem;
42
42
  padding: 0.75rem 0 0.75rem 3.25rem;
43
43
  }
44
44
 
@@ -110,10 +110,16 @@
110
110
  background-color: var(--ac-switch-checked-bg, var(--a-border-success));
111
111
  }
112
112
 
113
- .navds-switch__input:focus ~ .navds-switch__track {
113
+ .navds-switch__input:focus-visible ~ .navds-switch__track {
114
114
  box-shadow: 0 0 0 1px var(--a-surface-default), var(--a-shadow-focus);
115
115
  }
116
116
 
117
+ @supports not selector(:focus-visible) {
118
+ .navds-switch__input:focus ~ .navds-switch__track {
119
+ box-shadow: 0 0 0 1px var(--a-surface-default), var(--a-shadow-focus);
120
+ }
121
+ }
122
+
117
123
  /* Thumb */
118
124
  .navds-switch__thumb {
119
125
  background-color: var(--ac-switch-thumb-bg, var(--a-surface-default));
@@ -35,11 +35,18 @@
35
35
  border-color: var(--ac-textfield-hover-border, var(--a-border-action));
36
36
  }
37
37
 
38
- .navds-text-field__input:focus {
38
+ .navds-text-field__input:focus-visible {
39
39
  outline: none;
40
40
  box-shadow: var(--a-shadow-focus);
41
41
  }
42
42
 
43
+ @supports not selector(:focus-visible) {
44
+ .navds-text-field__input:focus {
45
+ outline: none;
46
+ box-shadow: var(--a-shadow-focus);
47
+ }
48
+ }
49
+
43
50
  /**
44
51
  Error handling
45
52
  */
@@ -48,10 +55,16 @@
48
55
  box-shadow: 0 0 0 1px var(--ac-textfield-error-border, var(--a-border-danger));
49
56
  }
50
57
 
51
- .navds-text-field--error > .navds-text-field__input:focus:not(:hover):not(:disabled) {
58
+ .navds-text-field--error > .navds-text-field__input:focus-visible:not(:hover):not(:disabled) {
52
59
  box-shadow: 0 0 0 1px var(--a-border-danger), var(--a-shadow-focus);
53
60
  }
54
61
 
62
+ @supports not selector(:focus-visible) {
63
+ .navds-text-field--error > .navds-text-field__input:focus:not(:hover):not(:disabled) {
64
+ box-shadow: 0 0 0 1px var(--a-border-danger), var(--a-shadow-focus);
65
+ }
66
+ }
67
+
55
68
  /* Disabled handling */
56
69
  .navds-text-field__input:disabled {
57
70
  background-color: var(--ac-textfield-bg, var(--a-surface-default));
package/form/textarea.css CHANGED
@@ -38,11 +38,18 @@
38
38
  border-color: var(--ac-textarea-hover-border, var(--a-border-action));
39
39
  }
40
40
 
41
- .navds-textarea__input:focus {
41
+ .navds-textarea__input:focus-visible {
42
42
  outline: none;
43
43
  box-shadow: var(--a-shadow-focus);
44
44
  }
45
45
 
46
+ @supports not selector(:focus-visible) {
47
+ .navds-textarea__input:focus {
48
+ outline: none;
49
+ box-shadow: var(--a-shadow-focus);
50
+ }
51
+ }
52
+
46
53
  .navds-form-field--small .navds-textarea__input {
47
54
  padding: 6px;
48
55
  }
@@ -73,11 +80,18 @@
73
80
  /**
74
81
  Error handling
75
82
  */
76
- .navds-textarea--error .navds-textarea__input:not(:hover):not(:focus):not(:disabled) {
83
+ .navds-textarea--error .navds-textarea__input:not(:hover):not(:focus-visible):not(:disabled) {
77
84
  box-shadow: 0 0 0 1px var(--ac-textarea-error-border, var(--a-border-danger));
78
85
  border-color: var(--ac-textarea-error-border, var(--a-border-danger));
79
86
  }
80
87
 
88
+ @supports not selector(:focus-visible) {
89
+ .navds-textarea--error .navds-textarea__input:not(:hover):not(:focus):not(:disabled) {
90
+ box-shadow: 0 0 0 1px var(--ac-textarea-error-border, var(--a-border-danger));
91
+ border-color: var(--ac-textarea-error-border, var(--a-border-danger));
92
+ }
93
+ }
94
+
81
95
  .navds-textarea__input:disabled {
82
96
  background-color: var(--ac-textarea-bg, var(--a-surface-default));
83
97
  border-color: var(--ac-textarea-border, var(--a-border-default));
package/help-text.css CHANGED
@@ -12,11 +12,17 @@
12
12
  font-size: 1.5rem;
13
13
  }
14
14
 
15
- .navds-help-text__button:focus {
16
- outline: none;
15
+ .navds-help-text__button:focus-visible {
17
16
  box-shadow: 0 0 0 1px var(--a-surface-default), 0 0 0 4px var(--a-border-focus);
18
17
  }
19
18
 
19
+ @supports not selector(:focus-visible) {
20
+ .navds-help-text__button:focus {
21
+ outline: none;
22
+ box-shadow: 0 0 0 1px var(--a-surface-default), 0 0 0 4px var(--a-border-focus);
23
+ }
24
+ }
25
+
20
26
  .navds-help-text__icon {
21
27
  border-radius: var(--a-border-radius-full);
22
28
  }
@@ -36,10 +42,20 @@
36
42
  display: none;
37
43
  }
38
44
 
39
- .navds-help-text__button:where(:hover, :focus, [aria-expanded="true"]) > .navds-help-text__icon {
45
+ .navds-help-text__button:where(:hover, :focus-visible, [aria-expanded="true"]) > .navds-help-text__icon {
40
46
  display: none;
41
47
  }
42
48
 
43
- .navds-help-text__button:where(:hover, :focus, [aria-expanded="true"]) > .navds-help-text__icon--filled {
49
+ .navds-help-text__button:where(:hover, :focus-visible, [aria-expanded="true"]) > .navds-help-text__icon--filled {
44
50
  display: inherit;
45
51
  }
52
+
53
+ @supports not selector(:focus-visible) {
54
+ .navds-help-text__button:where(:focus) > .navds-help-text__icon {
55
+ display: none;
56
+ }
57
+
58
+ .navds-help-text__button:where(:focus) > .navds-help-text__icon--filled {
59
+ display: inherit;
60
+ }
61
+ }
package/link-panel.css CHANGED
@@ -17,11 +17,18 @@
17
17
  border-color: var(--ac-link-panel-hover-border, var(--a-border-action));
18
18
  }
19
19
 
20
- .navds-link-panel:focus {
20
+ .navds-link-panel:focus-visible {
21
21
  box-shadow: var(--a-shadow-focus);
22
22
  outline: none;
23
23
  }
24
24
 
25
+ @supports not selector(:focus-visible) {
26
+ .navds-link-panel:focus {
27
+ box-shadow: var(--a-shadow-focus);
28
+ outline: none;
29
+ }
30
+ }
31
+
25
32
  .navds-link-panel__chevron {
26
33
  flex-shrink: 0;
27
34
  font-size: 1.5rem;
package/link.css CHANGED
@@ -15,7 +15,7 @@
15
15
  text-decoration: none;
16
16
  }
17
17
 
18
- .navds-link:focus {
18
+ .navds-link:focus-visible {
19
19
  outline: none;
20
20
  color: var(--ac-link-focus-text, var(--a-text-on-action));
21
21
  text-decoration: none;
@@ -23,6 +23,16 @@
23
23
  box-shadow: 0 0 0 2px var(--ac-link-focus-border, var(--a-border-focus));
24
24
  }
25
25
 
26
+ @supports not selector(:focus-visible) {
27
+ .navds-link:focus {
28
+ outline: none;
29
+ color: var(--ac-link-focus-text, var(--a-text-on-action));
30
+ text-decoration: none;
31
+ background-color: var(--ac-link-focus-bg, var(--a-border-focus));
32
+ box-shadow: 0 0 0 2px var(--ac-link-focus-border, var(--a-border-focus));
33
+ }
34
+ }
35
+
26
36
  .navds-link:active {
27
37
  outline: none;
28
38
  color: var(--ac-link-active-text, var(--a-text-on-action));
package/modal.css CHANGED
@@ -15,12 +15,20 @@
15
15
  padding: var(--a-spacing-4);
16
16
  }
17
17
 
18
- .navds-modal:focus,
18
+ .navds-modal:focus-visible,
19
19
  .navds-modal--focus {
20
20
  box-shadow: var(--a-shadow-focus);
21
21
  outline: none;
22
22
  }
23
23
 
24
+ @supports not selector(:focus-visible) {
25
+ .navds-modal:focus,
26
+ .navds-modal--focus {
27
+ box-shadow: var(--a-shadow-focus);
28
+ outline: none;
29
+ }
30
+ }
31
+
24
32
  .navds-modal__overlay {
25
33
  position: fixed;
26
34
  z-index: var(--a-z-index-modal);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navikt/ds-css",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "CSS for NAV Designsystem",
5
5
  "author": "Aksel | NAV designsystem team",
6
6
  "keywords": [
@@ -27,7 +27,7 @@
27
27
  "css:get-version": "node config/get-version.js"
28
28
  },
29
29
  "devDependencies": {
30
- "@navikt/ds-tokens": "^3.0.0",
30
+ "@navikt/ds-tokens": "^3.1.0",
31
31
  "cssnano": "6.0.0",
32
32
  "fast-glob": "3.2.11",
33
33
  "lodash": "4.17.21",
package/pagination.css CHANGED
@@ -35,10 +35,16 @@
35
35
  color: var(--ac-pagination-selected-text, var(--a-text-on-action));
36
36
  }
37
37
 
38
- .navds-pagination__item[aria-current="true"]:focus {
38
+ .navds-pagination__item[aria-current="true"]:focus-visible {
39
39
  box-shadow: inset 0 0 0 1px var(--a-surface-default), var(--a-shadow-focus);
40
40
  }
41
41
 
42
+ @supports not selector(:focus-visible) {
43
+ .navds-pagination__item[aria-current="true"]:focus {
44
+ box-shadow: inset 0 0 0 1px var(--a-surface-default), var(--a-shadow-focus);
45
+ }
46
+ }
47
+
42
48
  .navds-pagination__prev-next {
43
49
  display: flex;
44
50
  align-items: center;
package/popover.css CHANGED
@@ -15,11 +15,18 @@
15
15
  display: none;
16
16
  }
17
17
 
18
- .navds-popover:focus {
18
+ .navds-popover:focus-visible {
19
19
  outline: none;
20
20
  box-shadow: var(--a-shadow-focus);
21
21
  }
22
22
 
23
+ @supports not selector(:focus-visible) {
24
+ .navds-popover:focus {
25
+ outline: none;
26
+ box-shadow: var(--a-shadow-focus);
27
+ }
28
+ }
29
+
23
30
  .navds-popover__arrow {
24
31
  position: absolute;
25
32
  z-index: -1;
package/read-more.css CHANGED
@@ -24,11 +24,18 @@
24
24
  background-color: var(--ac-read-more-active-bg, var(--a-surface-active));
25
25
  }
26
26
 
27
- .navds-read-more__button:focus {
27
+ .navds-read-more__button:focus-visible {
28
28
  outline: none;
29
29
  box-shadow: var(--a-shadow-focus);
30
30
  }
31
31
 
32
+ @supports not selector(:focus-visible) {
33
+ .navds-read-more__button:focus {
34
+ outline: none;
35
+ box-shadow: var(--a-shadow-focus);
36
+ }
37
+ }
38
+
32
39
  .navds-read-more__content {
33
40
  margin-top: var(--a-spacing-1);
34
41
  border-left: 2px solid var(--ac-read-more-line, var(--a-border-divider));
package/stepper.css CHANGED
@@ -80,12 +80,20 @@ button.navds-stepper__step {
80
80
  cursor: default;
81
81
  }
82
82
 
83
- :where(.navds-stepper__step):focus {
83
+ :where(.navds-stepper__step):focus-visible {
84
84
  outline: none;
85
85
  box-shadow: var(--a-shadow-focus);
86
86
  isolation: isolate;
87
87
  }
88
88
 
89
+ @supports not selector(:focus-visible) {
90
+ .navds-stepper__step:focus {
91
+ outline: none;
92
+ box-shadow: var(--a-shadow-focus);
93
+ isolation: isolate;
94
+ }
95
+ }
96
+
89
97
  .navds-stepper__circle {
90
98
  grid-column: circle;
91
99
  display: inline-grid;
package/table.css CHANGED
@@ -119,11 +119,18 @@
119
119
  background-color: var(--ac-table-sort-button-hover-bg, var(--a-bg-subtle));
120
120
  }
121
121
 
122
- .navds-table__sort-button:focus {
122
+ .navds-table__sort-button:focus-visible {
123
123
  outline: none;
124
124
  box-shadow: inset 0 0 0 2px var(--a-border-focus);
125
125
  }
126
126
 
127
+ @supports not selector(:focus-visible) {
128
+ .navds-table__sort-button:focus {
129
+ outline: none;
130
+ box-shadow: inset 0 0 0 2px var(--a-border-focus);
131
+ }
132
+ }
133
+
127
134
  .navds-table__header-cell[aria-sort="ascending"] .navds-table__sort-button,
128
135
  .navds-table__header-cell[aria-sort="descending"] .navds-table__sort-button {
129
136
  background-color: var(--ac-table-sort-button-sorted-bg, var(--a-surface-selected));
@@ -181,10 +188,16 @@
181
188
  padding: var(--a-spacing-2);
182
189
  }
183
190
 
184
- .navds-table__toggle-expand-button:focus {
191
+ .navds-table__toggle-expand-button:focus-visible {
185
192
  box-shadow: inset var(--a-shadow-focus);
186
193
  }
187
194
 
195
+ @supports not selector(:focus-visible) {
196
+ .navds-table__toggle-expand-button:focus {
197
+ box-shadow: inset var(--a-shadow-focus);
198
+ }
199
+ }
200
+
188
201
  .navds-table__expandable-icon {
189
202
  font-size: 1.5rem;
190
203
  }
package/tabs.css CHANGED
@@ -62,12 +62,20 @@
62
62
  color: var(--ac-tabs-selected-text, var(--a-text-default));
63
63
  }
64
64
 
65
- .navds-tabs__tab:focus {
65
+ .navds-tabs__tab:focus-visible {
66
66
  outline: none;
67
67
  box-shadow: inset var(--a-shadow-focus);
68
68
  color: var(--ac-tabs-focus-text, var(--a-text-default));
69
69
  }
70
70
 
71
+ @supports not selector(:focus-visible) {
72
+ .navds-tabs__tab:focus {
73
+ outline: none;
74
+ box-shadow: inset var(--a-shadow-focus);
75
+ color: var(--ac-tabs-focus-text, var(--a-text-default));
76
+ }
77
+ }
78
+
71
79
  .navds-tabs__tab-inner {
72
80
  display: flex;
73
81
  align-items: center;
@@ -112,3 +120,10 @@
112
120
  outline: none;
113
121
  box-shadow: inset 0 0 0 2px var(--a-border-focus);
114
122
  }
123
+
124
+ @supports not selector(:focus-visible) {
125
+ .navds-tabs__tabpanel:focus {
126
+ outline: none;
127
+ box-shadow: inset 0 0 0 2px var(--a-border-focus);
128
+ }
129
+ }