@swisspost/design-system-styles 6.2.5 → 6.3.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/_svg-icon-map.scss +8 -4
- package/basics.css +3 -1
- package/components/_index.scss +1 -0
- package/components/accordion.scss +70 -57
- package/components/alert.scss +84 -158
- package/components/badge.scss +0 -1
- package/components/button.scss +13 -18
- package/components/close.scss +12 -23
- package/components/form-textarea.scss +12 -0
- package/components/modal.scss +20 -12
- package/components/stepper.scss +3 -7
- package/components/toast.scss +65 -129
- package/components/type.scss +4 -0
- package/components/utilities.scss +2 -12
- package/functions/_icons.scss +6 -2
- package/index.css +8 -16
- package/intranet.css +9 -17
- package/mixins/_button.scss +5 -2
- package/mixins/_color.scss +16 -0
- package/mixins/_icons.scss +11 -3
- package/mixins/_index.scss +4 -0
- package/mixins/_notification.scss +112 -0
- package/package.json +13 -13
- package/placeholders/_button.scss +17 -5
- package/placeholders/_close.scss +33 -0
- package/placeholders/_index.scss +1 -1
- package/placeholders/_notification.scss +13 -0
- package/placeholders/badge.scss +0 -4
- package/schematics/migrations/general/classes/rtl.js +25 -13
- package/schematics/migrations/general/classes/rtl.js.map +1 -1
- package/themes/bootstrap/_overrides-variables.scss +2 -3
- package/variables/_commons.scss +1 -1
- package/variables/_icons.scss +1 -0
- package/variables/_type.scss +1 -0
- package/variables/components/_accordion.scss +32 -14
- package/variables/components/_badge.scss +2 -2
- package/variables/components/_button.scss +22 -12
- package/variables/components/_close.scss +8 -4
- package/variables/components/_index.scss +2 -3
- package/variables/components/{_modals.scss → _modal.scss} +3 -3
- package/variables/components/_notification.scss +84 -0
- package/variables/components/_stepper.scss +3 -3
- package/placeholders/_notifications.scss +0 -128
- package/variables/components/_alert.scss +0 -51
- package/variables/components/_toasts.scss +0 -18
package/components/modal.scss
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
@use './../lic/bootstrap-license';
|
|
4
4
|
@use './../themes/bootstrap/modal' as bm;
|
|
5
|
-
@use './../themes/bootstrap/close' as bc;
|
|
6
5
|
@use './../themes/bootstrap/core' as *;
|
|
7
6
|
|
|
8
|
-
@use './../mixins/icons' as icon-mixin;
|
|
9
7
|
@use './../mixins/scroll-shadows' as scroll-shadows-mixin;
|
|
10
|
-
|
|
8
|
+
|
|
9
|
+
@use './../variables/commons';
|
|
10
|
+
@use './../variables/components/modal';
|
|
11
11
|
|
|
12
12
|
.modal-content {
|
|
13
13
|
border: 0;
|
|
14
|
-
box-shadow:
|
|
14
|
+
box-shadow: commons.$box-shadow;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
post-ngb-modal-content {
|
|
@@ -20,8 +20,8 @@ post-ngb-modal-content {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.modal-body {
|
|
23
|
-
@include scroll-shadows-mixin.scroll-shadows-y(
|
|
24
|
-
padding:
|
|
23
|
+
@include scroll-shadows-mixin.scroll-shadows-y(modal.$modal-content-bg);
|
|
24
|
+
padding: modal.$modal-body-padding;
|
|
25
25
|
overflow-y: auto;
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -30,6 +30,14 @@ post-ngb-modal-content {
|
|
|
30
30
|
border: 0;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
.modal-header .btn-close {
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: 0;
|
|
36
|
+
right: 0;
|
|
37
|
+
padding: 0;
|
|
38
|
+
margin: modal.$modal-btn-close-margin;
|
|
39
|
+
}
|
|
40
|
+
|
|
33
41
|
.modal-title:focus {
|
|
34
42
|
outline: none; // Removes focus styles when you manually set focus to title with ngbAutofocus https://ng-github.io/#/components/modal/examples#focus
|
|
35
43
|
}
|
|
@@ -37,26 +45,26 @@ post-ngb-modal-content {
|
|
|
37
45
|
@include media-breakpoint-up(sm) {
|
|
38
46
|
post-ngb-modal-content {
|
|
39
47
|
// prevents the modal from exceeding the height of the screen
|
|
40
|
-
max-height: calc(100vh - #{2 *
|
|
48
|
+
max-height: calc(100vh - #{2 * modal.$modal-dialog-margin-y-sm-up});
|
|
41
49
|
}
|
|
42
50
|
|
|
43
51
|
// Right and left margins are set to "auto" from the sm breakpoint
|
|
44
52
|
// Paddings below ensure minimal margins on medium screens
|
|
45
53
|
.modal-dialog {
|
|
46
|
-
padding-right:
|
|
47
|
-
padding-left:
|
|
54
|
+
padding-right: modal.$modal-dialog-margin;
|
|
55
|
+
padding-left: modal.$modal-dialog-margin;
|
|
48
56
|
}
|
|
49
57
|
}
|
|
50
58
|
|
|
51
59
|
@include media-breakpoint-down(sm) {
|
|
52
60
|
post-ngb-modal-content {
|
|
53
61
|
// make the modal cover the full height available on small screens
|
|
54
|
-
height: calc(100vh - #{2 *
|
|
62
|
+
height: calc(100vh - #{2 * modal.$modal-dialog-margin});
|
|
55
63
|
}
|
|
56
64
|
|
|
57
65
|
.modal-body,
|
|
58
66
|
.modal-header {
|
|
59
|
-
padding-right:
|
|
60
|
-
padding-left:
|
|
67
|
+
padding-right: modal.$modal-header-padding-y;
|
|
68
|
+
padding-left: modal.$modal-header-padding-y;
|
|
61
69
|
}
|
|
62
70
|
}
|
package/components/stepper.scss
CHANGED
|
@@ -109,6 +109,7 @@
|
|
|
109
109
|
text-decoration: none;
|
|
110
110
|
color: stepper.$stepper-link-color;
|
|
111
111
|
transition: color 250ms;
|
|
112
|
+
text-align: center;
|
|
112
113
|
|
|
113
114
|
.stepper-item[aria-current] > & {
|
|
114
115
|
color: stepper.$stepper-link-current-color;
|
|
@@ -116,7 +117,8 @@
|
|
|
116
117
|
font-weight: stepper.$stepper-link-current-font-weight;
|
|
117
118
|
}
|
|
118
119
|
|
|
119
|
-
|
|
120
|
+
@at-root a:hover#{&},
|
|
121
|
+
:focus-visible#{&} {
|
|
120
122
|
color: stepper.$stepper-link-hover-color;
|
|
121
123
|
}
|
|
122
124
|
|
|
@@ -127,12 +129,6 @@
|
|
|
127
129
|
|
|
128
130
|
@include media-breakpoint-down(rg) {
|
|
129
131
|
.stepper-item {
|
|
130
|
-
&[aria-current] .stepper-link {
|
|
131
|
-
position: absolute;
|
|
132
|
-
bottom: 0;
|
|
133
|
-
left: 0;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
132
|
&:not([aria-current]) .stepper-link {
|
|
137
133
|
overflow: hidden;
|
|
138
134
|
white-space: nowrap;
|
package/components/toast.scss
CHANGED
|
@@ -3,27 +3,81 @@
|
|
|
3
3
|
@use './../lic/bootstrap-license';
|
|
4
4
|
@use './../themes/bootstrap/core' as *;
|
|
5
5
|
|
|
6
|
-
@use './../
|
|
7
|
-
@use './../
|
|
8
|
-
@use './../
|
|
9
|
-
|
|
10
|
-
@use './../
|
|
11
|
-
@use './../
|
|
12
|
-
@use './../
|
|
6
|
+
@use './../mixins/notification' as notification-mx;
|
|
7
|
+
@use './../placeholders/close' as close-ph;
|
|
8
|
+
@use './../placeholders/notification' as notification-ph;
|
|
9
|
+
|
|
10
|
+
@use './../variables/commons';
|
|
11
|
+
@use './../variables/spacing';
|
|
12
|
+
@use './../variables/components/notification';
|
|
13
|
+
|
|
14
|
+
.toast {
|
|
15
|
+
@include notification-mx.notification-size(toast);
|
|
16
|
+
@include notification-mx.notification-dismissible(toast, 'toast-close-button');
|
|
17
|
+
@extend %notification-body;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.toast-close-button {
|
|
21
|
+
@extend %btn-close;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.toast-title {
|
|
25
|
+
@include notification-mx.notification-heading(toast);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@each $name, $color, $icon in notification.$notification-variants {
|
|
29
|
+
$selector: '.toast-#{$name}';
|
|
30
|
+
|
|
31
|
+
// the .toast-error class is needed because it is automatically added by the ngx-toastr library
|
|
32
|
+
@if $name == 'danger' {
|
|
33
|
+
$selector: '#{$selector}, .toast-error';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
#{$selector} {
|
|
37
|
+
@include notification-mx.notification-variant($color, $icon);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
13
40
|
|
|
14
41
|
// Positioning
|
|
42
|
+
.toast-container {
|
|
43
|
+
position: fixed;
|
|
44
|
+
z-index: commons.$zindex-alert;
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
pointer-events: none;
|
|
48
|
+
|
|
49
|
+
.toast {
|
|
50
|
+
width: 25rem;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@include media-breakpoint-down(md) {
|
|
54
|
+
.toast {
|
|
55
|
+
max-width: 25rem;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@include media-breakpoint-down(md) {
|
|
60
|
+
right: spacing.$spacer;
|
|
61
|
+
left: spacing.$spacer;
|
|
62
|
+
|
|
63
|
+
.toast {
|
|
64
|
+
width: 100%;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
15
69
|
.toast-top-center,
|
|
16
70
|
.toast-top-full-width,
|
|
17
71
|
.toast-top-left,
|
|
18
72
|
.toast-top-right {
|
|
19
|
-
top:
|
|
73
|
+
top: spacing.$spacer;
|
|
20
74
|
}
|
|
21
75
|
|
|
22
76
|
.toast-bottom-center,
|
|
23
77
|
.toast-bottom-full-width,
|
|
24
78
|
.toast-bottom-right,
|
|
25
79
|
.toast-bottom-left {
|
|
26
|
-
bottom:
|
|
80
|
+
bottom: spacing.$spacer;
|
|
27
81
|
}
|
|
28
82
|
|
|
29
83
|
.toast-top-left,
|
|
@@ -31,7 +85,7 @@
|
|
|
31
85
|
.toast-top-full-width,
|
|
32
86
|
.toast-bottom-full-width,
|
|
33
87
|
.toast-center-left {
|
|
34
|
-
left:
|
|
88
|
+
left: spacing.$spacer;
|
|
35
89
|
}
|
|
36
90
|
|
|
37
91
|
.toast-top-right,
|
|
@@ -39,7 +93,7 @@
|
|
|
39
93
|
.toast-top-full-width,
|
|
40
94
|
.toast-bottom-full-width,
|
|
41
95
|
.toast-center-right {
|
|
42
|
-
right:
|
|
96
|
+
right: spacing.$spacer;
|
|
43
97
|
}
|
|
44
98
|
|
|
45
99
|
.toast-top-center,
|
|
@@ -66,121 +120,3 @@
|
|
|
66
120
|
width: 100% !important;
|
|
67
121
|
}
|
|
68
122
|
}
|
|
69
|
-
|
|
70
|
-
// Base styling
|
|
71
|
-
.toast-container {
|
|
72
|
-
@extend %notification-container;
|
|
73
|
-
position: fixed;
|
|
74
|
-
pointer-events: none;
|
|
75
|
-
|
|
76
|
-
* {
|
|
77
|
-
box-sizing: border-box;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.toast {
|
|
82
|
-
$effective-line-height: (alert.$alert-line-height * alert.$alert-font-size-small);
|
|
83
|
-
|
|
84
|
-
@extend %notification;
|
|
85
|
-
|
|
86
|
-
display: flex !important; // Needs to be important to override display styling by the ngx-toaster
|
|
87
|
-
width: alert.$alert-toast-width;
|
|
88
|
-
|
|
89
|
-
min-height: 2 * alert.$alert-toast-padding-y + 2 * $effective-line-height;
|
|
90
|
-
|
|
91
|
-
padding: alert.$alert-toast-padding-y alert.$alert-toast-padding-x;
|
|
92
|
-
padding-left: (alert.$alert-toast-padding-x * 2 + alert.$alert-toast-icon-size);
|
|
93
|
-
|
|
94
|
-
overflow: hidden;
|
|
95
|
-
background-position: alert.$alert-toast-padding-x center;
|
|
96
|
-
|
|
97
|
-
background-size: alert.$alert-toast-icon-size;
|
|
98
|
-
font-size: alert.$alert-font-size-small;
|
|
99
|
-
pointer-events: auto;
|
|
100
|
-
|
|
101
|
-
&.no-icon {
|
|
102
|
-
padding-left: alert.$alert-toast-padding-x;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
&:hover {
|
|
106
|
-
opacity: 1;
|
|
107
|
-
box-shadow: alert.$alert-toast-box-shadow-hover;
|
|
108
|
-
cursor: pointer;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.toast-close-button {
|
|
112
|
-
@extend %notification-close;
|
|
113
|
-
|
|
114
|
-
padding: alert.$alert-toast-padding-y alert.$alert-toast-padding-x;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.toast-close-button,
|
|
118
|
-
.btn-close {
|
|
119
|
-
~ .toast-message,
|
|
120
|
-
~ .toast-title {
|
|
121
|
-
padding-right: calc(#{alert.$alert-toast-padding-x} + #{alert.$alert-close-icon-size});
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
+ .toast-message {
|
|
125
|
-
font-weight: bold;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.toast-title {
|
|
131
|
-
@extend %notification-title;
|
|
132
|
-
|
|
133
|
-
font-size: alert.$alert-font-size-small;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.toast-message {
|
|
137
|
-
font-size: alert.$alert-font-size-small;
|
|
138
|
-
word-wrap: break-word;
|
|
139
|
-
|
|
140
|
-
a:hover {
|
|
141
|
-
text-decoration: none;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/* stylelint-disable */
|
|
146
|
-
.toast-close-button {
|
|
147
|
-
@extend .btn-close;
|
|
148
|
-
}
|
|
149
|
-
/* stylelint-enable */
|
|
150
|
-
|
|
151
|
-
// Variants
|
|
152
|
-
|
|
153
|
-
@each $name, $color, $icon in alert.$alert-list {
|
|
154
|
-
.toast-#{$name} {
|
|
155
|
-
--post-bg-rgb: #{color-fn.rgb-values($color)};
|
|
156
|
-
@extend %notification-#{$name};
|
|
157
|
-
|
|
158
|
-
@if (contrast-fn.light-or-dark($color) == 'dark') {
|
|
159
|
-
@extend %color-background-dark-variables;
|
|
160
|
-
} @else {
|
|
161
|
-
@extend %color-background-light-variables;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.toast-close-button,
|
|
165
|
-
.btn-close {
|
|
166
|
-
@extend %notification-#{$name}-close;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// Responsive Design
|
|
172
|
-
@include media-breakpoint-down(md) {
|
|
173
|
-
.toast-container .toast {
|
|
174
|
-
width: alert.$alert-toast-width-small-breakpoint;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
@include media-breakpoint-down(sm) {
|
|
178
|
-
.toast-container {
|
|
179
|
-
right: alert.$alert-margin;
|
|
180
|
-
left: alert.$alert-margin;
|
|
181
|
-
|
|
182
|
-
.toast {
|
|
183
|
-
width: 100%;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
package/components/type.scss
CHANGED
|
@@ -6,13 +6,11 @@
|
|
|
6
6
|
@use './../lic/bootstrap-license';
|
|
7
7
|
@use './../themes/bootstrap/core' as *;
|
|
8
8
|
@use './../themes/bootstrap/utilities' as bu; // TODO: Move Design System utilities to utilities folder.
|
|
9
|
+
@use './../mixins/color' as color-mx;
|
|
9
10
|
@use './../mixins/utilities';
|
|
10
11
|
@use './../variables/color';
|
|
11
12
|
@use './../variables/spacing';
|
|
12
13
|
@use './../variables/grid';
|
|
13
|
-
@use './../functions/color' as color-fn;
|
|
14
|
-
@use './../functions/contrast' as contrast-fn;
|
|
15
|
-
@use './../placeholders/color' as color-ph;
|
|
16
14
|
|
|
17
15
|
.bold {
|
|
18
16
|
font-weight: 700;
|
|
@@ -66,15 +64,7 @@ span.spacer {
|
|
|
66
64
|
// Background Utility
|
|
67
65
|
@each $name, $color in color.$background-colors {
|
|
68
66
|
.bg-#{$name} {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
@extend %color-background-rgba;
|
|
72
|
-
|
|
73
|
-
@if (contrast-fn.light-or-dark($color) == 'dark') {
|
|
74
|
-
@extend %color-background-dark-variables;
|
|
75
|
-
} @else {
|
|
76
|
-
@extend %color-background-light-variables;
|
|
77
|
-
}
|
|
67
|
+
@include color-mx.colored-background($color);
|
|
78
68
|
}
|
|
79
69
|
}
|
|
80
70
|
|
package/functions/_icons.scss
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
@return $svg;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
@function get-
|
|
49
|
+
@function get-svg-url($icon-name) {
|
|
50
50
|
$svg-url: '';
|
|
51
51
|
|
|
52
52
|
@if (map.has-key(icons.$svg-icon-map, #{$icon-name})) {
|
|
@@ -59,7 +59,11 @@
|
|
|
59
59
|
@error "Icon '#{$icon-name}' does not exist.";
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
@return
|
|
62
|
+
@return $svg-url;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@function get-colored-svg-url($icon-name, $color) {
|
|
66
|
+
@return add-fill-color(get-svg-url($icon-name), $color);
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
@function get-pre-colored-svg-url($icon-name) {
|