@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.
@@ -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 {
@@ -94,6 +94,8 @@
94
94
  }
95
95
 
96
96
  .datatable-button {
97
+ display: flex;
98
+ align-items: center;
97
99
  @include button-mixins.reset-button;
98
100
  width: datatable.$datatable-button-width;
99
101
  height: datatable.$datatable-button-height;
@@ -1,7 +1,8 @@
1
1
  @use '../variables/elevation';
2
+ @use '../mixins/elevation' as elevation-mx;
2
3
 
3
4
  @each $key, $value in elevation.$elevation-map {
4
5
  .#{$key} {
5
- box-shadow: #{$value};
6
+ @include elevation-mx.elevation($key);
6
7
  }
7
8
  }
@@ -10,6 +10,7 @@
10
10
  @use './../mixins/utilities' as utilities-mx;
11
11
 
12
12
  @use './../variables/type';
13
+ @use './../variables/spacing';
13
14
  @use './../variables/components/forms';
14
15
  @use './../variables/components/form-validation';
15
16
 
@@ -28,7 +28,7 @@
28
28
  }
29
29
  }
30
30
 
31
- &.success,
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
- &.success {
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 $form-validation-states {
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: $input-height-inner;
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 $input-height-inner-quarter center;
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: $input-height-inner;
69
- background-position: top $input-height-inner-quarter right $input-height-inner-quarter;
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;
@@ -88,8 +88,9 @@ $gutter-x-cache: 0;
88
88
  }
89
89
  }
90
90
 
91
- // legacy code
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
  }
@@ -0,0 +1,8 @@
1
+ // Fix a regression after new version of grid
2
+ sp-intranet-header ~ .container-fluid {
3
+ padding-left: 0;
4
+
5
+ > .row {
6
+ margin-left: 0;
7
+ }
8
+ }
@@ -7,6 +7,7 @@
7
7
 
8
8
  @use 'scaffolding';
9
9
 
10
+ @use 'layout';
10
11
  @use 'top-navigation';
11
12
  @use 'sidebar';
12
13
  @use 'nav-overflow';
@@ -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
 
@@ -6,7 +6,7 @@
6
6
  @use './../../variables/spacing';
7
7
  @use './../../variables/components/nav';
8
8
 
9
- .tab-title[role=tab]{
9
+ .tab-title[role='tab'] {
10
10
  display: inline-block;
11
11
  position: relative;
12
12
  box-sizing: border-box;
@@ -55,8 +55,7 @@
55
55
  }
56
56
 
57
57
  .tab-content {
58
- padding-top: spacing.$spacer;
59
- padding-bottom: spacing.$spacer;
58
+ margin-block: spacing.$spacer;
60
59
  }
61
60
 
62
61
  // Careful, this generates a lot of code
@@ -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