@ons/design-system 54.0.1 → 55.0.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.
- package/components/button/_button.scss +20 -6
- package/components/button/_macro.njk +1 -1
- package/components/button/_macro.spec.js +2 -2
- package/components/checkboxes/_checkbox.scss +43 -10
- package/components/collapsible/_collapsible.scss +2 -1
- package/components/document-list/document-list.scss +2 -0
- package/components/download-resources/download-resources.js +19 -0
- package/components/download-resources/download-resources.spec.js +95 -0
- package/components/external-link/_macro.njk +1 -1
- package/components/external-link/_macro.spec.js +2 -2
- package/components/fieldset/_fieldset.scss +11 -1
- package/components/fieldset/_macro.njk +9 -8
- package/components/fieldset/_macro.spec.js +27 -5
- package/components/footer/_footer.scss +1 -0
- package/components/header/_macro.njk +2 -5
- package/components/header/_macro.spec.js +0 -16
- package/components/hero/_macro.njk +1 -1
- package/components/hero/_macro.spec.js +1 -1
- package/components/icons/_macro.njk +1 -1
- package/components/input/_input-type.scss +3 -0
- package/components/input/_input.scss +13 -2
- package/components/label/_label.scss +1 -1
- package/components/label/_macro.njk +27 -15
- package/components/label/_macro.spec.js +31 -0
- package/components/lists/_macro.njk +1 -1
- package/components/lists/_macro.spec.js +2 -2
- package/components/message/_message.scss +1 -0
- package/components/modal/_macro.njk +2 -2
- package/components/modal/_modal.scss +10 -9
- package/components/navigation/_macro.njk +0 -1
- package/components/navigation/_macro.spec.js +0 -1
- package/components/pagination/_pagination.scss +1 -0
- package/components/panel/_macro.njk +6 -7
- package/components/panel/_macro.spec.js +23 -20
- package/components/panel/_panel.scss +13 -5
- package/components/phase-banner/_phase-banner.scss +1 -0
- package/components/radios/_radio.scss +15 -3
- package/components/reply/_macro.njk +2 -2
- package/components/skip-to-content/_skip.scss +2 -1
- package/components/table/_macro.njk +3 -2
- package/components/table/_macro.spec.js +0 -27
- package/components/table/_table.scss +13 -6
- package/components/table/sortable-table.js +1 -0
- package/components/tabs/_tabs.scss +5 -3
- package/css/census.css +1 -1
- package/css/ids.css +1 -1
- package/css/main.css +1 -1
- package/layout/_template.njk +8 -8
- package/package.json +1 -1
- package/scripts/main.es5.js +1 -1
- package/scripts/main.js +1 -1
- package/scss/base/_global.scss +1 -0
- package/scss/overrides/hcm.scss +205 -46
- package/scss/patternlib.scss +1 -0
package/scss/base/_global.scss
CHANGED
package/scss/overrides/hcm.scss
CHANGED
|
@@ -2,80 +2,239 @@
|
|
|
2
2
|
@media screen and (-ms-high-contrast: active), (forced-colors: active) {
|
|
3
3
|
// Brightness makes all images black, except transparent parts, which remain transparent
|
|
4
4
|
// Then, invert(1) makes the black parts white
|
|
5
|
-
.ons-header__logo,
|
|
6
5
|
.ons-footer__ogl-img,
|
|
7
6
|
.ons-quote .ons-svg-icon,
|
|
8
|
-
.ons-collapsible__icon .ons-svg-icon,
|
|
9
7
|
.ons-footer img {
|
|
10
8
|
filter: brightness(0) invert(1);
|
|
11
9
|
}
|
|
12
10
|
|
|
13
|
-
//
|
|
14
|
-
.ons-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.ons-list--icons .ons-svg-icon {
|
|
18
|
-
fill: currentColor;
|
|
11
|
+
// Panels – add border to replace backgrounds
|
|
12
|
+
.ons-panel {
|
|
13
|
+
border-color: currentColor;
|
|
14
|
+
border-left-width: 8px !important;
|
|
19
15
|
}
|
|
20
16
|
|
|
21
|
-
//
|
|
22
|
-
.ons-
|
|
23
|
-
|
|
17
|
+
// Adds some style adjustments to the focused item to make it obvious something is selected
|
|
18
|
+
.ons-autosuggest-input {
|
|
19
|
+
&__results {
|
|
20
|
+
border: 1px solid Highlight !important;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ons-autosuggest-input__option {
|
|
24
|
+
&:focus,
|
|
25
|
+
&:hover,
|
|
26
|
+
&:hover .ons-autosuggest-input__category,
|
|
27
|
+
&--focused,
|
|
28
|
+
&--focused .ons-autosuggest-input__category {
|
|
29
|
+
background: Highlight !important;
|
|
30
|
+
color: HighlightText !important;
|
|
31
|
+
forced-color-adjust: none;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Select - Overrides custom background image icon
|
|
37
|
+
.ons-input--select {
|
|
38
|
+
background: $color-input-bg
|
|
39
|
+
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ons-svg-icon' viewBox='0 0 12 8'%3E%3Cpath fill='%23fff' d='M1.5.3 6 5.4 10.5.3c.2-.2.4-.2.6 0l.7.7c.1.2.1.4 0 .5L6.3 7.7c-.2.2-.4.2-.6 0L.2 1.6C.1 1.4.1 1.2.2 1L.9.3c.2-.1.4-.1.6 0z'/%3E%3C/svg%3E")
|
|
40
|
+
no-repeat center right 10px;
|
|
41
|
+
background-size: 1rem;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// I would have approached the mark differently, but without changing the existing approach this fixes it
|
|
45
|
+
.ons-timeline__item::before {
|
|
46
|
+
border: 2px solid currentColor;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Element icons – matches icon with the link colour
|
|
50
|
+
.ons-collapsible,
|
|
51
|
+
.ons-breadcrumb__item,
|
|
52
|
+
.ons-panel,
|
|
53
|
+
.ons-btn__inner,
|
|
54
|
+
.ons-external-link,
|
|
55
|
+
.ons-list--icons {
|
|
56
|
+
& .ons-svg-icon {
|
|
24
57
|
fill: currentColor !important;
|
|
58
|
+
forced-color-adjust: auto;
|
|
25
59
|
}
|
|
26
60
|
}
|
|
27
61
|
|
|
28
|
-
//
|
|
29
|
-
.ons-
|
|
30
|
-
|
|
62
|
+
// Logos
|
|
63
|
+
.ons-header__org-logo,
|
|
64
|
+
.ons-header__title-logo,
|
|
65
|
+
.ons-footer {
|
|
66
|
+
& .ons-svg-logo {
|
|
67
|
+
fill: currentColor !important;
|
|
68
|
+
forced-color-adjust: auto;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Hero pre title
|
|
73
|
+
.ons-hero__pre-title {
|
|
74
|
+
filter: brightness(0) invert(1);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Buttons - Overrides adjustment to make button shadow selectable
|
|
78
|
+
.ons-btn {
|
|
79
|
+
&::after {
|
|
80
|
+
bottom: 0 !important;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.ons-input,
|
|
85
|
+
.ons-btn .ons-btn__inner,
|
|
86
|
+
.ons-tab--row {
|
|
87
|
+
&:focus,
|
|
88
|
+
&:focus-visible {
|
|
89
|
+
// Focus states – To better match the focus states of native controls
|
|
90
|
+
outline-color: Highlight;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Tabs – prevent tab border colour change
|
|
95
|
+
.ons-tabs__list--row::after {
|
|
96
|
+
bottom: 1px;
|
|
97
|
+
forced-color-adjust: none;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.ons-tab--row[aria-selected='true'] {
|
|
101
|
+
border-color: ButtonText !important;
|
|
102
|
+
color: ButtonText;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Navigation and section nav – item border
|
|
106
|
+
.ons-section-nav:not(.ons-section-nav--vertical) .ons-section-nav__item,
|
|
107
|
+
.ons-navigation__item {
|
|
108
|
+
border-color: canvas;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.ons-section-nav:not(.ons-section-nav--vertical) .ons-section-nav__item--active,
|
|
112
|
+
.ons-navigation__item--active {
|
|
113
|
+
border-color: ButtonText !important;
|
|
114
|
+
color: ButtonText;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Add borders to separate banners with no backgrounds
|
|
118
|
+
.ons-skip-link,
|
|
119
|
+
.ons-browser-banner,
|
|
120
|
+
.ons-cookies-banner,
|
|
121
|
+
.ons-header,
|
|
122
|
+
.ons-header__top,
|
|
123
|
+
.ons-hero,
|
|
124
|
+
.ons-phase-banner {
|
|
125
|
+
border-bottom: 1px solid currentColor;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.ons-footer {
|
|
129
|
+
border-top: 1px solid currentColor;
|
|
130
|
+
}
|
|
31
131
|
|
|
32
|
-
|
|
132
|
+
@include mq(m) {
|
|
133
|
+
.ons-header__main {
|
|
33
134
|
border-bottom: 1px solid currentColor;
|
|
34
135
|
}
|
|
35
136
|
}
|
|
36
137
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
padding-left: 1.5rem;
|
|
40
|
-
text-decoration: underline;
|
|
138
|
+
.ons-navigation--sub {
|
|
139
|
+
border-top: 1px solid currentColor;
|
|
41
140
|
}
|
|
42
141
|
|
|
43
|
-
|
|
44
|
-
|
|
142
|
+
// Search – override focus state background image
|
|
143
|
+
.ons-input-search--icon:focus,
|
|
144
|
+
.ons-input-search--icon:active,
|
|
145
|
+
.ons-input-search--icon:valid:not(:placeholder-shown) {
|
|
146
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='%23ffffff'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath d='M11.86 10.23 8.62 6.99a4.63 4.63 0 1 0-6.34 1.64 4.55 4.55 0 0 0 2.36.64 4.65 4.65 0 0 0 2.33-.65l3.24 3.23a.46.46 0 0 0 .65 0l1-1a.48.48 0 0 0 0-.62Zm-5-3.32a3.28 3.28 0 0 1-2.31.93 3.22 3.22 0 1 1 2.35-.93Z'/%3E%3C/svg%3E");
|
|
147
|
+
}
|
|
45
148
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
content: '';
|
|
52
|
-
height: 12.5px;
|
|
53
|
-
left: 16px;
|
|
54
|
-
position: absolute;
|
|
55
|
-
top: 18.5px;
|
|
56
|
-
width: 12.5px;
|
|
57
|
-
z-index: 1;
|
|
149
|
+
// Pagination – current page state
|
|
150
|
+
.ons-pagination {
|
|
151
|
+
&__item--current &__link {
|
|
152
|
+
color: ButtonText;
|
|
153
|
+
outline-color: ButtonText !important;
|
|
58
154
|
}
|
|
59
155
|
}
|
|
60
156
|
|
|
61
|
-
//
|
|
62
|
-
.ons-
|
|
63
|
-
|
|
64
|
-
|
|
157
|
+
// Radios and Checkboxes – disabled and checked
|
|
158
|
+
.ons-checkbox__input {
|
|
159
|
+
border-color: canvastext;
|
|
160
|
+
|
|
161
|
+
&:disabled {
|
|
162
|
+
border-color: grayText;
|
|
163
|
+
}
|
|
164
|
+
&:disabled:checked::after {
|
|
165
|
+
border-color: grayText;
|
|
166
|
+
}
|
|
167
|
+
&:disabled + .ons-checkbox__label,
|
|
168
|
+
&:disabled:checked + .ons-checkbox__label {
|
|
169
|
+
color: grayText;
|
|
170
|
+
|
|
171
|
+
&::before {
|
|
172
|
+
border-color: grayText;
|
|
173
|
+
outline-color: grayText;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&:checked:not(:disabled):not(:visited),
|
|
178
|
+
&:checked:not(:disabled):not(:visited)::after {
|
|
179
|
+
border-color: Highlight;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
&:checked + .ons-checkbox__label {
|
|
183
|
+
&::before {
|
|
184
|
+
border-color: Highlight;
|
|
185
|
+
outline-color: Highlight;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
65
188
|
}
|
|
66
189
|
|
|
67
|
-
//
|
|
68
|
-
.ons-
|
|
69
|
-
|
|
190
|
+
// Colour swatch – prevent colour adjustment
|
|
191
|
+
.ons-patternlib-swatch__color {
|
|
192
|
+
forced-color-adjust: none;
|
|
70
193
|
}
|
|
71
194
|
|
|
72
|
-
//
|
|
73
|
-
|
|
74
|
-
|
|
195
|
+
// Highlighting
|
|
196
|
+
h1 em,
|
|
197
|
+
.ons-highlight {
|
|
198
|
+
background-color: mark;
|
|
199
|
+
color: marktext;
|
|
75
200
|
}
|
|
76
201
|
|
|
77
|
-
//
|
|
78
|
-
.ons-
|
|
79
|
-
|
|
202
|
+
// Errors
|
|
203
|
+
.ons-panel--error {
|
|
204
|
+
border-color: mark;
|
|
205
|
+
outline-color: mark;
|
|
206
|
+
|
|
207
|
+
& .ons-panel__header {
|
|
208
|
+
border-bottom: 1px solid mark;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.ons-input {
|
|
213
|
+
&--error:not(:focus) {
|
|
214
|
+
border-color: mark;
|
|
215
|
+
outline-color: mark;
|
|
216
|
+
|
|
217
|
+
& + .ons-input-type__type,
|
|
218
|
+
& + .ons-input-type__type[title] {
|
|
219
|
+
border-color: mark;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
& + .ons-input-type__type::after {
|
|
223
|
+
outline-color: mark;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Feedback – Remove speech bubble border because hcm doesn't support transparent borders
|
|
229
|
+
.ons-feedback::before,
|
|
230
|
+
.ons-feedback::after {
|
|
231
|
+
content: none;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// Message – indicate sent vs received
|
|
235
|
+
.ons-message {
|
|
236
|
+
&--sent {
|
|
237
|
+
outline-color: mark;
|
|
238
|
+
}
|
|
80
239
|
}
|
|
81
240
|
}
|
package/scss/patternlib.scss
CHANGED
|
@@ -154,6 +154,7 @@
|
|
|
154
154
|
font-weight: 700;
|
|
155
155
|
letter-spacing: 0.1rem;
|
|
156
156
|
margin-right: 0.5rem;
|
|
157
|
+
outline: 2px solid transparent; // Add transparent outline because Windows High Contrast Mode doesn't show background
|
|
157
158
|
padding: 0.3rem 0.5rem;
|
|
158
159
|
text-transform: uppercase;
|
|
159
160
|
}
|