@swisspost/design-system-styles 6.6.4 → 7.1.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 (71) hide show
  1. package/_svg-icon-map.scss +927 -907
  2. package/basics.css +1 -1
  3. package/components/_index.scss +4 -1
  4. package/components/alert.scss +6 -1
  5. package/components/badge.scss +25 -78
  6. package/components/button-group.scss +2 -4
  7. package/components/button.scss +82 -31
  8. package/components/card-control.scss +322 -0
  9. package/components/carousel.scss +1 -1
  10. package/components/chip.scss +159 -0
  11. package/components/datepicker.scss +24 -12
  12. package/components/error-container.scss +9 -0
  13. package/components/floating-label.scss +0 -1
  14. package/components/form-check.scss +118 -31
  15. package/components/form-range.scss +94 -19
  16. package/components/form-select.scss +64 -15
  17. package/components/form-validation.scss +32 -13
  18. package/components/forms.scss +51 -13
  19. package/components/intranet-header/_sidebar.scss +24 -5
  20. package/components/sizing.scss +2 -2
  21. package/components/spinner.scss +6 -12
  22. package/components/stepper.scss +283 -138
  23. package/components/subnavigation.scss +2 -5
  24. package/components/tables.scss +1 -1
  25. package/components/tabs/_tabs-wrapper.scss +1 -1
  26. package/components/tag.scss +82 -0
  27. package/components/topic-teaser.scss +1 -2
  28. package/components/utilities.scss +0 -2
  29. package/functions/_color.scss +12 -0
  30. package/functions/_forms.scss +22 -0
  31. package/functions/_list.scss +2 -1
  32. package/functions/_sizing.scss +2 -2
  33. package/functions/_utilities.scss +3 -3
  34. package/index.css +3 -3
  35. package/intranet.css +3 -3
  36. package/mixins/_accordion.scss +2 -2
  37. package/mixins/_button.scss +1 -2
  38. package/mixins/_chip.scss +36 -0
  39. package/mixins/_forms.scss +1 -0
  40. package/mixins/_icons.scss +1 -3
  41. package/mixins/_index.scss +1 -1
  42. package/mixins/_utilities.scss +85 -0
  43. package/package.json +15 -15
  44. package/placeholders/_badge.scss +4 -56
  45. package/placeholders/_button.scss +2 -0
  46. package/placeholders/_close.scss +8 -1
  47. package/placeholders/_color.scss +10 -0
  48. package/themes/bootstrap/_overrides-color.scss +4 -14
  49. package/themes/bootstrap/_overrides-variables.scss +1 -0
  50. package/variables/_color.scss +104 -44
  51. package/variables/_commons.scss +2 -0
  52. package/variables/_features.scss +1 -3
  53. package/variables/_icons.scss +4 -1
  54. package/variables/_type.scss +9 -1
  55. package/variables/components/_badge.scss +14 -38
  56. package/variables/components/_card.scss +1 -1
  57. package/variables/components/_chip.scss +50 -0
  58. package/variables/components/_datatable.scss +1 -1
  59. package/variables/components/_dropdowns.scss +1 -1
  60. package/variables/components/_form-check.scss +75 -1
  61. package/variables/components/_form-select.scss +20 -5
  62. package/variables/components/_form-validation.scss +14 -6
  63. package/variables/components/_index.scss +2 -0
  64. package/variables/components/_list-group.scss +1 -1
  65. package/variables/components/_notification.scss +5 -4
  66. package/variables/components/_pagination.scss +2 -2
  67. package/variables/components/_stepper.scss +25 -14
  68. package/variables/components/_subnavigation.scss +1 -1
  69. package/variables/components/_tag.scss +27 -0
  70. package/components/choice-control-card.scss +0 -148
  71. package/mixins/_badge.scss +0 -31
@@ -4,12 +4,12 @@
4
4
 
5
5
  @mixin background-color() {
6
6
  // make light gray the default accordion color
7
- @include color-mx.colored-background(color.$gray-background);
7
+ @include color-mx.colored-background(color.$gray);
8
8
 
9
9
  // make the accordion white on any background other than white
10
10
  @each $name, $color in color.$background-colors {
11
11
  .bg-#{$name} & {
12
- $accordion-bg: if($color == color.$white, color.$gray-background, color.$white);
12
+ $accordion-bg: if($color == color.$white, color.$gray, color.$white);
13
13
  @include color-mx.colored-background($accordion-bg);
14
14
  }
15
15
  }
@@ -16,8 +16,7 @@
16
16
  font: inherit;
17
17
  -webkit-user-select: none;
18
18
  user-select: none;
19
- -webkit-appearance: button;
20
- appearance: button; // for input
19
+ appearance: button; // for input
21
20
  }
22
21
 
23
22
  @mixin button-size($size: md) {
@@ -0,0 +1,36 @@
1
+ @use './../lic/bootstrap-license';
2
+ @use './../themes/bootstrap/core' as *;
3
+
4
+ @use './../variables/components/badge';
5
+ @use './../variables/components/chip';
6
+ @use './../mixins/utilities';
7
+
8
+ @mixin chip-styles {
9
+ @include border-radius(chip.$chip-border-radius);
10
+ display: inline-flex;
11
+ align-items: center;
12
+ height: chip.$chip-height;
13
+ max-width: chip.$chip-max-width;
14
+ padding-inline: chip.$chip-padding-x;
15
+ border: chip.$chip-border-width solid chip.$chip-border-color;
16
+ gap: chip.$chip-gap;
17
+ line-height: chip.$chip-line-height;
18
+ font-size: chip.$chip-font-size;
19
+ font-weight: chip.$chip-font-weight;
20
+ color: chip.$chip-color;
21
+ background-color: chip.$chip-bg;
22
+ transition: chip.$chip-transition;
23
+
24
+ > .chip-text {
25
+ text-overflow: ellipsis;
26
+ overflow: hidden;
27
+ white-space: nowrap;
28
+ }
29
+ }
30
+
31
+ @mixin chip-styles-sm {
32
+ height: chip.$chip-height-sm;
33
+ font-size: chip.$chip-font-size-sm;
34
+ gap: chip.$chip-gap-sm;
35
+ padding-inline: chip.$chip-padding-x-sm;
36
+ }
@@ -47,6 +47,7 @@
47
47
  min-height: forms.$input-height-lg;
48
48
  }
49
49
 
50
+ /* Deprecated use the one in utilities.scss */
50
51
  @mixin focus-outline {
51
52
  outline: none;
52
53
  outline-offset: forms.$input-focus-outline-thickness;
@@ -29,9 +29,7 @@
29
29
  $final-color: map.get(color.$background-colors, $color);
30
30
 
31
31
  @if (not $final-color) {
32
- $valid-colors: map.keys(color.$background-colors);
33
-
34
- @error "Error in Mixin 'pi(name, color?)'. Color '#{$color}' is not available. Please choose one of the following: #{$valid-colors}.";
32
+ @error "Error in Mixin 'pi(name, color?)'. Color '#{$color}' is not available. Please choose one of the following: #{map.keys(color.$background-colors)}.";
35
33
  }
36
34
  }
37
35
  border-color: $final-color;
@@ -1,6 +1,6 @@
1
1
  @forward 'animation';
2
- @forward 'badge';
3
2
  @forward 'button';
3
+ @forward 'chip';
4
4
  @forward 'color';
5
5
  @forward 'focus';
6
6
  @forward 'form-checks';
@@ -1,3 +1,6 @@
1
+ @use '../variables/spacing';
2
+ @use '../variables/commons';
3
+
1
4
  @mixin reset-list() {
2
5
  margin: 0;
3
6
  padding: 0;
@@ -79,3 +82,85 @@
79
82
  @content;
80
83
  }
81
84
  }
85
+
86
+ @mixin focus-style-none {
87
+ outline: none;
88
+ }
89
+
90
+ @mixin focus-style($additional-selector: '') {
91
+ &#{$additional-selector} {
92
+ outline-style: none !important; // !important is needed to override bootstrap .form-control:focus
93
+ outline-offset: spacing.$size-line !important;
94
+ outline-width: spacing.$size-line !important;
95
+ outline-color: var(--post-focus-color) !important;
96
+ }
97
+
98
+ // :has(:focus-visible) mimic a focus-visible-within pseudo-class
99
+ &:is(:focus-visible, :has(:focus-visible), .pretend-focus)#{$additional-selector} {
100
+ outline-style: solid !important;
101
+
102
+ @include high-contrast-mode() {
103
+ outline-color: Highlight !important;
104
+ }
105
+
106
+ // In case rules need to be slightly adjusted
107
+ @content;
108
+ }
109
+
110
+ // When a browser doesn't support :has, use focus-within as a fallback. This means that focus state is displayed on focus and not on focus-visible only (except some browsers like Safari).
111
+ @supports not selector(:has(:focus-visible)) {
112
+ &:is(:focus-visible, :focus-within, .pretend-focus)#{$additional-selector} {
113
+ outline-style: solid !important;
114
+
115
+ @include high-contrast-mode() {
116
+ outline-color: Highlight !important;
117
+ }
118
+
119
+ // In case rules need to be slightly adjusted
120
+ @content;
121
+ }
122
+ }
123
+ }
124
+
125
+ @mixin focus-style-custom($additional-selector: '') {
126
+ // :has(:focus-visible) mimic a focus-visible-within pseudo-class
127
+ &:is(:focus-visible, :has(:focus-visible), .pretend-focus)#{$additional-selector} {
128
+ @content;
129
+ }
130
+
131
+ // When a browser doesn't support :has, use focus-within as a fallback. This means that focus state is displayed on focus and not on focus-visible only (except some browsers like Safari).
132
+ @supports not selector(:has(:focus-visible)) {
133
+ &:is(:focus-visible, :focus-within, .pretend-focus)#{$additional-selector} {
134
+ @content;
135
+ }
136
+ }
137
+ }
138
+
139
+ @mixin focus-hover-style-custom($additional-selector: '') {
140
+ @include focus-style-custom($additional-selector) {
141
+ @content;
142
+ }
143
+
144
+ &:hover#{$additional-selector} {
145
+ @content;
146
+ }
147
+ }
148
+
149
+ @mixin disabled-style($additional-selector: '') {
150
+ &:disabled#{$additional-selector} {
151
+ pointer-events: none;
152
+ color: var(--post-gray-40);
153
+ border-color: var(--post-gray-40);
154
+ border-style: dashed;
155
+ background-clip: padding-box;
156
+ text-decoration: line-through;
157
+
158
+ @include high-contrast-mode() {
159
+ color: GrayText;
160
+ border-color: GrayText;
161
+ }
162
+
163
+ // In case rules need to be slightly adjusted
164
+ @content;
165
+ }
166
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@swisspost/design-system-styles",
3
- "version": "6.6.4",
3
+ "version": "7.1.0",
4
4
  "description": "Design System Styles for the Swiss Post web platform.",
5
- "author": "Swiss Post <oss@post.ch>",
5
+ "author": "Swiss Post <design-system@post.ch>",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",
@@ -17,7 +17,7 @@
17
17
  "linkDirectory": true
18
18
  },
19
19
  "peerDependencies": {
20
- "@ng-bootstrap/ng-bootstrap": "^15.0.0",
20
+ "@ng-bootstrap/ng-bootstrap": "^15.0.0 || ^16.0.0",
21
21
  "bootstrap": "~5.3.0"
22
22
  },
23
23
  "peerDependenciesMeta": {
@@ -30,29 +30,29 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@popperjs/core": "2.11.8",
33
- "bootstrap": "5.3.2"
33
+ "bootstrap": "5.3.3"
34
34
  },
35
35
  "devDependencies": {
36
- "@swisspost/design-system-icons": "1.4.0",
37
- "@types/node": "18.19.14",
38
- "autoprefixer": "10.4.17",
36
+ "@swisspost/design-system-icons": "7.1.0",
37
+ "@types/node": "20.12.7",
38
+ "autoprefixer": "10.4.19",
39
39
  "copyfiles": "2.4.1",
40
- "glob": "10.3.10",
40
+ "glob": "10.3.15",
41
41
  "gulp": "4.0.2",
42
42
  "gulp-newer": "^1.4.0",
43
43
  "gulp-postcss": "10.0.0",
44
44
  "gulp-sass": "5.1.0",
45
45
  "jest": "29.7.0",
46
- "postcss": "8.4.33",
46
+ "postcss": "8.4.38",
47
47
  "postcss-scss": "4.0.9",
48
48
  "prettier": "3.2.5",
49
- "rimraf": "5.0.5",
50
- "sass": "1.70.0",
51
- "stylelint": "16.2.1",
52
- "stylelint-config-sass-guidelines": "11.0.0",
49
+ "rimraf": "5.0.7",
50
+ "sass": "1.77.1",
51
+ "stylelint": "16.5.0",
52
+ "stylelint-config-sass-guidelines": "11.1.0",
53
53
  "stylelint-prettier": "5.0.0",
54
- "stylelint-scss": "6.1.0",
55
- "typescript": "4.9.5"
54
+ "stylelint-scss": "6.3.0",
55
+ "typescript": "5.3.3"
56
56
  },
57
57
  "sass": {
58
58
  "includePaths": [
@@ -1,59 +1,7 @@
1
- @use './../themes/bootstrap/core' as *;
2
-
3
1
  @use './../variables/components/badge';
4
2
 
5
- %badge {
6
- @include border-radius($badge-border-radius);
7
- display: inline-flex;
8
- justify-content: flex-start;
9
- align-items: center;
10
- gap: badge.$badge-gap;
11
- padding: $badge-padding-y $badge-padding-x;
12
- border: badge.$badge-border-width solid badge.$badge-border-color;
13
- height: badge.$badge-height;
14
- font-size: badge.$badge-font-size;
15
- font-weight: $badge-font-weight;
16
- line-height: inherit;
17
- color: $badge-color;
18
- text-align: center;
19
- vertical-align: baseline;
20
- max-width: 100%;
21
-
22
- > span {
23
- text-overflow: ellipsis;
24
- overflow: hidden;
25
- white-space: nowrap;
26
- }
27
-
28
- > .badge {
29
- padding: $size-micro;
30
- height: badge.$badge-nested-height;
31
- min-width: badge.$badge-nested-height;
32
- color: badge.$badge-nested-color;
33
- background-color: badge.$badge-nested-bg-color;
34
- border-color: badge.$badge-nested-border-color;
35
- font-size: badge.$badge-nested-font-size;
36
- }
37
-
38
- > .badge,
39
- > .btn-close {
40
- margin-right: -1 * (badge.$badge-padding-x - badge.$badge-nested-translate-x);
41
- }
42
-
43
- &.badge-sm {
44
- height: badge.$badge-height-sm;
45
- font-size: badge.$badge-font-size-sm;
46
- gap: badge.$badge-gap-sm;
47
-
48
- > .badge,
49
- > .btn-close {
50
- margin-right: -1 * (badge.$badge-padding-x - badge.$badge-nested-translate-x-sm);
51
- }
52
- }
53
-
54
- // Quick fix for badges in buttons
55
- .btn & {
56
- position: relative;
57
- top: -1px;
58
- }
3
+ %badge-sm {
4
+ --post-badge-height: #{badge.$badge-height-sm};
5
+ --post-badge-padding-x: #{badge.$badge-padding-x-sm};
6
+ font-size: badge.$badge-font-size-sm;
59
7
  }
@@ -30,6 +30,8 @@
30
30
 
31
31
  // Invert icon on dark backgrounds
32
32
  @include color-mx.on-dark-background() {
33
+ color: var(--post-contrast-color);
34
+
33
35
  .pi {
34
36
  filter: invert(1);
35
37
  }
@@ -6,11 +6,14 @@
6
6
 
7
7
  @use './../variables/animation';
8
8
  @use './../variables/color';
9
+ @use './../variables/commons';
9
10
  @use './../variables/components/close';
10
11
 
11
12
  %btn-close {
12
13
  @include button-mx.reset-button;
13
- @include forms-mx.focus-outline;
14
+ @include utilities-mx.focus-style() {
15
+ border-radius: commons.$border-radius;
16
+ }
14
17
  border-radius: close.$close-border-radius;
15
18
  color: close.$close-color;
16
19
  transition: close.$close-transition;
@@ -24,6 +27,10 @@
24
27
  width: close.$close-size;
25
28
  }
26
29
 
30
+ @include color-mx.on-dark-background() {
31
+ color: var(--post-contrast-color);
32
+ }
33
+
27
34
  @include utilities-mx.not-disabled-focus-hover() {
28
35
  color: close.$close-hover-color;
29
36
  }
@@ -19,6 +19,7 @@
19
19
  // light background variables
20
20
  %color-background-light-variables {
21
21
  --post-contrast-color: #{color.$black};
22
+ --post-focus-color: #{color.$focus-light};
22
23
  --post-contrast-color-inverted: #{color.$white};
23
24
 
24
25
  @each $name, $color in color.$post-grays {
@@ -37,6 +38,14 @@
37
38
  --post-#{$name}-rgb: #{color-fn.rgb-values($color)};
38
39
  }
39
40
 
41
+ @each $name, $color in color.$post-black-alphas {
42
+ --post-black-#{$name}-rgba: #{$color};
43
+ }
44
+
45
+ @each $name, $color in color.$post-white-alphas {
46
+ --post-white-#{$name}-rgba: #{$color};
47
+ }
48
+
40
49
  @each $name, $color in color.$background-colors {
41
50
  --post-#{$name}-rgb: #{color-fn.rgb-values($color)};
42
51
  }
@@ -45,6 +54,7 @@
45
54
  // dark background variables
46
55
  %color-background-dark-variables {
47
56
  --post-contrast-color: #{color.$white};
57
+ --post-focus-color: #{color.$focus-dark};
48
58
  --post-contrast-color-inverted: #{color.$black};
49
59
  --post-dark: #{color.$light};
50
60
  --post-light: #{color.$dark};
@@ -11,16 +11,6 @@
11
11
  * but should not be used.
12
12
  */
13
13
 
14
- // $grays are defined in post colors
15
- // $colors are defined in post colors
16
-
17
- $primary: color.$gray-80;
18
- $secondary: color.$gray-60;
19
- // $success: color.$success; // Is already defined as $sucess in post-colors
20
- // $info: color.$info; // Is already defined as $info in post-colors
21
- // $warning: color.$warning; // Is already defined as $warning in post-colors
22
- $danger: color.$error;
23
-
24
14
  // Colors that can be used as a background
25
15
  $colors: () !default;
26
16
 
@@ -28,13 +18,13 @@ $theme-colors: () !default;
28
18
  $theme-colors: map.merge(
29
19
  $theme-colors,
30
20
  (
31
- 'primary': $primary,
32
- 'secondary': $secondary,
21
+ 'primary': color.$primary,
22
+ 'secondary': color.$secondary,
33
23
  'light': color.$light,
34
24
  'dark': color.$dark,
35
25
  )
36
26
  );
37
- $theme-colors: map.merge($theme-colors, color.$contextual-colors);
27
+ $theme-colors: map.merge($theme-colors, color.$signal-colors);
38
28
 
39
29
  // Contrast colors are ok
40
30
 
@@ -42,4 +32,4 @@ $body-bg: color.$white;
42
32
  $body-color: color.$black;
43
33
 
44
34
  $component-active-color: color.$white !default;
45
- $component-active-bg: $primary !default;
35
+ $component-active-bg: color.$primary !default;
@@ -15,6 +15,7 @@
15
15
  @forward './../../variables/components/button';
16
16
  @forward './../../variables/components/card';
17
17
  @forward './../../variables/components/carousel';
18
+ @forward './../../variables/components/chip';
18
19
  @forward './../../variables/components/close';
19
20
  @forward './../../variables/components/datepicker';
20
21
  @forward './../../variables/components/dropdowns';
@@ -6,23 +6,50 @@
6
6
  * Colors used by the post style guide
7
7
  */
8
8
 
9
- // The one and only
10
- $yellow: #fc0;
11
-
12
9
  // Grayscale
13
- $gray-background: #f4f3f1;
14
- $gray-background-light: #faf9f8;
15
-
16
- $white: #fff;
17
10
  $gray-10: hsl(0, 0%, 90%);
18
11
  $gray-20: hsl(0, 0%, 80%);
19
12
  $gray-40: hsl(0, 0%, 60%);
20
13
  $gray-60: hsl(0, 0%, 40%);
21
14
  $gray-80: hsl(0, 0%, 20%);
22
- $black: #000;
23
15
 
16
+ // Black alpha
17
+ $black-alpha-10: rgba(0, 0, 0, 0.1);
18
+ $black-alpha-20: rgba(0, 0, 0, 0.2);
19
+ $black-alpha-40: rgba(0, 0, 0, 0.4);
20
+ $black-alpha-60: rgba(0, 0, 0, 0.6);
21
+ $black-alpha-80: rgba(0, 0, 0, 0.8);
22
+
23
+ // White alpha
24
+ $white-alpha-10: rgba(255, 255, 255, 0.1);
25
+ $white-alpha-20: rgba(255, 255, 255, 0.2);
26
+ $white-alpha-40: rgba(255, 255, 255, 0.4);
27
+ $white-alpha-60: rgba(255, 255, 255, 0.6);
28
+ $white-alpha-80: rgba(255, 255, 255, 0.8);
29
+
30
+ // Brand
31
+ $yellow: #fc0; // The one and only
32
+ $white: #fff;
33
+ $light: #faf9f8;
34
+ $gray: #f4f3f1;
24
35
  $dark: $gray-80;
25
- $light: $gray-background-light;
36
+ $black: #000;
37
+ $primary: $gray-80;
38
+ $secondary: $gray-60;
39
+
40
+ // Focus
41
+ $focus-light: #1976c8;
42
+ $focus-dark: $white;
43
+
44
+ // Signal Colors
45
+ $success: #2c871d; /* When value is changed, please changed as well the copied value in ../functions/_contrast.scss, @function light-or-dark()*/
46
+ $error: #a51728;
47
+ $warning: #f49e00;
48
+ $info: #cce4ee;
49
+
50
+ $success-background: #c0debb;
51
+ $error-background: #ffdade;
52
+ $warning-background: #fce2b2;
26
53
 
27
54
  // Accent colors
28
55
  $nightblue-dark: #004976;
@@ -38,22 +65,6 @@ $olive-bright: #aa9d2e;
38
65
  $aubergine-dark: #523178;
39
66
  $aubergine-bright: #7566a0;
40
67
 
41
- // Contextual colors (deprecated)
42
- $success: #2c911c;
43
- $success-text: #255e1c;
44
- $error: #a51728;
45
- $error-text: #8f0d1c;
46
- $warning: #f49e00;
47
- $info: #cce4ee;
48
-
49
- // Signal Colors
50
- $success-green: #2c871d; /* When value is changed, please changed as well the copied value in ../functions/_contrast.scss, @function light-or-dark()*/
51
- $error-red: #a51728;
52
- $warning-orange: #f49e00;
53
- $success-background: #c0debb;
54
- $error-background: #ffdade;
55
- $warning-background: #fce2b2;
56
-
57
68
  /**
58
69
  * Maps. Allow maps to have custom colors from the project
59
70
  * by always merging into a default empty map
@@ -71,14 +82,27 @@ $post-grays: map.merge(
71
82
  )
72
83
  );
73
84
 
74
- $contextual-colors: () !default;
75
- $contextual-colors: map.merge(
76
- $contextual-colors,
85
+ $post-black-alphas: () !default;
86
+ $post-black-alphas: map.merge(
87
+ $post-black-alphas,
77
88
  (
78
- 'info': $info,
79
- 'success': $success,
80
- 'warning': $warning,
81
- 'danger': $error,
89
+ 'alpha-10': $black-alpha-10,
90
+ 'alpha-20': $black-alpha-20,
91
+ 'alpha-40': $black-alpha-40,
92
+ 'alpha-60': $black-alpha-60,
93
+ 'alpha-80': $black-alpha-80,
94
+ )
95
+ );
96
+
97
+ $post-white-alphas: () !default;
98
+ $post-white-alphas: map.merge(
99
+ $post-white-alphas,
100
+ (
101
+ 'alpha-10': $white-alpha-10,
102
+ 'alpha-20': $white-alpha-20,
103
+ 'alpha-40': $white-alpha-40,
104
+ 'alpha-60': $white-alpha-60,
105
+ 'alpha-80': $white-alpha-80,
82
106
  )
83
107
  );
84
108
 
@@ -86,12 +110,20 @@ $signal-colors: () !default;
86
110
  $signal-colors: map.merge(
87
111
  $signal-colors,
88
112
  (
89
- 'success-green': $success-green,
90
- 'error-red': $error-red,
91
- 'warning-orange': $warning-orange,
113
+ 'success': $success,
114
+ 'warning': $warning,
115
+ 'error': $error,
116
+ 'info': $info,
117
+ )
118
+ );
119
+
120
+ $signal-background-colors: () !default;
121
+ $signal-background-colors: map.merge(
122
+ $signal-background-colors,
123
+ (
92
124
  'success-background': $success-background,
93
- 'error-background': $error-background,
94
125
  'warning-background': $warning-background,
126
+ 'error-background': $error-background,
95
127
  )
96
128
  );
97
129
 
@@ -120,24 +152,52 @@ $background-colors: map.merge(
120
152
  $background-colors,
121
153
  (
122
154
  'yellow': $yellow,
155
+ 'white': $white,
123
156
  'light': $light,
124
- 'gray': $gray-background,
157
+ 'gray': $gray,
125
158
  'dark': $dark,
126
- 'primary': $gray-80,
127
- 'white': $white,
128
159
  'black': $black,
160
+ 'primary': $primary,
161
+ 'secondary': $secondary,
129
162
  )
130
163
  );
131
164
 
132
- // Merge with the other lists
133
- $background-colors: map.merge($background-colors, $contextual-colors);
134
- $background-colors: map.merge($background-colors, $accent-colors);
165
+ $notification-colors: () !default;
166
+ $notification-colors: list.join(
167
+ $notification-colors,
168
+ (
169
+ // When changed, check $notification-variants as well in packages/styles/src/variables/components/_notification.scss
170
+ 'primary' $gray-80,
171
+ 'success' $success,
172
+ 'danger' $error,
173
+ 'warning' $warning,
174
+ 'info' $info,
175
+ 'gray' $gray,
176
+ // deprecated
177
+ 'notification' $gray-80,
178
+ 'error' $error
179
+ )
180
+ );
181
+
182
+ // Merge with the other color maps
135
183
  $background-colors: map.merge($background-colors, $signal-colors);
184
+ $background-colors: map.merge($background-colors, $signal-background-colors);
185
+ $background-colors: map.merge($background-colors, $accent-colors);
136
186
 
137
187
  // Compile a list of dark backgrounds, used in the :is selector mixin at mixins/color
138
188
  $dark-backgrounds: () !default;
139
- @each $colorname, $color in $background-colors {
189
+ @each $color-name, $color in $background-colors {
190
+ @if (contrast-fn.light-or-dark($color) == 'dark') {
191
+ $dark-backgrounds: list.append($dark-backgrounds, '.bg-#{$color-name}', $separator: comma);
192
+ }
193
+ }
194
+ @each $color-name, $color in $notification-colors {
140
195
  @if (contrast-fn.light-or-dark($color) == 'dark') {
141
- $dark-backgrounds: list.append($dark-backgrounds, '.bg-#{$colorname}', $separator: comma);
196
+ $dark-backgrounds: list.append($dark-backgrounds, '.alert-#{$color-name}', $separator: comma);
197
+ $dark-backgrounds: list.append(
198
+ $dark-backgrounds,
199
+ 'post-alert[type=#{$color-name}]',
200
+ $separator: comma
201
+ );
142
202
  }
143
203
  }
@@ -11,6 +11,8 @@ $border-radius: 4px !default;
11
11
  $border-radius-sm: $border-radius !default;
12
12
  $border-radius-rg: $border-radius !default;
13
13
  $border-radius-lg: $border-radius !default;
14
+ $border-radius-pill: 50rem !default;
15
+ $border-radius-round: 50% !default;
14
16
 
15
17
  $box-shadow-sm: 0 0 4px 0 rgba(color.$black, 0.4) !default;
16
18
  $box-shadow: 0 0 5px 0 rgba(color.$black, 0.3) !default;
@@ -13,6 +13,4 @@ $enable-hover-media-query: false;
13
13
  $enable-grid-classes: true;
14
14
 
15
15
  // Prefix for :root CSS variables
16
- // TODO: this variable will change from "$variable-prefix" to "$prefix" in bootstrap@5.2
17
- // https://getbootstrap.com/docs/5.2/customize/css-variables/#prefix
18
- $variable-prefix: 'bs-' !default;
16
+ $prefix: 'bs-' !default;
@@ -1,5 +1,7 @@
1
1
  @use 'sass:map';
2
2
  @use './components/forms';
3
+ @use '../variables/color';
4
+ @use '../functions/color' as color-fn;
3
5
 
4
6
  @import './../svg-icon-map';
5
7
 
@@ -9,7 +11,8 @@ $svg-post-path: "'%3E%3C/path%3E%3C/svg%3E";
9
11
  $svg-pre-colored-icon-map: () !default;
10
12
 
11
13
  $svg-pi-success-name: 'success';
12
- $svg-pi-success-path: "'%3E%3C/path%3E%3Ccircle fill='%232C911C' cx='15.9' cy='16.2' r='10.9'/%3E%3Cpolygon fill='%23FFFFFF' points='21.2,11.2 22.2,12.3 14.4,20.1 10.2,15.9 11.3,14.9 14.4,18 '/%3E%3Cpath d='";
14
+ $svg-pi-success-path: "'%3E%3C/path%3E%3Ccircle fill='" + color-fn.encode-uri-color(color.$success) +
15
+ "' cx='15.9' cy='16.2' r='10.9'/%3E%3Cpolygon fill='%23FFFFFF' points='21.2,11.2 22.2,12.3 14.4,20.1 10.2,15.9 11.3,14.9 14.4,18 '/%3E%3Cpath d='";
13
16
  $svg-pre-colored-icon-map: map.merge(
14
17
  (
15
18
  $svg-pi-success-name: $svg-pi-success-path,