@swisspost/design-system-styles 6.5.0 → 6.6.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/README.md +1 -1
- package/_svg-icon-map.scss +796 -784
- package/basics.css +1 -1
- package/components/accordion.scss +2 -17
- package/components/datatable.scss +2 -0
- package/components/elevation.scss +2 -1
- package/components/floating-label.scss +1 -0
- package/components/form-select.scss +2 -3
- package/components/form-validation.scss +30 -11
- package/components/grid.scss +7 -1
- package/components/intranet-header/_layout.scss +8 -0
- package/components/intranet-header/index.scss +1 -0
- package/components/sizing.scss +15 -0
- package/components/tabs/_tab-title.scss +1 -1
- package/components/tabs/_tabs-wrapper.scss +1 -2
- package/functions/_contrast.scss +9 -0
- package/index.css +3 -3
- package/intranet.css +3 -3
- package/layouts/portal/_grid.scss +5 -0
- package/mixins/_accordion.scss +16 -0
- package/mixins/_elevation.scss +6 -0
- package/package.json +22 -12
- package/placeholders/_close.scss +6 -0
- package/variables/_color.scss +1 -1
- package/variables/components/_badge.scss +4 -1
- package/variables/components/_breadcrumbs.scss +2 -1
- package/variables/components/_form-check.scss +2 -1
- package/variables/components/_forms.scss +3 -0
- package/variables/components/_nav.scss +8 -3
- package/variables/components/_notification.scss +9 -7
- package/variables/components/_tables.scss +2 -1
|
@@ -1,36 +1,21 @@
|
|
|
1
1
|
@forward './../variables/options';
|
|
2
2
|
|
|
3
|
+
@use './../mixins/accordion' as accordion-mx;
|
|
3
4
|
@use './../mixins/button' as button-mx;
|
|
4
|
-
@use './../mixins/color' as color-mx;
|
|
5
5
|
@use './../mixins/focus' as focus-mx;
|
|
6
6
|
@use './../mixins/icons' as icon-mx;
|
|
7
7
|
@use './../mixins/type' as type-mx;
|
|
8
8
|
@use './../mixins/utilities' as utility-mx;
|
|
9
9
|
|
|
10
|
-
@use './../functions/contrast';
|
|
11
|
-
@use './../variables/color';
|
|
12
10
|
@use './../variables/components/accordion';
|
|
13
11
|
|
|
14
12
|
.accordion-item {
|
|
13
|
+
@include accordion-mx.background-color;
|
|
15
14
|
border-block: accordion.$accordion-border-width solid accordion.$accordion-border-color;
|
|
16
15
|
|
|
17
16
|
& + & {
|
|
18
17
|
border-block-start: 0;
|
|
19
18
|
}
|
|
20
|
-
|
|
21
|
-
// make the accordion gray
|
|
22
|
-
@include color-mx.colored-background(color.$gray-background);
|
|
23
|
-
|
|
24
|
-
// make the accordion white on background colors close to the gray above (making sure it remains gray on a white background)
|
|
25
|
-
$accordion-contrast-on-white: contrast.contrast-ratio(color.$white, color.$gray-background);
|
|
26
|
-
@each $name, $color in color.$background-colors {
|
|
27
|
-
$accordion-contrast-on-color: contrast.contrast-ratio($color, color.$gray-background);
|
|
28
|
-
@if ($accordion-contrast-on-color < $accordion-contrast-on-white) {
|
|
29
|
-
.bg-#{$name} & {
|
|
30
|
-
@include color-mx.colored-background(color.$white);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
19
|
}
|
|
35
20
|
|
|
36
21
|
.accordion-header {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
&.
|
|
31
|
+
&.is-valid,
|
|
32
32
|
&.is-invalid {
|
|
33
33
|
background-position:
|
|
34
34
|
right b.$form-select-padding-x * 2.5 center,
|
|
@@ -46,8 +46,7 @@
|
|
|
46
46
|
var(--bs-form-select-bg-img), var(--bs-form-select-bg-icon, none);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
&.
|
|
50
|
-
border-color: var(--post-success-green);
|
|
49
|
+
&.is-valid {
|
|
51
50
|
background-image: b.escape-svg(form-select.$form-select-indicator-success),
|
|
52
51
|
var(--bs-form-select-bg-img), var(--bs-form-select-bg-icon, none);
|
|
53
52
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
@use 'sass:map';
|
|
4
4
|
|
|
5
5
|
@use './../lic/bootstrap-license';
|
|
6
|
-
@use './../themes/bootstrap/core' as
|
|
6
|
+
@use './../themes/bootstrap/core' as b;
|
|
7
7
|
@use './../themes/bootstrap/forms/validation' as bfv;
|
|
8
8
|
|
|
9
9
|
@use './../mixins/color' as color-mx;
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
@use './../variables/color';
|
|
13
13
|
@use './../variables/components/form-validation';
|
|
14
14
|
@use './../variables/components/forms';
|
|
15
|
+
@use './../variables/spacing';
|
|
15
16
|
|
|
16
17
|
.invalid-feedback,
|
|
17
18
|
.valid-feedback {
|
|
@@ -43,10 +44,10 @@
|
|
|
43
44
|
color: form-validation.$form-feedback-custom-text;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
@each $state, $data in
|
|
47
|
+
@each $state, $data in b.$form-validation-states {
|
|
47
48
|
$icon: map.get($data, 'icon');
|
|
48
49
|
|
|
49
|
-
@include form-validation-state-selector($state) {
|
|
50
|
+
@include b.form-validation-state-selector($state) {
|
|
50
51
|
~ .#{$state}-feedback,
|
|
51
52
|
~ .#{$state}-tooltip {
|
|
52
53
|
display: block;
|
|
@@ -54,19 +55,19 @@
|
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
.form-control {
|
|
57
|
-
@include form-validation-state-selector($state) {
|
|
58
|
-
padding-right:
|
|
59
|
-
background-image: escape-svg($icon);
|
|
58
|
+
@include b.form-validation-state-selector($state) {
|
|
59
|
+
padding-right: b.$input-height-inner;
|
|
60
|
+
background-image: b.escape-svg($icon);
|
|
60
61
|
background-repeat: no-repeat;
|
|
61
|
-
background-position: right
|
|
62
|
+
background-position: right b.$input-height-inner-quarter center;
|
|
62
63
|
background-size: form-validation.$form-feedback-icon-size;
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
textarea.form-control {
|
|
67
|
-
@include form-validation-state-selector($state) {
|
|
68
|
-
padding-right:
|
|
69
|
-
background-position: top
|
|
68
|
+
@include b.form-validation-state-selector($state) {
|
|
69
|
+
padding-right: b.$input-height-inner;
|
|
70
|
+
background-position: top b.$input-height-inner-quarter right b.$input-height-inner-quarter;
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
|
|
@@ -74,7 +75,7 @@
|
|
|
74
75
|
> .form-control:not(:focus),
|
|
75
76
|
> .form-select:not(:focus),
|
|
76
77
|
> .form-floating:not(:focus-within) {
|
|
77
|
-
@include form-validation-state-selector($state) {
|
|
78
|
+
@include b.form-validation-state-selector($state) {
|
|
78
79
|
@if $state == 'valid' {
|
|
79
80
|
z-index: 3;
|
|
80
81
|
} @else if $state == 'invalid' {
|
|
@@ -95,6 +96,24 @@
|
|
|
95
96
|
@include form-validation-mx.form-validation-state-selector(invalid) {
|
|
96
97
|
border-color: form-validation.$form-feedback-invalid-color;
|
|
97
98
|
|
|
99
|
+
&.is-valid {
|
|
100
|
+
padding-right: spacing.$size-small-huge; // For deprecated form-control-rg
|
|
101
|
+
border-color: var(--post-success-green);
|
|
102
|
+
background-image: b.escape-svg(form-validation.$form-feedback-icon-valid);
|
|
103
|
+
background-repeat: no-repeat;
|
|
104
|
+
background-position: right b.$input-height-inner-quarter center;
|
|
105
|
+
|
|
106
|
+
&.form-control-sm {
|
|
107
|
+
padding-right: spacing.$size-bigger-big; // Included in bootstrap and prevent native icon (e.g. with input[type=date]) to stack over success icon
|
|
108
|
+
background-size: forms.$form-bg-size-sm; // Add space between background icons (ours and the one from bootstrap)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&.form-control-lg {
|
|
112
|
+
padding-right: spacing.$size-small-huge; // Included in bootstrap and prevent native icon (e.g. with input[type=date]) to stack over success icon
|
|
113
|
+
background-size: forms.$form-bg-size; // Add space between background icons (ours and the one from bootstrap)
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
98
117
|
&:focus {
|
|
99
118
|
border-color: form-validation.$form-feedback-invalid-color;
|
|
100
119
|
box-shadow: form-validation.$form-feedback-invalid-box-shadow;
|
package/components/grid.scss
CHANGED
|
@@ -88,8 +88,9 @@ $gutter-x-cache: 0;
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
//
|
|
91
|
+
//the following classes are all deprecated and wil be removed in next major version
|
|
92
92
|
|
|
93
|
+
//deprecated
|
|
93
94
|
.vertical-gutters {
|
|
94
95
|
margin-bottom: grid.$grid-gutter-width * -1;
|
|
95
96
|
|
|
@@ -99,6 +100,7 @@ $gutter-x-cache: 0;
|
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
|
|
103
|
+
//deprecated
|
|
102
104
|
// border-gutters class is used to manipulate border collapse
|
|
103
105
|
.row.border-gutters {
|
|
104
106
|
margin-right: -(commons.$border-width);
|
|
@@ -113,8 +115,10 @@ $gutter-x-cache: 0;
|
|
|
113
115
|
}
|
|
114
116
|
}
|
|
115
117
|
|
|
118
|
+
//deprecated
|
|
116
119
|
$container-cache: 0;
|
|
117
120
|
|
|
121
|
+
//deprecated
|
|
118
122
|
@each $breakpoint in grid.$grid-breakpoints-list {
|
|
119
123
|
$container-padding: map.get(grid.$grid-container-padding, $breakpoint);
|
|
120
124
|
|
|
@@ -153,6 +157,7 @@ $container-cache: 0;
|
|
|
153
157
|
}
|
|
154
158
|
}
|
|
155
159
|
|
|
160
|
+
//deprecated
|
|
156
161
|
// Container fluid responsive needs to be written every time
|
|
157
162
|
.container-fluid-#{$breakpoint} {
|
|
158
163
|
@include media-breakpoint-only($breakpoint) {
|
|
@@ -161,5 +166,6 @@ $container-cache: 0;
|
|
|
161
166
|
}
|
|
162
167
|
}
|
|
163
168
|
|
|
169
|
+
//deprecated
|
|
164
170
|
$container-cache: $container-padding;
|
|
165
171
|
}
|
package/components/sizing.scss
CHANGED
|
@@ -55,6 +55,21 @@
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
// Post breakpoints width - e.g. w-sm-100
|
|
59
|
+
@each $breakpoint in map-keys(breakpoints.$grid-breakpoints) {
|
|
60
|
+
@include media-breakpoint-up($breakpoint) {
|
|
61
|
+
@if $breakpoint != 'xs' {
|
|
62
|
+
@each $prop, $abbrev in (width: w) {
|
|
63
|
+
@each $size, $length in spacing.$sizes {
|
|
64
|
+
.#{$abbrev}-#{$breakpoint}-#{$size} {
|
|
65
|
+
#{$prop}: $length !important;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
58
73
|
// Generate responsive spacing utility classes, a lot of them
|
|
59
74
|
$cache: ();
|
|
60
75
|
|
package/functions/_contrast.scss
CHANGED
|
@@ -48,6 +48,15 @@
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
@function light-or-dark($background, $light-color: #fff, $dark-color: #000) {
|
|
51
|
+
/*
|
|
52
|
+
exception for Success-color issue #2227
|
|
53
|
+
the color is statically defined because the reference to the variable from here
|
|
54
|
+
would create a loop
|
|
55
|
+
*/
|
|
56
|
+
@if ($background == #2c911c) {
|
|
57
|
+
@return 'dark';
|
|
58
|
+
}
|
|
59
|
+
|
|
51
60
|
// Contrast ratio with a light color
|
|
52
61
|
$contrast-light: contrast-ratio($background, $light-color);
|
|
53
62
|
|