vanilla-framework 4.7.0 → 4.9.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 (46) hide show
  1. package/package.json +8 -8
  2. package/scss/_base.scss +2 -0
  3. package/scss/_base_background.scss +2 -6
  4. package/scss/_base_button.scss +8 -8
  5. package/scss/_base_code.scss +5 -5
  6. package/scss/_base_forms.scss +22 -103
  7. package/scss/_base_grid-definitions.scss +4 -4
  8. package/scss/_base_hr.scss +5 -39
  9. package/scss/_base_icon-definitions.scss +361 -54
  10. package/scss/_base_links.scss +2 -10
  11. package/scss/_base_placeholders.scss +1 -1
  12. package/scss/_base_syntax-highlighting.scss +2 -2
  13. package/scss/_base_tables.scss +2 -2
  14. package/scss/_base_themes.scss +52 -0
  15. package/scss/_base_typography-definitions.scss +1 -1
  16. package/scss/_global_functions.scss +10 -0
  17. package/scss/_layouts_application-panels.scss +1 -1
  18. package/scss/_patterns_buttons.scss +35 -167
  19. package/scss/_patterns_chip.scss +156 -189
  20. package/scss/_patterns_code-snippet.scss +7 -8
  21. package/scss/_patterns_contextual-menu.scss +16 -75
  22. package/scss/_patterns_divider.scss +5 -35
  23. package/scss/_patterns_form-help-text.scss +1 -29
  24. package/scss/_patterns_form-password-toggle.scss +1 -1
  25. package/scss/_patterns_form-tick-elements.scss +9 -128
  26. package/scss/_patterns_form-validation.scss +31 -229
  27. package/scss/_patterns_icons.scss +623 -442
  28. package/scss/_patterns_links.scss +12 -9
  29. package/scss/_patterns_lists.scss +23 -40
  30. package/scss/_patterns_media-container.scss +5 -0
  31. package/scss/_patterns_notifications.scss +21 -12
  32. package/scss/_patterns_search-box.scss +20 -99
  33. package/scss/_patterns_section.scss +12 -1
  34. package/scss/_patterns_side-navigation-expandable.scss +18 -55
  35. package/scss/_patterns_side-navigation.scss +132 -317
  36. package/scss/_patterns_strip.scss +41 -13
  37. package/scss/_patterns_suru.scss +126 -10
  38. package/scss/_patterns_table-mobile-card.scss +1 -1
  39. package/scss/_patterns_table-sortable.scss +2 -2
  40. package/scss/_patterns_tabs.scss +23 -74
  41. package/scss/_settings_colors.scss +195 -2
  42. package/scss/_settings_themes.scss +6 -6
  43. package/scss/_utilities_baseline-grid.scss +8 -0
  44. package/scss/_utilities_layout.scss +0 -6
  45. package/scss/_utilities_theme-toggle.scss +39 -0
  46. package/scss/_vanilla.scss +4 -0
@@ -10,7 +10,7 @@
10
10
  %vf-link-base {
11
11
  @include vf-focus;
12
12
 
13
- color: $color-link;
13
+ color: $colors--theme--link-default;
14
14
  text-decoration: none;
15
15
 
16
16
  &:focus {
@@ -25,15 +25,7 @@
25
25
  }
26
26
 
27
27
  &:visited {
28
- color: $color-link-visited;
29
- }
30
-
31
- &.is-dark {
32
- color: $color-link-dark;
33
-
34
- &:visited {
35
- color: $color-link-visited-dark;
36
- }
28
+ color: $colors--theme--link-visited;
37
29
  }
38
30
  }
39
31
  // stylelint-enable selector-max-type
@@ -64,7 +64,7 @@
64
64
 
65
65
  // Bars and borders
66
66
  %vf-pseudo-border {
67
- background-color: $color-mid-light;
67
+ background-color: $colors--theme--border-default;
68
68
  content: '';
69
69
  height: 1px;
70
70
  left: 0;
@@ -13,11 +13,11 @@
13
13
  &.prolog,
14
14
  &.doctype,
15
15
  &.cdata {
16
- color: $colors--light-theme--text-muted;
16
+ color: $colors--theme--text-muted;
17
17
  }
18
18
 
19
19
  &.punctuation {
20
- color: $colors--light-theme--text-default;
20
+ color: $colors--theme--text-default;
21
21
  }
22
22
 
23
23
  &.namespace {
@@ -45,7 +45,7 @@
45
45
  }
46
46
 
47
47
  tr {
48
- border-bottom: 1px solid $colors--light-theme--border-default;
48
+ border-bottom: 1px solid $colors--theme--border-default;
49
49
  vertical-align: top;
50
50
  }
51
51
  }
@@ -71,6 +71,6 @@
71
71
  // stylelint-enable selector-max-type
72
72
 
73
73
  %table-row-border {
74
- border-top: 1px solid $colors--light-theme--border-low-contrast;
74
+ border-top: 1px solid $colors--theme--border-low-contrast;
75
75
  }
76
76
  }
@@ -0,0 +1,52 @@
1
+ @import 'settings';
2
+
3
+ @mixin vf-theme-light {
4
+ --vf-theme-light: var(--vf-FLAG-ON);
5
+ --vf-theme-dark: var(--vf-FLAG-OFF);
6
+ @include vf-theme-light--colors;
7
+ }
8
+
9
+ @mixin vf-theme-dark {
10
+ --vf-theme-light: var(--vf-FLAG-OFF);
11
+ --vf-theme-dark: var(--vf-FLAG-ON);
12
+ @include vf-theme-dark--colors;
13
+ }
14
+
15
+ @mixin vf-theme-paper {
16
+ // we treat the paper theme as a light theme
17
+ --vf-theme-light: var(--vf-FLAG-ON);
18
+ --vf-theme-dark: var(--vf-FLAG-OFF);
19
+ @include vf-theme-paper--colors;
20
+ }
21
+
22
+ // Color themes
23
+ @mixin vf-b-themes {
24
+ @at-root {
25
+ :root {
26
+ // based on:
27
+ // https://lea.verou.me/blog/2020/10/the-var-space-hack-to-toggle-multiple-values-with-one-custom-property/
28
+ --vf-FLAG-ON: initial;
29
+ --vf-FLAG-OFF: ;
30
+ }
31
+
32
+ :root,
33
+ .is-light {
34
+ @include vf-theme-light;
35
+ }
36
+
37
+ .is-dark {
38
+ @include vf-theme-dark;
39
+ }
40
+
41
+ .is-paper {
42
+ @include vf-theme-paper;
43
+ }
44
+ }
45
+ }
46
+
47
+ // based on:
48
+ // https://lea.verou.me/blog/2020/10/the-var-space-hack-to-toggle-multiple-values-with-one-custom-property/
49
+ // https://lea.verou.me/blog/2021/10/custom-properties-with-defaults/
50
+ @mixin vf-themed-property($property, $light-value, $dark-value) {
51
+ #{$property}: var(--vf-theme-light, #{$light-value}) var(--vf-theme-dark, #{$dark-value});
52
+ }
@@ -200,7 +200,7 @@
200
200
  }
201
201
 
202
202
  %muted-text {
203
- color: $colors--light-theme--text-muted;
203
+ color: $colors--theme--text-muted;
204
204
  }
205
205
 
206
206
  %small-caps-text {
@@ -50,6 +50,16 @@
50
50
  }
51
51
  }
52
52
 
53
+ // Includes the theme variables based on the background color passed as an argument.
54
+ // This is currently only used in the deprecated p-strip--accent.
55
+ @mixin vf-determine-theme-from-background($background-color) {
56
+ @if (lightness($background-color) > 50) {
57
+ @include vf-theme-light;
58
+ } @else {
59
+ @include vf-theme-dark;
60
+ }
61
+ }
62
+
53
63
  // Adds visual focus to elements on :focus-visible,
54
64
  // or :focus if the browser doesn't support the former
55
65
  @mixin vf-focus($color: $color-focus, $width: $bar-thickness, $has-validation: false) {
@@ -21,7 +21,7 @@
21
21
  background: $colors--light-theme--background-default;
22
22
  position: sticky;
23
23
  top: 0;
24
- z-index: 1;
24
+ z-index: 5;
25
25
 
26
26
  .p-panel.is-dark & {
27
27
  background: $colors--dark-theme--background-default;
@@ -16,44 +16,13 @@ $hover-background-opacity-percentage: $hover-background-opacity-amount * 100%;
16
16
  }
17
17
 
18
18
  @mixin vf-button-plain {
19
- %p-button-light {
20
- @include vf-button-pattern();
21
- }
22
-
23
- %p-button-dark {
24
- @include vf-button-pattern(
25
- $button-background-color: $colors--dark-theme--background-default,
26
- $button-text-color: $colors--dark-theme--text-default,
27
- $button-disabled-background-color: $color-transparent,
28
- $button-disabled-border-color: $colors--dark-theme--border-high-contrast,
29
- $button-border-color: $colors--dark-theme--border-high-contrast,
30
- $button-hover-background-color: $colors--dark-theme--background-hover,
31
- $button-hover-border-color: $colors--dark-theme--border-high-contrast,
32
- $button-active-background-color: $colors--dark-theme--background-active,
33
- $button-active-border-color: $colors--dark-theme--border-high-contrast
34
- );
35
- }
36
-
37
19
  .p-button {
38
20
  @extend %vf-button-base;
39
-
40
- // Theming
41
- @if ($theme-default-p-button == 'dark') {
42
- @extend %p-button-dark;
43
-
44
- &.is-light {
45
- @extend %p-button-light;
46
- }
47
- } @else {
48
- @extend %p-button-light;
49
-
50
- &.is-dark {
51
- @extend %p-button-dark;
52
- }
53
- }
21
+ @include vf-button-pattern;
54
22
  }
55
23
  }
56
24
 
25
+ // DEPRECATED: brand coloured button is deprecated, please use other type of button instead
57
26
  @mixin vf-button-brand {
58
27
  %p-button--brand-light {
59
28
  @include vf-button-pattern(
@@ -106,158 +75,57 @@ $hover-background-opacity-percentage: $hover-background-opacity-amount * 100%;
106
75
  }
107
76
 
108
77
  @mixin vf-button-positive {
109
- %p-button--positive-light {
110
- @include vf-button-pattern(
111
- $button-background-color: $color-positive,
112
- $button-hover-background-color: adjust-color($color-positive, $lightness: -$hover-background-opacity-percentage),
113
- $button-active-background-color: adjust-color($color-positive, $lightness: -$active-background-opacity-percentage),
114
- $button-disabled-background-color: $color-positive,
115
- $button-border-color: $color-positive,
116
- $button-hover-border-color: adjust-color($color-positive, $lightness: -$hover-background-opacity-percentage),
117
- $button-active-border-color: adjust-color($color-positive, $lightness: -$active-background-opacity-percentage),
118
- $button-disabled-border-color: $color-positive,
119
- $button-text-color: vf-contrast-text-color($color-positive)
120
- );
121
-
122
- @include vf-focus($color-focus-positive);
123
- }
124
-
125
- %p-button--positive-dark {
126
- @include vf-button-pattern(
127
- $button-background-color: $color-positive-dark,
128
- $button-hover-background-color: adjust-color($color-positive-dark, $lightness: -$hover-background-opacity-percentage),
129
- $button-active-background-color: adjust-color($color-positive-dark, $lightness: -$active-background-opacity-percentage),
130
- $button-disabled-background-color: $color-positive-dark,
131
- $button-border-color: $color-positive-dark,
132
- $button-hover-border-color: adjust-color($color-positive-dark, $lightness: -$hover-background-opacity-percentage),
133
- $button-active-border-color: adjust-color($color-positive-dark, $lightness: -$active-background-opacity-percentage),
134
- $button-disabled-border-color: $color-positive-dark,
135
- $button-text-color: vf-contrast-text-color($color-positive-dark)
136
- );
137
-
138
- @include vf-focus($color-focus-positive);
139
- }
140
-
141
78
  .p-button--positive {
142
79
  @extend %vf-button-base;
143
-
144
- // Theming
145
- @if ($theme-default-p-button == 'dark') {
146
- @extend %p-button--positive-dark;
147
-
148
- &.is-light {
149
- @extend %p-button--positive-light;
150
- }
151
- } @else {
152
- @extend %p-button--positive-light;
153
-
154
- &.is-dark {
155
- @extend %p-button--positive-dark;
156
- }
157
- }
158
-
159
80
  @extend %vf-button-white-success-icon;
160
- }
161
- }
162
81
 
163
- @mixin vf-button-negative {
164
- %p-button--negative-light {
165
82
  @include vf-button-pattern(
166
- $button-background-color: $color-negative,
167
- $button-hover-background-color: adjust-color($color-negative, $lightness: -$hover-background-opacity-percentage),
168
- $button-active-background-color: adjust-color($color-negative, $lightness: -$active-background-opacity-percentage),
169
- $button-disabled-background-color: $color-negative,
170
- $button-border-color: $color-negative,
171
- $button-hover-border-color: adjust-color($color-negative, $lightness: -$hover-background-opacity-percentage),
172
- $button-active-border-color: adjust-color($color-negative, $lightness: -$active-background-opacity-percentage),
173
- $button-disabled-border-color: $color-negative,
174
- $button-text-color: vf-contrast-text-color($color-negative)
83
+ $button-background-color: $colors--theme--button-positive-default,
84
+ $button-hover-background-color: $colors--theme--button-positive-hover,
85
+ $button-active-background-color: $colors--theme--button-positive-active,
86
+ $button-disabled-background-color: $colors--theme--button-positive-default,
87
+ $button-border-color: $colors--theme--button-positive-default,
88
+ $button-hover-border-color: $colors--theme--button-positive-hover,
89
+ $button-active-border-color: $colors--theme--button-positive-active,
90
+ $button-disabled-border-color: $colors--theme--button-positive-default,
91
+ $button-text-color: $colors--theme--button-positive-text
175
92
  );
176
-
177
- @include vf-focus($color-focus-negative);
178
- }
179
-
180
- %p-button--negative-dark {
181
- @include vf-button-pattern(
182
- $button-background-color: $color-negative-dark,
183
- $button-hover-background-color: adjust-color($color-negative-dark, $lightness: -$hover-background-opacity-percentage),
184
- $button-active-background-color: adjust-color($color-negative-dark, $lightness: -$active-background-opacity-percentage),
185
- $button-disabled-background-color: $color-negative-dark,
186
- $button-border-color: $color-negative-dark,
187
- $button-hover-border-color: adjust-color($color-negative-dark, $lightness: -$hover-background-opacity-percentage),
188
- $button-active-border-color: adjust-color($color-negative-dark, $lightness: -$active-background-opacity-percentage),
189
- $button-disabled-border-color: $color-negative-dark,
190
- $button-text-color: vf-contrast-text-color($color-negative-dark)
191
- );
192
-
193
- @include vf-focus($color-focus-negative);
93
+ @include vf-focus($color-focus-positive);
194
94
  }
95
+ }
195
96
 
97
+ @mixin vf-button-negative {
196
98
  .p-button--negative {
197
99
  @extend %vf-button-base;
198
-
199
- // Theming
200
- @if ($theme-default-p-button == 'dark') {
201
- @extend %p-button--negative-dark;
202
-
203
- &.is-light {
204
- @extend %p-button--negative-light;
205
- }
206
- } @else {
207
- @extend %p-button--negative-light;
208
-
209
- &.is-dark {
210
- @extend %p-button--negative-dark;
211
- }
212
- }
213
-
214
100
  @extend %vf-button-white-success-icon;
215
- }
216
- }
217
101
 
218
- @mixin vf-button-base {
219
- %p-button--base-light {
220
102
  @include vf-button-pattern(
221
- $button-background-color: $color-transparent,
222
- $button-border-color: $color-transparent,
223
- $button-hover-border-color: $color-transparent,
224
- $button-active-border-color: $color-transparent,
225
- $button-disabled-border-color: $color-transparent
103
+ $button-background-color: $colors--theme--button-negative-default,
104
+ $button-hover-background-color: $colors--theme--button-negative-hover,
105
+ $button-active-background-color: $colors--theme--button-negative-active,
106
+ $button-disabled-background-color: $colors--theme--button-negative-default,
107
+ $button-border-color: $colors--theme--button-negative-default,
108
+ $button-hover-border-color: $colors--theme--button-negative-hover,
109
+ $button-active-border-color: $colors--theme--button-negative-active,
110
+ $button-disabled-border-color: $colors--theme--button-negative-default,
111
+ $button-text-color: $colors--theme--button-negative-text
226
112
  );
227
113
  }
114
+ }
115
+
116
+ @mixin vf-button-base {
117
+ .p-button--base {
118
+ @extend %vf-button-base;
228
119
 
229
- %p-button--base-dark {
120
+ // override default button styles with transparent background and border
230
121
  @include vf-button-pattern(
231
122
  $button-background-color: $color-transparent,
232
- $button-text-color: $colors--dark-theme--text-default,
233
- $button-disabled-background-color: $color-transparent,
234
- $button-hover-background-color: $colors--dark-theme--background-hover,
235
- $button-active-background-color: $colors--dark-theme--background-active,
236
123
  $button-border-color: $color-transparent,
237
124
  $button-hover-border-color: $color-transparent,
238
125
  $button-active-border-color: $color-transparent,
239
126
  $button-disabled-border-color: $color-transparent
240
127
  );
241
128
  }
242
-
243
- .p-button--base {
244
- @extend %vf-button-base;
245
-
246
- // Theming
247
- @if ($theme-default-p-button == 'dark') {
248
- @extend %p-button--base-dark;
249
-
250
- &.is-light {
251
- @extend %p-button--base-light;
252
- }
253
- } @else {
254
- @extend %p-button--base-light;
255
-
256
- &.is-dark {
257
- @extend %p-button--base-dark;
258
- }
259
- }
260
- }
261
129
  }
262
130
 
263
131
  @mixin vf-button-link {
@@ -272,6 +140,12 @@ $hover-background-opacity-percentage: $hover-background-opacity-amount * 100%;
272
140
  padding-left: 0;
273
141
  padding-right: 0;
274
142
 
143
+ // stylelint-disable-next-line selector-max-type -- buttons should not affect paragraph spacing
144
+ p & {
145
+ margin-bottom: 0;
146
+ padding-top: 0;
147
+ }
148
+
275
149
  &:hover {
276
150
  background: transparent;
277
151
  }
@@ -279,12 +153,6 @@ $hover-background-opacity-percentage: $hover-background-opacity-amount * 100%;
279
153
  &.u-no-margin--bottom {
280
154
  @extend %u-no-margin--bottom--default-text;
281
155
  }
282
-
283
- // stylelint-disable-next-line selector-max-type -- buttons should not affect paragraph spacing
284
- p & {
285
- margin-bottom: 0;
286
- padding-top: 0;
287
- }
288
156
  }
289
157
  }
290
158