vanilla-framework 4.6.0 → 4.8.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 (37) hide show
  1. package/package.json +12 -13
  2. package/scss/_base.scss +2 -0
  3. package/scss/_base_background.scss +2 -6
  4. package/scss/_base_forms.scss +23 -104
  5. package/scss/_base_hr.scss +5 -39
  6. package/scss/_base_icon-definitions.scss +335 -46
  7. package/scss/_base_links.scss +2 -10
  8. package/scss/_base_placeholders.scss +1 -1
  9. package/scss/_base_tables.scss +2 -2
  10. package/scss/_base_themes.scss +52 -0
  11. package/scss/_base_typography-definitions.scss +1 -1
  12. package/scss/_global_functions.scss +10 -0
  13. package/scss/_layouts_application-panels.scss +1 -1
  14. package/scss/_patterns_chip.scss +156 -189
  15. package/scss/_patterns_contextual-menu.scss +16 -75
  16. package/scss/_patterns_divider.scss +5 -35
  17. package/scss/_patterns_form-help-text.scss +1 -29
  18. package/scss/_patterns_form-password-toggle.scss +1 -1
  19. package/scss/_patterns_form-tick-elements.scss +12 -129
  20. package/scss/_patterns_form-validation.scss +31 -229
  21. package/scss/_patterns_icons.scss +623 -442
  22. package/scss/_patterns_links.scss +12 -9
  23. package/scss/_patterns_lists.scss +0 -31
  24. package/scss/_patterns_navigation.scss +66 -13
  25. package/scss/_patterns_notifications.scss +21 -12
  26. package/scss/_patterns_search-box.scss +20 -99
  27. package/scss/_patterns_section.scss +12 -1
  28. package/scss/_patterns_side-navigation-expandable.scss +18 -55
  29. package/scss/_patterns_side-navigation.scss +117 -317
  30. package/scss/_patterns_strip.scss +87 -21
  31. package/scss/_patterns_suru.scss +126 -10
  32. package/scss/_patterns_table-mobile-card.scss +1 -1
  33. package/scss/_patterns_table-sortable.scss +2 -2
  34. package/scss/_patterns_tabs.scss +23 -74
  35. package/scss/_settings_colors.scss +164 -2
  36. package/scss/_settings_placeholders.scss +4 -1
  37. package/scss/_settings_themes.scss +6 -6
@@ -20,59 +20,84 @@
20
20
  }
21
21
 
22
22
  @mixin vf-p-strip-default {
23
+ // default strip is theme-agnostic, it doesn't change the theme
24
+ // unless the theme class is specifically applied to it,
25
+ // in which case it will set the background and text colours
23
26
  .p-strip {
24
27
  @extend %vf-strip;
25
28
 
26
29
  background-color: transparent;
30
+
31
+ // themed versions of the strip should set the background and text colours
32
+ &.is-light,
33
+ &.is-paper,
34
+ &.is-dark {
35
+ background-color: $colors--theme--background-default;
36
+ color: $colors--theme--text-default;
37
+ }
38
+ }
39
+
40
+ // highligted version if the strip is using the alternative background colour
41
+ // this is the recommended replacement for the deprecated .p-strip--white,
42
+ // .p-strip--light and .p-strip--accent
43
+ .p-strip--highlighted {
44
+ @extend %vf-strip;
45
+
46
+ background-color: $colors--theme--background-alt;
47
+ color: $colors--theme--text-default;
27
48
  }
28
49
 
50
+ // DEPRECATED: use any other available p-strip instead
29
51
  .p-strip--light {
30
52
  @extend %vf-strip;
53
+ @include vf-theme-light;
31
54
 
32
- background-color: $color-light;
55
+ background-color: $colors--theme--background-alt;
56
+ color: $colors--theme--text-default;
33
57
  }
34
58
 
59
+ // DEPRECATED: use .p-strip .is-dark instead
35
60
  .p-strip--dark {
36
61
  @extend %vf-strip;
62
+ @include vf-theme-dark;
37
63
 
38
- background-color: $colors--dark-theme--background-default;
39
- color: $colors--dark-theme--text-default;
64
+ background-color: $colors--theme--background-default;
65
+ color: $colors--theme--text-default;
40
66
  }
41
67
 
68
+ // DEPRECATED: use .p-strip--highlighted instead
42
69
  .p-strip--white {
43
70
  @extend %vf-strip;
71
+ @include vf-theme-light;
44
72
 
45
73
  background-color: $color-x-light;
46
- color: $colors--light-theme--text-default;
74
+ color: $colors--theme--text-default;
47
75
  }
48
76
  }
49
77
 
78
+ // DEPRECATED: use other available strip variants instead
50
79
  @mixin vf-p-strip-accent {
51
80
  .p-strip--accent {
52
81
  @extend %vf-strip;
82
+ @include vf-determine-theme-from-background($color-accent-background);
53
83
 
54
84
  background-color: $color-accent-background;
55
- color: vf-determine-text-color($color-accent-background);
85
+ color: $colors--theme--text-default;
56
86
  }
57
87
  }
58
88
 
89
+ // DEPRECATED: use other available strip variants or suru component instead
59
90
  @mixin vf-p-strip-image {
60
91
  .p-strip--image {
61
92
  @extend %vf-strip;
62
93
 
63
94
  background-repeat: no-repeat;
64
95
  background-size: cover;
65
-
66
- &.is-light {
67
- color: $colors--light-theme--text-default;
68
- }
69
-
70
- &.is-dark {
71
- color: $color-x-light;
72
- }
96
+ color: $colors--theme--text-default;
73
97
  }
74
98
  }
75
99
 
100
+ // DEPRECATED: use other available strip variants instead
76
101
  @mixin vf-p-strip-bordered {
77
102
  [class*='p-strip'].is-bordered {
78
103
  @extend %vf-pseudo-border--bottom;
@@ -91,6 +116,7 @@
91
116
  }
92
117
  }
93
118
 
119
+ // DEPRECATED:
94
120
  // gradient of the main suru slant
95
121
  $color-suru-start: lighten($color-brand, 10%) !default;
96
122
  $color-suru-middle: $color-brand !default;
@@ -107,6 +133,7 @@ $color-suru-slant-left: rgba(205, 205, 205, 0.55) !default;
107
133
  $color-suru-slant-right-fallback: rgba(205, 205, 205, 0.14) !default;
108
134
  $color-suru-slant-left-fallback: rgba(205, 205, 205, 0.14) !default;
109
135
 
136
+ // DEPRECATED: use new .p-suru components instead
110
137
  @mixin vf-p-strip-suru {
111
138
  .p-strip--suru {
112
139
  @extend %vf-strip;
@@ -116,9 +143,19 @@ $color-suru-slant-left-fallback: rgba(205, 205, 205, 0.14) !default;
116
143
  linear-gradient(to top right, #fff 0%, #fff 49%, transparent 50%, transparent 100%), linear-gradient(to top right, #fff 0%, #fff 100%),
117
144
  linear-gradient(111deg, $color-suru-start 10%, $color-suru-middle 37%, $color-suru-end 100%);
118
145
 
119
- background-position: 0% 0%, top right, right 0 bottom 4rem, right bottom, 0% 0%;
146
+ background-position:
147
+ 0% 0%,
148
+ top right,
149
+ right 0 bottom 4rem,
150
+ right bottom,
151
+ 0% 0%;
120
152
  background-repeat: no-repeat;
121
- background-size: 100% calc(100% - 4rem), 50% 100%, 100% 4rem, 100% 4rem, auto;
153
+ background-size:
154
+ 100% calc(100% - 4rem),
155
+ 50% 100%,
156
+ 100% 4rem,
157
+ 100% 4rem,
158
+ auto;
122
159
  color: $color-x-light;
123
160
  margin-bottom: -4rem;
124
161
  overflow: hidden;
@@ -136,16 +173,36 @@ $color-suru-slant-left-fallback: rgba(205, 205, 205, 0.14) !default;
136
173
  &.is-deep {
137
174
  $padding: 3rem;
138
175
 
139
- background-position: 0% 0%, top right, right 0 bottom $padding, right bottom, 0% 0%;
140
- background-size: 100% calc(100% - $padding), 100% 100%, 100% $padding, 100% $padding, auto;
176
+ background-position:
177
+ 0% 0%,
178
+ top right,
179
+ right 0 bottom $padding,
180
+ right bottom,
181
+ 0% 0%;
182
+ background-size:
183
+ 100% calc(100% - $padding),
184
+ 100% 100%,
185
+ 100% $padding,
186
+ 100% $padding,
187
+ auto;
141
188
  margin-bottom: -$padding;
142
189
  padding-bottom: ($padding * 3) !important;
143
190
 
144
191
  @media (min-width: $threshold-6-12-col) {
145
192
  $padding: 6rem;
146
193
 
147
- background-position: 0% 0%, top right, right 0 bottom $padding, right bottom, 0% 0%;
148
- background-size: 100% calc(100% - $padding), 50% 100%, 100% $padding, 100% $padding, auto;
194
+ background-position:
195
+ 0% 0%,
196
+ top right,
197
+ right 0 bottom $padding,
198
+ right bottom,
199
+ 0% 0%;
200
+ background-size:
201
+ 100% calc(100% - $padding),
202
+ 50% 100%,
203
+ 100% $padding,
204
+ 100% $padding,
205
+ auto;
149
206
  margin-bottom: -$padding;
150
207
  padding-bottom: ($padding * 3) !important;
151
208
  }
@@ -158,6 +215,7 @@ $color-suru-slant-left-fallback: rgba(205, 205, 205, 0.14) !default;
158
215
  }
159
216
  }
160
217
 
218
+ // DEPRECATED: use new .p-suru components instead
161
219
  @mixin vf-p-strip-suru-topped {
162
220
  .p-strip--suru-topped {
163
221
  @extend %vf-strip;
@@ -167,9 +225,17 @@ $color-suru-slant-left-fallback: rgba(205, 205, 205, 0.14) !default;
167
225
  linear-gradient(to bottom right, transparent 0%, transparent 49%, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 1) 100%),
168
226
  linear-gradient(90deg, $color-suru-start 4%, $color-suru-middle 50%, $color-suru-end 88%);
169
227
 
170
- background-position: top right, top right, top left, top left;
228
+ background-position:
229
+ top right,
230
+ top right,
231
+ top left,
232
+ top left;
171
233
  background-repeat: no-repeat;
172
- background-size: 39.4% 6rem, 54% 4rem, 63% 4rem, 62.6% 4rem;
234
+ background-size:
235
+ 39.4% 6rem,
236
+ 54% 4rem,
237
+ 63% 4rem,
238
+ 62.6% 4rem;
173
239
  padding-bottom: 4rem;
174
240
  padding-top: 6rem;
175
241
 
@@ -1,16 +1,132 @@
1
1
  @import 'settings';
2
2
 
3
3
  @mixin vf-p-suru {
4
- .p-suru {
5
- aspect-ratio: calc(2216 / 428); // aspect ratio calculated from image dimensions
6
- background-image: url('#{$assets-path}7f34ade9-website_suru_25.jpg');
7
- background-size: contain;
8
- margin: 0 auto;
9
- max-width: $grid-max-width;
10
-
11
- &.is-dark {
12
- aspect-ratio: calc(2580 / 501); // aspect ratio calculated from image dimensions
13
- background-image: url('#{$assets-path}9469ef82-1_website_suru_DARK_25%20(1)122.jpg');
4
+ $vf-suru-min-height: 24rem;
5
+
6
+ // add suru backgrounds to the themes
7
+ @at-root {
8
+ :root,
9
+ .is-light,
10
+ .is-paper {
11
+ // new suru backgrounds don't have while (light) version,
12
+ // they need paper background
13
+ --vf-suru-background: #{$color-paper};
14
+ --vf-suru-25-75: url('#{$assets-path}505636a6-0000_suru-main-25x75-light.png');
15
+ --vf-suru-50-50: url('#{$assets-path}e66e280b-0001_suru-main-50x50-light.png');
16
+ --vf-suru-fan-top-right: url('#{$assets-path}ed94a429-0000_suru-corner-fan--top-right-light.jpg');
17
+ --vf-suru-fan-bottom-right: url('#{$assets-path}2adade55-suru-corner-fan--bottom-0000_light.jpg');
18
+ --vf-suru-pyramid-top-left: url('#{$assets-path}8846d6a5-suru-pyramid-top-corner_0000_light.jpg');
19
+ --vf-suru-pyramid-top-right: url('#{$assets-path}5d9f8cd3-suru-pyramid-top-right-corner_0000_light.jpg');
20
+ }
21
+
22
+ .is-dark {
23
+ --vf-suru-background: #{$colors--theme--background-default};
24
+ --vf-suru-25-75: url('#{$assets-path}7ccd4f39-0003_suru-main-25x75-dark.png');
25
+ --vf-suru-50-50: url('#{$assets-path}70c2bbcd-0002_suru-main-50x50-dark.png');
26
+ --vf-suru-fan-top-right: url('#{$assets-path}fd6ef995-0001_suru-corner-fan--top-right-dark.jpg');
27
+ --vf-suru-fan-bottom-right: url('#{$assets-path}725af649-suru-corner-fan--bottom-0001_dark.jpg');
28
+ --vf-suru-pyramid-top-left: url('#{$assets-path}86ed5771-suru-pyramid-top-corner_0001_dark.jpg');
29
+ --vf-suru-pyramid-top-right: url('#{$assets-path}9f740811-suru-pyramid-top-right-corner_0001_dark.jpg');
30
+ }
31
+ }
32
+
33
+ .p-suru,
34
+ .p-suru--25-75,
35
+ .p-suru--50-50 {
36
+ background-color: var(--vf-suru-background);
37
+ color: $colors--theme--text-default;
38
+
39
+ // padding top based on p-section--hero
40
+ // bottom padding not needed (as it's covered by the suru background image)
41
+ padding-top: $spv--large;
42
+
43
+ // on large screens, same as %section-padding--shallow
44
+ @media (min-width: $breakpoint-large) {
45
+ padding-top: $spv--x-large;
46
+ }
47
+
48
+ // for backwards compatibility with p-suru used as a standalone component
49
+ // we remove top padding if there are no children
50
+ // for this to work there can't be any whitespace in the suru element
51
+ // <div class="p-suru"></div>
52
+ &:-moz-only-whitespace,
53
+ &:empty {
54
+ padding-top: 0;
55
+ }
56
+
57
+ &::after {
58
+ aspect-ratio: calc(2600 / 471); // aspect ratio calculated from image dimensions
59
+ background-image: var(--vf-suru-25-75);
60
+ background-size: contain;
61
+ content: '';
62
+ display: block;
63
+ margin: 0 auto;
64
+ max-width: $grid-max-width;
65
+ }
66
+
67
+ &.p-suru--50-50::after {
68
+ // aspect ratio of 50/50 background is the same, so no need to override
69
+ background-image: var(--vf-suru-50-50);
70
+ }
71
+ }
72
+
73
+ .p-suru--fan-top,
74
+ .p-suru--fan-bottom,
75
+ .p-suru--pyramid-left,
76
+ .p-suru--pyramid-right {
77
+ background-color: var(--vf-suru-background);
78
+ color: $colors--theme--text-default;
79
+
80
+ // same as %section-padding--default
81
+ padding-bottom: $spv--strip-regular * 0.5;
82
+
83
+ @media (min-width: $breakpoint-large) {
84
+ padding-bottom: $spv--strip-regular;
85
+ }
86
+
87
+ // padding top based on p-section--hero
88
+ // bottom padding not needed (as it's covered by the suru background image)
89
+ padding-top: $spv--large;
90
+
91
+ // on large screens, same as %section-padding--shallow
92
+ @media (min-width: $breakpoint-large) {
93
+ padding-top: $spv--x-large;
94
+ }
95
+ }
96
+
97
+ // only apply suru background images on large screens
98
+ @media (min-width: $breakpoint-large) {
99
+ .p-suru--fan-top,
100
+ .p-suru--fan-bottom,
101
+ .p-suru--pyramid-left,
102
+ .p-suru--pyramid-right {
103
+ min-height: $vf-suru-min-height;
104
+ }
105
+
106
+ .p-suru--fan-top,
107
+ .p-suru--fan-bottom {
108
+ background-image: var(--vf-suru-fan-top-right);
109
+ background-position: top right;
110
+ background-repeat: no-repeat;
111
+ background-size: 512px 385.5px; // based on image dimensions (2048x1542) scaled down by 0.25
112
+ }
113
+
114
+ .p-suru--fan-bottom {
115
+ background-image: var(--vf-suru-fan-bottom-right);
116
+ background-position: bottom right;
117
+ }
118
+
119
+ .p-suru--pyramid-right,
120
+ .p-suru--pyramid-left {
121
+ background-image: var(--vf-suru-pyramid-top-left);
122
+ background-position: top left;
123
+ background-repeat: no-repeat;
124
+ background-size: 354px 258.75px; // based on image dimensions (1380x1035) scaled down by 0.25
125
+ }
126
+
127
+ .p-suru--pyramid-right {
128
+ background-image: var(--vf-suru-pyramid-top-right);
129
+ background-position: top right;
14
130
  }
15
131
  }
16
132
  }
@@ -64,7 +64,7 @@
64
64
  }
65
65
 
66
66
  &:not(:first-child)::after {
67
- background-color: $color-mid-light;
67
+ background-color: $colors--theme--border-low-contrast;
68
68
  content: '';
69
69
  height: 1px;
70
70
  left: 0;
@@ -3,7 +3,7 @@
3
3
  @mixin vf-p-table-sortable {
4
4
  %heading-icon {
5
5
  $vertical-offset: 0.5px;
6
- @include vf-icon-chevron;
6
+ @include vf-icon-chevron-themed;
7
7
  @include vf-icon-size(map-get($icon-sizes, default));
8
8
 
9
9
  background: {
@@ -39,7 +39,7 @@
39
39
  }
40
40
 
41
41
  &[aria-sort]:hover {
42
- color: $color-link;
42
+ color: $colors--theme--link-default;
43
43
  text-decoration: underline;
44
44
  }
45
45
  }
@@ -17,6 +17,9 @@
17
17
  position: relative;
18
18
  white-space: nowrap;
19
19
  width: 100%;
20
+ &::after {
21
+ background-color: $colors--theme--border-default;
22
+ }
20
23
  }
21
24
 
22
25
  &__item {
@@ -38,9 +41,10 @@
38
41
  $button-disabled-border-color: $color-transparent
39
42
  );
40
43
  @include vf-highlight-bar(transparent, bottom, false);
41
-
42
44
  align-items: center;
45
+ background-color: transparent;
43
46
  border: none;
47
+ color: $colors--theme--text-default;
44
48
  display: flex;
45
49
  gap: $sph--small;
46
50
  height: 100%;
@@ -66,59 +70,19 @@
66
70
  }
67
71
  }
68
72
 
69
- &:active,
70
- &[aria-selected='true'] {
71
- // Hide the highlight when focussing (in combination with the parent
72
- // states) in browsers that don't support focus-visible.
73
- &:focus::before,
74
- &:focus::after {
75
- content: none;
76
- }
73
+ &:visited {
74
+ color: $colors--theme--text-default;
77
75
  }
78
- }
79
- }
80
-
81
- // Theming
82
- @if ($theme-default-p-tabs == 'dark') {
83
- .p-tabs {
84
- @include vf-p-tabs-dark-theme;
85
- }
86
-
87
- .p-tabs.is-light {
88
- @include vf-p-tabs-light-theme;
89
- }
90
- } @else {
91
- .p-tabs {
92
- @include vf-p-tabs-light-theme;
93
- }
94
-
95
- .p-tabs.is-dark {
96
- @include vf-p-tabs-dark-theme;
97
- }
98
- }
99
- }
100
76
 
101
- @mixin vf-p-tabs-theme($color-tabs-text, $color-tabs-border, $color-tabs-highlight-hover) {
102
- color: $color-tabs-text;
103
- .p-tabs {
104
- &__list::after {
105
- background-color: $color-tabs-border;
106
- }
107
-
108
- &__link {
109
- background-color: transparent;
110
-
111
- color: $color-tabs-text;
112
- @include vf-highlight-bar(transparent, bottom, false);
113
-
114
- // Display the highlight when focussing in modern browsers that support
77
+ // Display the highlight when focusing in modern browsers that support
115
78
  // focus-visible.
116
79
  &:focus:not(:focus-visible) {
117
- @include vf-highlight-bar($color-tabs-text, bottom, false);
80
+ @include vf-highlight-bar($colors--theme--text-default, bottom, false);
118
81
  }
119
82
 
120
83
  &:hover {
121
- @include vf-highlight-bar($color-tabs-highlight-hover, bottom, false);
84
+ background-color: transparent;
85
+ @include vf-highlight-bar($colors--theme--border-default, bottom, false);
122
86
 
123
87
  &::before,
124
88
  &:focus:not(:focus-visible)::before {
@@ -126,31 +90,32 @@
126
90
  height: calc($bar-thickness - 1px);
127
91
  }
128
92
 
129
- // Display the highlight when focussing (in combination with the parent
130
- // states) in modern browsers that support focus-visible.
131
- &:focus:not(:focus-visible) {
132
- @include vf-highlight-bar($color-tabs-highlight-hover, bottom, false);
133
- }
134
-
135
- // Hide the highlight when focussing (in combination with the parent
93
+ // Hide the highlight when focusing (in combination with the parent
136
94
  // states) in browsers that don't support focus-visible.
137
95
  &:focus::before,
138
96
  &:focus::after {
139
97
  content: none;
140
98
  }
99
+
100
+ // Display the highlight when focusing (in combination with the parent
101
+ // states) in modern browsers that support focus-visible.
102
+ &:focus:not(:focus-visible) {
103
+ @include vf-highlight-bar($colors--theme--border-default, bottom, false);
104
+ }
141
105
  }
142
106
 
143
107
  &:active,
144
108
  &[aria-selected='true'] {
145
- @include vf-highlight-bar($color-tabs-text, bottom, false);
109
+ background-color: transparent;
110
+ @include vf-highlight-bar($colors--theme--text-default, bottom, false);
146
111
 
147
- // Display the highlight when focussing (in combination with the parent
112
+ // Display the highlight when focusing (in combination with the parent
148
113
  // states) in modern browsers that support focus-visible.
149
114
  &:focus:not(:focus-visible) {
150
- @include vf-highlight-bar($color-tabs-text, bottom, false);
115
+ @include vf-highlight-bar($colors--theme--text-default, bottom, false);
151
116
  }
152
117
 
153
- // Hide the highlight when focussing (in combination with the parent
118
+ // Hide the highlight when focusing (in combination with the parent
154
119
  // states) in browsers that don't support focus-visible.
155
120
  &:focus::before,
156
121
  &:focus::after {
@@ -160,19 +125,3 @@
160
125
  }
161
126
  }
162
127
  }
163
-
164
- @mixin vf-p-tabs-light-theme {
165
- @include vf-p-tabs-theme(
166
- $color-tabs-text: $colors--light-theme--text-default,
167
- $color-tabs-border: $colors--light-theme--border-default,
168
- $color-tabs-highlight-hover: $colors--light-theme--border-default
169
- );
170
- }
171
-
172
- @mixin vf-p-tabs-dark-theme {
173
- @include vf-p-tabs-theme(
174
- $color-tabs-text: $colors--dark-theme--text-default,
175
- $color-tabs-border: $colors--dark-theme--border-default,
176
- $color-tabs-highlight-hover: $colors--dark-theme--border-default
177
- );
178
- }