@swisspost/design-system-styles 5.0.0-alpha.7

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 (188) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +40 -0
  3. package/basics.css +29 -0
  4. package/basics.scss +9 -0
  5. package/components/_index.scss +45 -0
  6. package/components/accordion.scss +94 -0
  7. package/components/alert.scss +214 -0
  8. package/components/badge.scss +85 -0
  9. package/components/base.scss +6 -0
  10. package/components/breadcrumb.scss +42 -0
  11. package/components/button-group.scss +69 -0
  12. package/components/button.scss +213 -0
  13. package/components/card.scss +211 -0
  14. package/components/carousel.scss +176 -0
  15. package/components/close.scss +33 -0
  16. package/components/datatable.scss +196 -0
  17. package/components/datepicker.scss +232 -0
  18. package/components/dropdown.scss +83 -0
  19. package/components/floating-label.scss +77 -0
  20. package/components/fonts.scss +27 -0
  21. package/components/form-check.scss +236 -0
  22. package/components/form-feedback.scss +32 -0
  23. package/components/form-range.scss +111 -0
  24. package/components/form-select.scss +31 -0
  25. package/components/forms.scss +54 -0
  26. package/components/grid.scss +100 -0
  27. package/components/icons.scss +60 -0
  28. package/components/intranet-header/_icon.scss +6 -0
  29. package/components/intranet-header/_language-chooser.scss +40 -0
  30. package/components/intranet-header/_logo.scss +54 -0
  31. package/components/intranet-header/_nav-overflow.scss +56 -0
  32. package/components/intranet-header/_scaffolding.scss +96 -0
  33. package/components/intranet-header/_searchbox.scss +32 -0
  34. package/components/intranet-header/_settings.scss +23 -0
  35. package/components/intranet-header/_sidebar.scss +118 -0
  36. package/components/intranet-header/_top-navigation.scss +109 -0
  37. package/components/intranet-header/index.scss +17 -0
  38. package/components/list-group.scss +166 -0
  39. package/components/modal.scss +62 -0
  40. package/components/offcanvas.scss +5 -0
  41. package/components/pagination.scss +79 -0
  42. package/components/popover.scss +21 -0
  43. package/components/product-card.scss +74 -0
  44. package/components/progress.scss +28 -0
  45. package/components/reboot.scss +10 -0
  46. package/components/root.scss +11 -0
  47. package/components/sizing.scss +101 -0
  48. package/components/spinner.scss +71 -0
  49. package/components/stepper.scss +193 -0
  50. package/components/subnavigation.scss +138 -0
  51. package/components/tables.scss +16 -0
  52. package/components/tabs.scss +212 -0
  53. package/components/timepicker.scss +123 -0
  54. package/components/toast.scss +187 -0
  55. package/components/tooltip.scss +23 -0
  56. package/components/topic-teaser.scss +186 -0
  57. package/components/transitions.scss +4 -0
  58. package/components/type.scss +131 -0
  59. package/components/utilities.scss +98 -0
  60. package/core.css +0 -0
  61. package/core.scss +5 -0
  62. package/functions/_color.scss +55 -0
  63. package/functions/_icons.scss +71 -0
  64. package/functions/_index.scss +5 -0
  65. package/functions/_list.scss +22 -0
  66. package/functions/_sizing.scss +103 -0
  67. package/functions/_utilities.scss +66 -0
  68. package/index.css +75 -0
  69. package/index.scss +8 -0
  70. package/intranet.css +75 -0
  71. package/intranet.scss +6 -0
  72. package/layouts/portal/_grid.scss +80 -0
  73. package/layouts/portal/_subnavigation.scss +5 -0
  74. package/layouts/portal/_type.scss +83 -0
  75. package/layouts/portal/_variables.scss +8 -0
  76. package/layouts/portal/index.scss +5 -0
  77. package/lic/_bootstrap-license.scss +29 -0
  78. package/mixins/_animation.scss +48 -0
  79. package/mixins/_badge.scss +22 -0
  80. package/mixins/_button.scss +57 -0
  81. package/mixins/_color.scss +15 -0
  82. package/mixins/_form-checks.scss +80 -0
  83. package/mixins/_forms.scss +110 -0
  84. package/mixins/_icons.scss +38 -0
  85. package/mixins/_index.scss +8 -0
  86. package/mixins/_scroll-shadows.scss +17 -0
  87. package/mixins/_size.scss +65 -0
  88. package/mixins/_type.scss +54 -0
  89. package/mixins/_utilities.scss +79 -0
  90. package/package.json +76 -0
  91. package/placeholders/_button.scss +25 -0
  92. package/placeholders/_color.scss +71 -0
  93. package/placeholders/_dropdown.scss +11 -0
  94. package/placeholders/_index.scss +3 -0
  95. package/placeholders/_notifications.scss +128 -0
  96. package/placeholders/_text.scss +158 -0
  97. package/placeholders/badge.scss +61 -0
  98. package/themes/bootstrap/_accordion.scss +2 -0
  99. package/themes/bootstrap/_alert.scss +2 -0
  100. package/themes/bootstrap/_badge.scss +2 -0
  101. package/themes/bootstrap/_breadcrumbs.scss +2 -0
  102. package/themes/bootstrap/_button-group.scss +2 -0
  103. package/themes/bootstrap/_buttons.scss +3 -0
  104. package/themes/bootstrap/_card.scss +2 -0
  105. package/themes/bootstrap/_carousel.scss +2 -0
  106. package/themes/bootstrap/_close.scss +2 -0
  107. package/themes/bootstrap/_containers.scss +2 -0
  108. package/themes/bootstrap/_dropdown.scss +2 -0
  109. package/themes/bootstrap/_forms.scss +9 -0
  110. package/themes/bootstrap/_grid.scss +2 -0
  111. package/themes/bootstrap/_images.scss +2 -0
  112. package/themes/bootstrap/_list-group.scss +2 -0
  113. package/themes/bootstrap/_modal.scss +2 -0
  114. package/themes/bootstrap/_nav.scss +2 -0
  115. package/themes/bootstrap/_navbar.scss +2 -0
  116. package/themes/bootstrap/_offcanvas.scss +2 -0
  117. package/themes/bootstrap/_overrides-color.scss +45 -0
  118. package/themes/bootstrap/_overrides-features.scss +18 -0
  119. package/themes/bootstrap/_overrides-variables.scss +40 -0
  120. package/themes/bootstrap/_overrides.scss +5 -0
  121. package/themes/bootstrap/_pagination.scss +2 -0
  122. package/themes/bootstrap/_popover.scss +2 -0
  123. package/themes/bootstrap/_progress.scss +2 -0
  124. package/themes/bootstrap/_reboot.scss +2 -0
  125. package/themes/bootstrap/_root.scss +2 -0
  126. package/themes/bootstrap/_spinners.scss +2 -0
  127. package/themes/bootstrap/_tables.scss +2 -0
  128. package/themes/bootstrap/_toasts.scss +2 -0
  129. package/themes/bootstrap/_tooltip.scss +2 -0
  130. package/themes/bootstrap/_transitions.scss +2 -0
  131. package/themes/bootstrap/_type.scss +6 -0
  132. package/themes/bootstrap/_utilities.scss +9 -0
  133. package/themes/bootstrap/forms/_floating-labels.scss +2 -0
  134. package/themes/bootstrap/forms/_form-check.scss +2 -0
  135. package/themes/bootstrap/forms/_form-control.scss +2 -0
  136. package/themes/bootstrap/forms/_form-range.scss +2 -0
  137. package/themes/bootstrap/forms/_form-select.scss +2 -0
  138. package/themes/bootstrap/forms/_form-text.scss +2 -0
  139. package/themes/bootstrap/forms/_input-group.scss +2 -0
  140. package/themes/bootstrap/forms/_labels.scss +2 -0
  141. package/themes/bootstrap/forms/_validation.scss +2 -0
  142. package/variables/_animation.scss +36 -0
  143. package/variables/_breakpoints.scss +9 -0
  144. package/variables/_color.scss +119 -0
  145. package/variables/_commons.scss +56 -0
  146. package/variables/_grid.scss +27 -0
  147. package/variables/_icons.scss +4600 -0
  148. package/variables/_index.scss +14 -0
  149. package/variables/_options.scss +5 -0
  150. package/variables/_spacing.scss +181 -0
  151. package/variables/_type.scss +204 -0
  152. package/variables/components/_accordion.scss +38 -0
  153. package/variables/components/_alert.scss +51 -0
  154. package/variables/components/_badge.scss +44 -0
  155. package/variables/components/_breadcrumbs.scss +21 -0
  156. package/variables/components/_button.scss +137 -0
  157. package/variables/components/_card.scss +30 -0
  158. package/variables/components/_carousel.scss +27 -0
  159. package/variables/components/_close.scss +19 -0
  160. package/variables/components/_code.scss +14 -0
  161. package/variables/components/_datatable.scss +53 -0
  162. package/variables/components/_datepicker.scss +22 -0
  163. package/variables/components/_detail-summary.scss +12 -0
  164. package/variables/components/_dropdowns.scss +30 -0
  165. package/variables/components/_figures.scss +6 -0
  166. package/variables/components/_form-check.scss +63 -0
  167. package/variables/components/_form-feedback.scss +25 -0
  168. package/variables/components/_form-select.scss +13 -0
  169. package/variables/components/_form-switch.scss +38 -0
  170. package/variables/components/_forms.scss +129 -0
  171. package/variables/components/_index.scss +30 -0
  172. package/variables/components/_intranet-header.scss +9 -0
  173. package/variables/components/_list-group.scss +29 -0
  174. package/variables/components/_modals.scss +68 -0
  175. package/variables/components/_nav.scss +55 -0
  176. package/variables/components/_navbar.scss +44 -0
  177. package/variables/components/_pagination.scss +42 -0
  178. package/variables/components/_paragraph.scss +6 -0
  179. package/variables/components/_popovers.scss +28 -0
  180. package/variables/components/_progress-bars.scss +16 -0
  181. package/variables/components/_spinners.scss +16 -0
  182. package/variables/components/_stepper.scss +36 -0
  183. package/variables/components/_subnavigation.scss +32 -0
  184. package/variables/components/_tables.scss +39 -0
  185. package/variables/components/_thumbnails.scss +11 -0
  186. package/variables/components/_toasts.scss +18 -0
  187. package/variables/components/_tooltips.scss +18 -0
  188. package/variables/components/_topic-teaser.scss +27 -0
package/intranet.scss ADDED
@@ -0,0 +1,6 @@
1
+ @forward './variables/options';
2
+
3
+ @use './lic/bootstrap-license';
4
+
5
+ @use 'components';
6
+ @use 'components/intranet-header';
@@ -0,0 +1,80 @@
1
+ @use 'sass:map';
2
+
3
+ @use '../../themes/bootstrap/overrides' as *;
4
+
5
+ @use '../../variables/grid';
6
+ @use '../../variables/commons';
7
+ @use './variables' as portal-variables;
8
+
9
+ .container-fluid {
10
+ max-width: map.get(grid.$container-max-widths, xs);
11
+ padding-right: 0;
12
+ padding-left: 0;
13
+
14
+ &:not(.allow-overflow) {
15
+ overflow: hidden; // hides scrollbar
16
+ }
17
+ }
18
+
19
+ // px-gutters class is used to manipulate border collapse in product-cards
20
+ .row.px-gutters {
21
+ margin-right: -(commons.$border-width);
22
+ margin-bottom: -(commons.$border-width);
23
+ margin-left: 0;
24
+
25
+ > .col,
26
+ > [class*='col-'] {
27
+ padding-right: commons.$border-width;
28
+ padding-bottom: commons.$border-width;
29
+ padding-left: 0;
30
+ }
31
+ }
32
+
33
+ // Overwrites gutter on rg-sized screens and bigger
34
+ @include media-breakpoint-up(rg) {
35
+ .col,
36
+ [class*='col-'] {
37
+ padding-right: portal-variables.$grid-gutter-width-rg * 0.5;
38
+ padding-left: portal-variables.$grid-gutter-width-rg * 0.5;
39
+ }
40
+
41
+ .row {
42
+ margin-right: -(portal-variables.$grid-gutter-width-rg * 0.5);
43
+ margin-left: -(portal-variables.$grid-gutter-width-rg * 0.5);
44
+
45
+ &.no-gutters {
46
+ margin-right: 0;
47
+ margin-left: 0;
48
+ }
49
+ }
50
+
51
+ .vertical-gutters {
52
+ margin-bottom: -(portal-variables.$grid-gutter-width-rg);
53
+
54
+ > .col,
55
+ > [class*='col-'] {
56
+ padding-bottom: portal-variables.$grid-gutter-width-rg;
57
+ }
58
+ }
59
+ }
60
+
61
+ @each $breakpoint in grid.$grid-breakpoints-list {
62
+ .container-fluid-#{$breakpoint} {
63
+ @include media-breakpoint-only($breakpoint) {
64
+ padding-right: 0;
65
+ padding-left: 0;
66
+ }
67
+ }
68
+ }
69
+
70
+ .container-reset-right-rg-up {
71
+ @include media-breakpoint-up(rg) {
72
+ margin-left: 0;
73
+ }
74
+ }
75
+
76
+ .container-reset-left-rg-up {
77
+ @include media-breakpoint-up(rg) {
78
+ margin-right: 0;
79
+ }
80
+ }
@@ -0,0 +1,5 @@
1
+ .subnavigation-list {
2
+ width: 100%;
3
+ margin: 0;
4
+ padding: 0;
5
+ }
@@ -0,0 +1,83 @@
1
+ @use 'sass:map';
2
+
3
+ @use '../../themes/bootstrap/overrides' as *;
4
+
5
+ @use '../../variables/spacing';
6
+ @use '../../variables/type';
7
+ @use '../../placeholders/text';
8
+
9
+ @mixin styles {
10
+ h1,
11
+ .h1,
12
+ h2,
13
+ .h2 {
14
+ // H1 and H2 have hardcoded margins instead of textsize base margins
15
+ margin-bottom: map.get(spacing.$post-sizes, 'small-large');
16
+
17
+ @include media-breakpoint-up(md) {
18
+ margin-bottom: map.get(spacing.$post-sizes, 'large');
19
+ }
20
+ }
21
+
22
+ h1,
23
+ .h1 {
24
+ @extend %font-curve-big;
25
+ }
26
+
27
+ h2,
28
+ .h2 {
29
+ @extend %font-curve-large;
30
+ }
31
+
32
+ h3,
33
+ .h3,
34
+ h4,
35
+ .h4 {
36
+ @extend %font-curve-medium;
37
+ }
38
+
39
+ h3,
40
+ .h3,
41
+ h4,
42
+ .h4,
43
+ p {
44
+ @extend %text-bottom-spacer;
45
+ }
46
+
47
+ h3,
48
+ .h3,
49
+ h4,
50
+ .h4,
51
+ h5,
52
+ .h5 {
53
+ margin-top: map.get(spacing.$post-sizes, 'bigger-big');
54
+ }
55
+
56
+ h5,
57
+ .h5,
58
+ p {
59
+ @extend %font-curve-regular;
60
+ }
61
+
62
+ p {
63
+ margin-top: 0;
64
+ font-weight: type.$font-weight-light;
65
+ }
66
+
67
+ h5,
68
+ .h5 {
69
+ margin-bottom: 0;
70
+ }
71
+
72
+ h3,
73
+ .h3,
74
+ h5,
75
+ .h5 {
76
+ font-weight: type.$font-weight-bold;
77
+ }
78
+
79
+ .lead {
80
+ @extend %font-curve-bigger-regular;
81
+ @extend %text-bottom-spacer;
82
+ }
83
+ }
@@ -0,0 +1,8 @@
1
+ @use 'sass:map';
2
+ @use '../../variables/color';
3
+
4
+ // DO NOT ADD TO THIS FILE! ALL THESE VARIABLES WILL BE REMOVED.
5
+ // This file contains legacy variables that in the near future should no longer
6
+ // be used but are currently necessary
7
+
8
+ $grid-gutter-width-rg: 16px;
@@ -0,0 +1,5 @@
1
+ @use './grid';
2
+ @use './subnavigation';
3
+ @use './type';
4
+
5
+ @include type.styles;
@@ -0,0 +1,29 @@
1
+ /*!
2
+ * Bootstrap Utilities v5.1.3 (https://getbootstrap.com/)
3
+ * Copyright 2011-2021 The Bootstrap Authors
4
+ * Copyright 2011-2021 Twitter, Inc.
5
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
6
+
7
+ * The MIT License (MIT)
8
+
9
+ * Copyright (c) 2011-2020 Twitter, Inc.
10
+ * Copyright (c) 2011-2020 The Bootstrap Authors
11
+
12
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ * of this software and associated documentation files (the "Software"), to deal
14
+ * in the Software without restriction, including without limitation the rights
15
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ * copies of the Software, and to permit persons to whom the Software is
17
+ * furnished to do so, subject to the following conditions:
18
+
19
+ * The above copyright notice and this permission notice shall be included in
20
+ * all copies or substantial portions of the Software.
21
+
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28
+ * THE SOFTWARE.
29
+ */
@@ -0,0 +1,48 @@
1
+ @use '../themes/bootstrap/overrides' as *;
2
+ @use '../functions/icons';
3
+
4
+ @mixin hover-animation(
5
+ $animation-item-size,
6
+ $animation-distance,
7
+ $animation-container-height,
8
+ $animation-item-offset: 0
9
+ ) {
10
+ &:hover,
11
+ &:focus {
12
+ &:not(:disabled):not(.disabled) > span {
13
+ transform: translate(-$animation-distance);
14
+
15
+ &::after {
16
+ transform: translate($animation-distance);
17
+ }
18
+ }
19
+ }
20
+
21
+ > span {
22
+ padding: 0 $animation-distance;
23
+ transform: translate(0); // Needed as a fix for Firefox.
24
+
25
+ &::after {
26
+ top: $animation-item-offset;
27
+ width: $animation-item-size;
28
+ height: $animation-container-height;
29
+ transform: translate(0); // Needed as a fix for Firefox.
30
+ }
31
+ }
32
+ }
33
+
34
+ @mixin hover-animation-svg-icon($color, $icon-name, $stroke-width: null) {
35
+ &:not(:disabled):not(.disabled) > span {
36
+ &::after {
37
+ @if ($stroke-width == null) {
38
+ background-image: url(icons.get-colored-svg-url($icon-name, $color));
39
+ } @else {
40
+ background-image: url(icons.add-stroke-color(
41
+ icons.get-colored-svg-url($icon-name, $color),
42
+ $color,
43
+ $stroke-width
44
+ ));
45
+ }
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,22 @@
1
+ @use '../variables/components/badge';
2
+ @use '../mixins/utilities';
3
+
4
+ @mixin badge-hover-state {
5
+ color: badge.$badge-hover-color;
6
+ background-color: badge.$badge-hover-bg-color;
7
+ border-color: transparent;
8
+
9
+ @include utilities.high-contrast-mode() {
10
+ border-color: Highlight;
11
+ }
12
+ }
13
+
14
+ @mixin badge-active-state {
15
+ color: badge.$badge-active-color;
16
+ background-color: badge.$badge-active-bg-color;
17
+ border-color: transparent;
18
+
19
+ > .badge {
20
+ background-color: badge.$badge-nested-active-bg-color;
21
+ }
22
+ }
@@ -0,0 +1,57 @@
1
+ @use 'sass:map';
2
+
3
+ @use '../variables/components/button';
4
+ @use '../variables/type';
5
+ @use '../variables/color';
6
+ @use '../placeholders/color' as color-ph;
7
+ @use '../functions/color' as color-fn;
8
+ @use 'utilities';
9
+
10
+ @mixin reset-button {
11
+ padding: 0;
12
+ overflow: visible;
13
+ border: 0;
14
+ background: none;
15
+ color: inherit;
16
+ font: inherit;
17
+ line-height: normal;
18
+ user-select: none;
19
+ appearance: button; // for input
20
+ }
21
+
22
+ @mixin button-size($size: md) {
23
+ min-height: map.get(button.$btn-height-map, $size);
24
+ padding: 0 map.get(button.$btn-padding-x-map, $size);
25
+ font-size: map.get(button.$btn-font-size-map, $size);
26
+ gap: map.get(button.$btn-padding-x-map, $size) * 0.5;
27
+
28
+ > .pi {
29
+ width: map.get(button.$btn-icon-size-map, $size);
30
+ height: map.get(button.$btn-icon-size-map, $size);
31
+ }
32
+ }
33
+
34
+ @mixin icon-button($size: md) {
35
+ // Padding for icon buttons is (button-height - font-size) / 2
36
+ $icon-size: map.get(button.$btn-icon-size-map, $size);
37
+ $button-height: map.get(button.$btn-height-map, $size);
38
+ $padding-y: ($button-height - $icon-size) * 0.5 - button.$input-btn-focus-width;
39
+ min-width: $button-height;
40
+ padding-right: $padding-y;
41
+ padding-left: $padding-y;
42
+ }
43
+
44
+ @mixin button-color-variant($name, $color) {
45
+ .btn-#{$name} {
46
+ border-color: transparent;
47
+ background-color: $color;
48
+
49
+ @if (color-fn.get-contrast-color($color) == #fff) {
50
+ color: color.$white;
51
+ }
52
+
53
+ @include utilities.not-disabled-focus-hover() {
54
+ background-color: darken($color, 10%);
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,15 @@
1
+ @use '../variables/color';
2
+
3
+ // Selector for styles to be applied on dark backgrounds
4
+ @mixin on-dark-background($contains: false) {
5
+ @if $contains == true {
6
+ &:is(#{color.$dark-backgrounds}),
7
+ :is(#{color.$dark-backgrounds}) & {
8
+ @content;
9
+ }
10
+ } @else {
11
+ :is(#{color.$dark-backgrounds}) & {
12
+ @content;
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,80 @@
1
+ @use '../functions/icons';
2
+ @use '../variables/color';
3
+ @use '../variables/components/form-check';
4
+
5
+ @mixin form-check-variant($color, $color-hover, $color-label-hover: $color-hover) {
6
+ .form-check-input {
7
+ border-color: $color;
8
+ }
9
+
10
+ .form-check-input[type='radio']:checked,
11
+ .form-check-input[type='checkbox']:checked,
12
+ .form-check-input[type='checkbox']:indeterminate {
13
+ @include form-check-color($color);
14
+ }
15
+
16
+ .form-check-input:not(:hover),
17
+ .form-check-input:disabled {
18
+ @include form-check-icons($color);
19
+ }
20
+
21
+ .form-check-input[type='radio']:hover:not(:disabled),
22
+ .form-check-input[type='checkbox']:hover:not(:disabled) {
23
+ @include form-check-color($color-hover, $color-label-hover);
24
+ @include form-check-icons($color-hover);
25
+ }
26
+
27
+ .form-check-input[type='radio']:focus,
28
+ .form-check-input[type='checkbox']:focus {
29
+ border-color: $color;
30
+ box-shadow: 0 0 0 form-check.$form-check-input-focus-width rgba($color, 0.25);
31
+ }
32
+
33
+ .was-validated .form-check-input:valid ~ .form-check-label,
34
+ .form-check-input.is-valid ~ .form-check-label,
35
+ .was-validated .form-check-input:invalid ~ .form-check-label,
36
+ .form-check-input.is-invalid ~ .form-check-label {
37
+ color: $color;
38
+ }
39
+
40
+ .was-validated .form-check-input:invalid,
41
+ .form-check-input.is-invalid,
42
+ .was-validated .form-check-input:invalid:hover,
43
+ .form-check-input.is-invalid:hover {
44
+ &:not(:checked) {
45
+ border-color: color.$error;
46
+ background-color: color.$white;
47
+ }
48
+ }
49
+ }
50
+
51
+ @mixin form-check-color($color, $color-label: $color) {
52
+ border-color: $color;
53
+
54
+ ~ .form-check-label {
55
+ color: var(--post-contrast-color);
56
+ }
57
+ }
58
+
59
+ @mixin form-check-icons($color) {
60
+ &[type='radio']:checked {
61
+ background-image: url(icons.add-fill-color(
62
+ form-check.$form-check-radio-checked-bg-icon,
63
+ $color
64
+ ));
65
+ }
66
+
67
+ &[type='checkbox']:checked {
68
+ background-image: url(icons.get-colored-svg-url(
69
+ form-check.$form-check-input-checked-bg-icon,
70
+ $color
71
+ ));
72
+ }
73
+
74
+ &[type='checkbox']:indeterminate {
75
+ background-image: url(icons.get-colored-svg-url(
76
+ form-check.$form-check-input-indeterminate-bg-icon,
77
+ $color
78
+ ));
79
+ }
80
+ }
@@ -0,0 +1,110 @@
1
+ @use '../variables/color';
2
+ @use '../variables/type';
3
+ @use '../variables/components/form-feedback';
4
+ @use '../variables/components/forms';
5
+ @use '../variables/components/tooltips';
6
+ @use '../mixins/utilities';
7
+
8
+ // Placeholder in input fields
9
+
10
+ @mixin placeholder() {
11
+ &::placeholder {
12
+ @content;
13
+ }
14
+
15
+ // For very old Edge
16
+ /* stylelint-disable */
17
+ &::input-placeholder {
18
+ @content;
19
+ }
20
+ /* stylelint-enable */
21
+ }
22
+
23
+ // override
24
+ /// The entire mixin had to be overriden to adjust the feedback on custom controls.
25
+ /// For the most part, it is exactly like the mixin.
26
+ @mixin form-validation-state($state, $color, $icon) {
27
+ .#{$state}-feedback {
28
+ display: none;
29
+ width: 100%;
30
+ margin-top: form-feedback.$form-feedback-margin-top;
31
+ color: $color;
32
+ font-size: form-feedback.$form-feedback-font-size;
33
+ }
34
+
35
+ .#{$state}-tooltip {
36
+ display: none;
37
+ position: absolute;
38
+ z-index: 5;
39
+ top: 100%;
40
+ max-width: 100%; // Contain to parent when possible
41
+ margin-top: 0.1rem;
42
+ padding: tooltips.$tooltip-padding-y tooltips.$tooltip-padding-x;
43
+ border-radius: tooltips.$tooltip-border-radius;
44
+ color: color-contrast($color);
45
+ font-size: tooltips.$tooltip-font-size;
46
+ line-height: type.$line-height-base;
47
+
48
+ /* Keeping borders gray while maintaining a green background on tooltips */
49
+ @if ($state == 'valid') {
50
+ background-color: rgba(form-feedback.$form-feedback-valid-bg, tooltips.$tooltip-opacity);
51
+ } @else {
52
+ background-color: rgba($color, tooltips.$tooltip-opacity);
53
+ }
54
+ }
55
+
56
+ .form-control,
57
+ .form-select {
58
+ .was-validated &:#{$state},
59
+ &.is-#{$state} {
60
+ border-color: $color;
61
+
62
+ &:focus {
63
+ border-color: $color;
64
+ box-shadow: 0 0 0 forms.$input-focus-width rgba($color, 0.25);
65
+ }
66
+
67
+ ~ .#{$state}-feedback,
68
+ ~ .#{$state}-tooltip {
69
+ display: block;
70
+ }
71
+ }
72
+ }
73
+
74
+ .form-check-input {
75
+ .was-validated &:#{$state},
76
+ &.is-#{$state} {
77
+ ~ .form-check-label {
78
+ color: $color;
79
+ }
80
+
81
+ ~ .#{$state}-feedback,
82
+ ~ .#{$state}-tooltip {
83
+ display: block;
84
+ }
85
+ }
86
+ }
87
+ }
88
+
89
+ @mixin icon-placement {
90
+ padding-right: form-feedback.$form-feedback-icon-offset + form-feedback.$form-feedback-icon-size;
91
+ background-repeat: no-repeat;
92
+ background-position: calc(100% - #{form-feedback.$form-feedback-icon-offset}) center;
93
+ }
94
+
95
+ @mixin form-control-rg {
96
+ height: forms.$input-height-rg;
97
+ padding: forms.$input-padding-y-rg forms.$input-padding-x-rg;
98
+ font-size: type.$font-size-regular;
99
+ line-height: forms.$input-line-height-rg;
100
+ }
101
+
102
+ @mixin focus-outline {
103
+ outline: none;
104
+ outline-offset: forms.$input-focus-outline-thickness;
105
+
106
+ /* Compatibility with button-group */
107
+ &:is(:focus-visible, :focus-within) {
108
+ outline: forms.$input-focus-outline-thickness solid var(--post-contrast-color);
109
+ }
110
+ }
@@ -0,0 +1,38 @@
1
+ @use 'sass:map';
2
+ @use 'sass:meta';
3
+
4
+ @use '../variables/type';
5
+ @use '../variables/color';
6
+ @use '../variables/components/button';
7
+ @use '../functions/icons' as icon-fn;
8
+ @use '../mixins/utilities';
9
+
10
+ @mixin pi($name, $color: color.$black) {
11
+ $type: meta.type-of($color);
12
+ $final-color: $color;
13
+
14
+ @if ($type != color) {
15
+ $final-color: map.get(color.$background-colors, $color);
16
+
17
+ @if (not $final-color) {
18
+ $valid-colors: map.keys(color.$background-colors);
19
+
20
+ @error "Error in Mixin 'pi(name, color?)'. Color '#{$color}' is not available. Please choose one of the following: #{$valid-colors}.";
21
+ }
22
+ }
23
+ border-color: $final-color;
24
+ background-image: url(icon-fn.get-colored-svg-url($name, $final-color));
25
+
26
+ // set icon to white on hcm
27
+ @include utilities.high-contrast-mode() {
28
+ @if ($final-color == color.$black) {
29
+ filter: invert(100%);
30
+ } @else {
31
+ background-image: url(icon-fn.get-colored-svg-url($name, color.$white));
32
+ }
33
+ }
34
+ }
35
+
36
+ @mixin pi-pre($name) {
37
+ background-image: url(icon-fn.get-pre-colored-svg-url($name));
38
+ }
@@ -0,0 +1,8 @@
1
+ @forward 'animation';
2
+ @forward 'button';
3
+ @forward 'form-checks';
4
+ @forward 'forms';
5
+ @forward 'icons';
6
+ @forward 'size';
7
+ @forward 'type';
8
+ @forward 'utilities';
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * Copyright 2021 by Swiss Post, Information Technology
3
+ */
4
+ @use '../variables/color';
5
+
6
+ @mixin scroll-shadows-y($background-color: color.$white) {
7
+ $shadow-top: linear-gradient(rgba(color.$black, 0.2), rgba(color.$black, 0.1) 25%, transparent)
8
+ center top/100% 4px no-repeat scroll;
9
+ $shadow-bottom: linear-gradient(transparent, rgba(color.$black, 0.1) 75%, rgba(color.$black, 0.2))
10
+ center bottom/100% 4px no-repeat scroll;
11
+ $shadow-cover-top: linear-gradient(#{$background-color}, #{$background-color}) center top/100% 4px
12
+ no-repeat local;
13
+ $shadow-cover-bottom: linear-gradient(#{$background-color}, #{$background-color}) center
14
+ bottom/100% 4px no-repeat local;
15
+
16
+ background: $shadow-cover-top, $shadow-top, $shadow-cover-bottom, $shadow-bottom;
17
+ }
@@ -0,0 +1,65 @@
1
+ @use 'sass:map';
2
+ @use 'sass:string';
3
+
4
+ @use '../themes/bootstrap/overrides' as *;
5
+
6
+ @use '../variables/spacing';
7
+ @use '../functions/utilities';
8
+
9
+ @mixin bezel-small() {
10
+ padding: map.get(spacing.$post-sizes, 'mini') map.get(spacing.$post-sizes, 'regular');
11
+ }
12
+
13
+ @mixin bezel-small-regular() {
14
+ padding: map.get(spacing.$post-sizes, 'small-regular') map.get(spacing.$post-sizes, 'regular');
15
+ }
16
+
17
+ @mixin bezel-regular() {
18
+ padding: map.get(spacing.$post-sizes, 'regular');
19
+ }
20
+
21
+ @mixin bezel-bigger-regular() {
22
+ padding: map.get(spacing.$post-sizes, 'small-large');
23
+ }
24
+
25
+ @mixin bezel-medium() {
26
+ padding: map.get(spacing.$post-sizes, 'small-large') map.get(spacing.$post-sizes, 'large');
27
+ }
28
+
29
+ @mixin bezel-large() {
30
+ padding: map.get(spacing.$post-sizes, 'big');
31
+ }
32
+
33
+ @mixin bezel-big() {
34
+ padding: map.get(spacing.$post-sizes, 'bigger-big');
35
+ }
36
+
37
+ /**
38
+ * Generate responsive size properties for things like height, width, margin, padding, etc.
39
+ * @param $curve-size One of the curve sizes predefined at https://www.experience-hub.ch/document/2307#/grundlagen-web/abstaende
40
+ * @param $property Property key (height, width, padding, margin, top, etc.)
41
+ * @param $template Value template string used for shorthand declarations like padding ("$value auto" = padding: 1rem auto)
42
+ */
43
+ @mixin responsive-size($curve-size: 'regular', $property-key: 'padding', $template: '$value') {
44
+ $curve: map.get(spacing.$size-curves, $curve-size);
45
+
46
+ @if ($curve) {
47
+ $cache: '';
48
+
49
+ @each $key, $value in $curve {
50
+ @if ($key == 'xs') {
51
+ #{$property-key}: string.unquote(utilities.replace($template, '$value', $value));
52
+ } @else {
53
+ // Don't write unnecessary media queries
54
+ @if ($cache != $value) {
55
+ @include media-breakpoint-up($key) {
56
+ #{$property-key}: string.unquote(utilities.replace($template, '$value', $value));
57
+ }
58
+ }
59
+ }
60
+ $cache: $value;
61
+ }
62
+ } @else {
63
+ @warn "@mixin responsive-size: Can't find $curve-size: " + $curve-size;
64
+ }
65
+ }