@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.
- package/LICENSE +202 -0
- package/README.md +40 -0
- package/basics.css +29 -0
- package/basics.scss +9 -0
- package/components/_index.scss +45 -0
- package/components/accordion.scss +94 -0
- package/components/alert.scss +214 -0
- package/components/badge.scss +85 -0
- package/components/base.scss +6 -0
- package/components/breadcrumb.scss +42 -0
- package/components/button-group.scss +69 -0
- package/components/button.scss +213 -0
- package/components/card.scss +211 -0
- package/components/carousel.scss +176 -0
- package/components/close.scss +33 -0
- package/components/datatable.scss +196 -0
- package/components/datepicker.scss +232 -0
- package/components/dropdown.scss +83 -0
- package/components/floating-label.scss +77 -0
- package/components/fonts.scss +27 -0
- package/components/form-check.scss +236 -0
- package/components/form-feedback.scss +32 -0
- package/components/form-range.scss +111 -0
- package/components/form-select.scss +31 -0
- package/components/forms.scss +54 -0
- package/components/grid.scss +100 -0
- package/components/icons.scss +60 -0
- package/components/intranet-header/_icon.scss +6 -0
- package/components/intranet-header/_language-chooser.scss +40 -0
- package/components/intranet-header/_logo.scss +54 -0
- package/components/intranet-header/_nav-overflow.scss +56 -0
- package/components/intranet-header/_scaffolding.scss +96 -0
- package/components/intranet-header/_searchbox.scss +32 -0
- package/components/intranet-header/_settings.scss +23 -0
- package/components/intranet-header/_sidebar.scss +118 -0
- package/components/intranet-header/_top-navigation.scss +109 -0
- package/components/intranet-header/index.scss +17 -0
- package/components/list-group.scss +166 -0
- package/components/modal.scss +62 -0
- package/components/offcanvas.scss +5 -0
- package/components/pagination.scss +79 -0
- package/components/popover.scss +21 -0
- package/components/product-card.scss +74 -0
- package/components/progress.scss +28 -0
- package/components/reboot.scss +10 -0
- package/components/root.scss +11 -0
- package/components/sizing.scss +101 -0
- package/components/spinner.scss +71 -0
- package/components/stepper.scss +193 -0
- package/components/subnavigation.scss +138 -0
- package/components/tables.scss +16 -0
- package/components/tabs.scss +212 -0
- package/components/timepicker.scss +123 -0
- package/components/toast.scss +187 -0
- package/components/tooltip.scss +23 -0
- package/components/topic-teaser.scss +186 -0
- package/components/transitions.scss +4 -0
- package/components/type.scss +131 -0
- package/components/utilities.scss +98 -0
- package/core.css +0 -0
- package/core.scss +5 -0
- package/functions/_color.scss +55 -0
- package/functions/_icons.scss +71 -0
- package/functions/_index.scss +5 -0
- package/functions/_list.scss +22 -0
- package/functions/_sizing.scss +103 -0
- package/functions/_utilities.scss +66 -0
- package/index.css +75 -0
- package/index.scss +8 -0
- package/intranet.css +75 -0
- package/intranet.scss +6 -0
- package/layouts/portal/_grid.scss +80 -0
- package/layouts/portal/_subnavigation.scss +5 -0
- package/layouts/portal/_type.scss +83 -0
- package/layouts/portal/_variables.scss +8 -0
- package/layouts/portal/index.scss +5 -0
- package/lic/_bootstrap-license.scss +29 -0
- package/mixins/_animation.scss +48 -0
- package/mixins/_badge.scss +22 -0
- package/mixins/_button.scss +57 -0
- package/mixins/_color.scss +15 -0
- package/mixins/_form-checks.scss +80 -0
- package/mixins/_forms.scss +110 -0
- package/mixins/_icons.scss +38 -0
- package/mixins/_index.scss +8 -0
- package/mixins/_scroll-shadows.scss +17 -0
- package/mixins/_size.scss +65 -0
- package/mixins/_type.scss +54 -0
- package/mixins/_utilities.scss +79 -0
- package/package.json +76 -0
- package/placeholders/_button.scss +25 -0
- package/placeholders/_color.scss +71 -0
- package/placeholders/_dropdown.scss +11 -0
- package/placeholders/_index.scss +3 -0
- package/placeholders/_notifications.scss +128 -0
- package/placeholders/_text.scss +158 -0
- package/placeholders/badge.scss +61 -0
- package/themes/bootstrap/_accordion.scss +2 -0
- package/themes/bootstrap/_alert.scss +2 -0
- package/themes/bootstrap/_badge.scss +2 -0
- package/themes/bootstrap/_breadcrumbs.scss +2 -0
- package/themes/bootstrap/_button-group.scss +2 -0
- package/themes/bootstrap/_buttons.scss +3 -0
- package/themes/bootstrap/_card.scss +2 -0
- package/themes/bootstrap/_carousel.scss +2 -0
- package/themes/bootstrap/_close.scss +2 -0
- package/themes/bootstrap/_containers.scss +2 -0
- package/themes/bootstrap/_dropdown.scss +2 -0
- package/themes/bootstrap/_forms.scss +9 -0
- package/themes/bootstrap/_grid.scss +2 -0
- package/themes/bootstrap/_images.scss +2 -0
- package/themes/bootstrap/_list-group.scss +2 -0
- package/themes/bootstrap/_modal.scss +2 -0
- package/themes/bootstrap/_nav.scss +2 -0
- package/themes/bootstrap/_navbar.scss +2 -0
- package/themes/bootstrap/_offcanvas.scss +2 -0
- package/themes/bootstrap/_overrides-color.scss +45 -0
- package/themes/bootstrap/_overrides-features.scss +18 -0
- package/themes/bootstrap/_overrides-variables.scss +40 -0
- package/themes/bootstrap/_overrides.scss +5 -0
- package/themes/bootstrap/_pagination.scss +2 -0
- package/themes/bootstrap/_popover.scss +2 -0
- package/themes/bootstrap/_progress.scss +2 -0
- package/themes/bootstrap/_reboot.scss +2 -0
- package/themes/bootstrap/_root.scss +2 -0
- package/themes/bootstrap/_spinners.scss +2 -0
- package/themes/bootstrap/_tables.scss +2 -0
- package/themes/bootstrap/_toasts.scss +2 -0
- package/themes/bootstrap/_tooltip.scss +2 -0
- package/themes/bootstrap/_transitions.scss +2 -0
- package/themes/bootstrap/_type.scss +6 -0
- package/themes/bootstrap/_utilities.scss +9 -0
- package/themes/bootstrap/forms/_floating-labels.scss +2 -0
- package/themes/bootstrap/forms/_form-check.scss +2 -0
- package/themes/bootstrap/forms/_form-control.scss +2 -0
- package/themes/bootstrap/forms/_form-range.scss +2 -0
- package/themes/bootstrap/forms/_form-select.scss +2 -0
- package/themes/bootstrap/forms/_form-text.scss +2 -0
- package/themes/bootstrap/forms/_input-group.scss +2 -0
- package/themes/bootstrap/forms/_labels.scss +2 -0
- package/themes/bootstrap/forms/_validation.scss +2 -0
- package/variables/_animation.scss +36 -0
- package/variables/_breakpoints.scss +9 -0
- package/variables/_color.scss +119 -0
- package/variables/_commons.scss +56 -0
- package/variables/_grid.scss +27 -0
- package/variables/_icons.scss +4600 -0
- package/variables/_index.scss +14 -0
- package/variables/_options.scss +5 -0
- package/variables/_spacing.scss +181 -0
- package/variables/_type.scss +204 -0
- package/variables/components/_accordion.scss +38 -0
- package/variables/components/_alert.scss +51 -0
- package/variables/components/_badge.scss +44 -0
- package/variables/components/_breadcrumbs.scss +21 -0
- package/variables/components/_button.scss +137 -0
- package/variables/components/_card.scss +30 -0
- package/variables/components/_carousel.scss +27 -0
- package/variables/components/_close.scss +19 -0
- package/variables/components/_code.scss +14 -0
- package/variables/components/_datatable.scss +53 -0
- package/variables/components/_datepicker.scss +22 -0
- package/variables/components/_detail-summary.scss +12 -0
- package/variables/components/_dropdowns.scss +30 -0
- package/variables/components/_figures.scss +6 -0
- package/variables/components/_form-check.scss +63 -0
- package/variables/components/_form-feedback.scss +25 -0
- package/variables/components/_form-select.scss +13 -0
- package/variables/components/_form-switch.scss +38 -0
- package/variables/components/_forms.scss +129 -0
- package/variables/components/_index.scss +30 -0
- package/variables/components/_intranet-header.scss +9 -0
- package/variables/components/_list-group.scss +29 -0
- package/variables/components/_modals.scss +68 -0
- package/variables/components/_nav.scss +55 -0
- package/variables/components/_navbar.scss +44 -0
- package/variables/components/_pagination.scss +42 -0
- package/variables/components/_paragraph.scss +6 -0
- package/variables/components/_popovers.scss +28 -0
- package/variables/components/_progress-bars.scss +16 -0
- package/variables/components/_spinners.scss +16 -0
- package/variables/components/_stepper.scss +36 -0
- package/variables/components/_subnavigation.scss +32 -0
- package/variables/components/_tables.scss +39 -0
- package/variables/components/_thumbnails.scss +11 -0
- package/variables/components/_toasts.scss +18 -0
- package/variables/components/_tooltips.scss +18 -0
- package/variables/components/_topic-teaser.scss +27 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
@forward '../variables/options';
|
|
2
|
+
|
|
3
|
+
@use '../lic/bootstrap-license';
|
|
4
|
+
@use '../themes/bootstrap/overrides' as *;
|
|
5
|
+
|
|
6
|
+
@use '../variables/components/nav';
|
|
7
|
+
@use '../variables/spacing';
|
|
8
|
+
@use '../variables/commons';
|
|
9
|
+
@use '../variables/color';
|
|
10
|
+
@use '../mixins/color' as color-mx;
|
|
11
|
+
@use '../mixins/utilities';
|
|
12
|
+
|
|
13
|
+
.tabs-wrapper {
|
|
14
|
+
position: relative;
|
|
15
|
+
padding-top: spacing.$spacer;
|
|
16
|
+
border: 0;
|
|
17
|
+
background-color: color.$gray-background-light;
|
|
18
|
+
|
|
19
|
+
// Create a line that lies below the active but above the passive elements
|
|
20
|
+
// This way hover works smoothly with the background color
|
|
21
|
+
&::after {
|
|
22
|
+
content: '';
|
|
23
|
+
position: absolute;
|
|
24
|
+
bottom: 0;
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 1px;
|
|
27
|
+
background-color: nav.$nav-tabs-border-color;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Small hack to save a lot of code and provide a lot of flexibility to tabs coloring
|
|
31
|
+
.tabs {
|
|
32
|
+
background-color: transparent !important;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@include utilities.high-contrast-mode() {
|
|
36
|
+
&::after {
|
|
37
|
+
background-color: ButtonBorder;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.tabs {
|
|
43
|
+
flex-wrap: nowrap;
|
|
44
|
+
overflow-x: auto;
|
|
45
|
+
|
|
46
|
+
/* prevent scroll chaining on x scroll */
|
|
47
|
+
overscroll-behavior-x: contain;
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
|
|
50
|
+
// Scrolling fix, make the tabs scroll a little more so the right most tab is not
|
|
51
|
+
// flush with the window border
|
|
52
|
+
&::after {
|
|
53
|
+
content: '';
|
|
54
|
+
display: block;
|
|
55
|
+
flex: 1 0 auto;
|
|
56
|
+
width: nav.$nav-link-padding-x;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.tab-title {
|
|
60
|
+
position: relative;
|
|
61
|
+
box-sizing: border-box;
|
|
62
|
+
padding: nav.$nav-link-padding;
|
|
63
|
+
transition: background-color 100ms;
|
|
64
|
+
border-right: 1px solid transparent;
|
|
65
|
+
border-left: 1px solid transparent;
|
|
66
|
+
outline-color: currentColor;
|
|
67
|
+
opacity: 0.7;
|
|
68
|
+
color: var(--post-contrast-color);
|
|
69
|
+
|
|
70
|
+
&:focus {
|
|
71
|
+
opacity: 0.7;
|
|
72
|
+
background-color: unset;
|
|
73
|
+
color: var(--post-contrast-color);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&:hover {
|
|
77
|
+
opacity: 1;
|
|
78
|
+
background-color: nav.$nav-tabs-link-active-bg;
|
|
79
|
+
color: var(--post-contrast-color);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// same styles as focus, can't use placeholder here because focus-visible can't be described outside of the support condition
|
|
83
|
+
&:focus-visible {
|
|
84
|
+
outline: transparent;
|
|
85
|
+
opacity: 1;
|
|
86
|
+
background-color: nav.$nav-tabs-link-active-bg;
|
|
87
|
+
color: var(--post-contrast-color);
|
|
88
|
+
|
|
89
|
+
&::after {
|
|
90
|
+
content: '';
|
|
91
|
+
display: block;
|
|
92
|
+
position: absolute;
|
|
93
|
+
top: $nav-tabs-focus-box-shadow-width;
|
|
94
|
+
right: $nav-tabs-focus-box-shadow-width - 1px;
|
|
95
|
+
bottom: 0;
|
|
96
|
+
left: $nav-tabs-focus-box-shadow-width - 1px;
|
|
97
|
+
box-shadow: nav.$nav-tabs-focus-box-shadow;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&.active {
|
|
102
|
+
z-index: 1; // Lift above the line and make focus visible all around
|
|
103
|
+
border-right-color: nav.$nav-tabs-border-color;
|
|
104
|
+
border-left-color: nav.$nav-tabs-border-color;
|
|
105
|
+
opacity: 1;
|
|
106
|
+
background-color: nav.$nav-tabs-link-active-bg;
|
|
107
|
+
color: var(--post-contrast-color);
|
|
108
|
+
font-weight: 700;
|
|
109
|
+
|
|
110
|
+
// Create a line that does not suffer from border corner mitering
|
|
111
|
+
&::before {
|
|
112
|
+
content: '';
|
|
113
|
+
display: block;
|
|
114
|
+
position: absolute;
|
|
115
|
+
top: 0;
|
|
116
|
+
right: -1px;
|
|
117
|
+
left: -1px;
|
|
118
|
+
height: spacing.$size-micro;
|
|
119
|
+
background-color: nav.$nav-tabs-link-active-border-color;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@include utilities.high-contrast-mode() {
|
|
124
|
+
opacity: 1;
|
|
125
|
+
border-left-color: Canvas;
|
|
126
|
+
border-right-color: Canvas;
|
|
127
|
+
color: LinkText;
|
|
128
|
+
|
|
129
|
+
&:hover,
|
|
130
|
+
&:focus,
|
|
131
|
+
&:focus-within,
|
|
132
|
+
&:focus-visible {
|
|
133
|
+
outline: spacing.$size-line solid Highlight;
|
|
134
|
+
outline-offset: -(spacing.$size-micro);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&.active {
|
|
138
|
+
border-left-color: ButtonText;
|
|
139
|
+
border-right-color: ButtonText;
|
|
140
|
+
color: Highlight;
|
|
141
|
+
|
|
142
|
+
&::before {
|
|
143
|
+
background-color: Highlight;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Tabs with dark backgrounds
|
|
150
|
+
@include color-mx.on-dark-background(true) {
|
|
151
|
+
.tab-title {
|
|
152
|
+
&:hover {
|
|
153
|
+
background-color: rgba(nav.$nav-tabs-link-active-bg, 0.2);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&:focus-visible {
|
|
157
|
+
background-color: rgba(nav.$nav-tabs-link-active-bg, 0.2);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.tab-content {
|
|
164
|
+
padding-top: spacing.$spacer;
|
|
165
|
+
padding-bottom: spacing.$spacer;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Careful, this generates a lot of code
|
|
169
|
+
@each $key, $color in color.$background-colors {
|
|
170
|
+
.bg-#{$key} {
|
|
171
|
+
.tabs-wrapper {
|
|
172
|
+
background-color: $color;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.tab-title {
|
|
176
|
+
background-color: $color;
|
|
177
|
+
|
|
178
|
+
&.active {
|
|
179
|
+
background-color: $color;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.nav-item {
|
|
184
|
+
background-color: $color;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
[class*='bg-'] .tab-title.active {
|
|
190
|
+
&:focus {
|
|
191
|
+
&::after {
|
|
192
|
+
background-color: rgba(255, 255, 255, 0.2);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// write supports for selectors this way: https://stackoverflow.com/a/62666132
|
|
197
|
+
// need to include * otherwise it throws build error
|
|
198
|
+
@supports #{'\selector(*:focus-visible)'} {
|
|
199
|
+
&:focus {
|
|
200
|
+
&::after {
|
|
201
|
+
background-color: unset;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// same styles as focus, can't use placeholder here because focus-visible can't be described outside of the support condition
|
|
206
|
+
&:focus-visible {
|
|
207
|
+
&::after {
|
|
208
|
+
background-color: rgba(255, 255, 255, 0.2);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
@forward '../variables/options';
|
|
2
|
+
|
|
3
|
+
@use 'sass:map';
|
|
4
|
+
|
|
5
|
+
@use '../mixins/utilities';
|
|
6
|
+
@use '../mixins/icons' as icon-mixins;
|
|
7
|
+
@use '../mixins/forms' as form-mixins;
|
|
8
|
+
@use '../mixins/button' as button-mixins;
|
|
9
|
+
|
|
10
|
+
@use '../variables/color';
|
|
11
|
+
@use '../variables/components/forms';
|
|
12
|
+
@use '../variables/components/button';
|
|
13
|
+
|
|
14
|
+
// Basic timepicker overrides
|
|
15
|
+
.ngb-tp {
|
|
16
|
+
.ngb-tp-input-container {
|
|
17
|
+
width: auto;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.form-control {
|
|
21
|
+
width: 4.5rem;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.form-control-sm,
|
|
25
|
+
.form-control-rg {
|
|
26
|
+
width: 4rem;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.form-control-lg {
|
|
30
|
+
width: 6rem;
|
|
31
|
+
padding: 1rem 1.375rem;
|
|
32
|
+
@include form-mixins.placeholder {
|
|
33
|
+
color: forms.$input-placeholder-color;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.ngb-tp-chevron {
|
|
38
|
+
&::before {
|
|
39
|
+
@include icon-mixins.pi('2051');
|
|
40
|
+
width: map.get(button.$btn-icon-size-map, 'md');
|
|
41
|
+
height: map.get(button.$btn-icon-size-map, 'md');
|
|
42
|
+
transform: none;
|
|
43
|
+
border: 0;
|
|
44
|
+
background-repeat: no-repeat;
|
|
45
|
+
background-position: center center;
|
|
46
|
+
background-size: contain;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&.bottom::before {
|
|
50
|
+
transform: rotateZ(180deg);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@each $size in sm, lg {
|
|
55
|
+
.btn-#{$size} .ngb-tp-chevron::before {
|
|
56
|
+
width: map.get(button.$btn-icon-size-map, $size);
|
|
57
|
+
height: map.get(button.$btn-icon-size-map, $size);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@include utilities.high-contrast-mode() {
|
|
62
|
+
.form-control {
|
|
63
|
+
&:hover,
|
|
64
|
+
&:focus-visible {
|
|
65
|
+
border-color: Highlight;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Regular-sized timepicker
|
|
72
|
+
.timepicker-rg {
|
|
73
|
+
.btn {
|
|
74
|
+
@include button-mixins.button-size(rg);
|
|
75
|
+
|
|
76
|
+
.ngb-tp-chevron::before {
|
|
77
|
+
width: map.get(button.$btn-icon-size-map, 'rg');
|
|
78
|
+
height: map.get(button.$btn-icon-size-map, 'rg');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.form-control {
|
|
83
|
+
@include form-mixins.form-control-rg;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Timepicker validation
|
|
88
|
+
ngb-timepicker {
|
|
89
|
+
&.ng-invalid {
|
|
90
|
+
.form-control {
|
|
91
|
+
border-color: color.$error;
|
|
92
|
+
|
|
93
|
+
&:focus {
|
|
94
|
+
border-color: color.$error;
|
|
95
|
+
box-shadow: 0 0 0 forms.$input-focus-width rgba(color.$error, 0.25);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
~ .invalid-feedback,
|
|
100
|
+
~ .invalid-tooltip {
|
|
101
|
+
display: block;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&.ng-valid {
|
|
106
|
+
~ .valid-feedback,
|
|
107
|
+
~ .valid-tooltip {
|
|
108
|
+
display: block;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@include utilities.high-contrast-mode() {
|
|
113
|
+
&.ng-invalid,
|
|
114
|
+
&.ng-valid {
|
|
115
|
+
.form-control {
|
|
116
|
+
&:hover,
|
|
117
|
+
&:focus-visible {
|
|
118
|
+
border-color: Highlight;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
@forward '../variables/options';
|
|
2
|
+
|
|
3
|
+
@use '../lic/bootstrap-license';
|
|
4
|
+
@use '../themes/bootstrap/overrides' as *;
|
|
5
|
+
|
|
6
|
+
@use '../variables/components/toasts';
|
|
7
|
+
@use '../variables/components/alert';
|
|
8
|
+
@use '../components/close';
|
|
9
|
+
@use '../functions/color' as color-fn;
|
|
10
|
+
@use '../placeholders/color' as color-ph;
|
|
11
|
+
@use '../placeholders/notifications';
|
|
12
|
+
|
|
13
|
+
// Positioning
|
|
14
|
+
.toast-top-center,
|
|
15
|
+
.toast-top-full-width,
|
|
16
|
+
.toast-top-left,
|
|
17
|
+
.toast-top-right {
|
|
18
|
+
top: alert.$alert-margin;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.toast-bottom-center,
|
|
22
|
+
.toast-bottom-full-width,
|
|
23
|
+
.toast-bottom-right,
|
|
24
|
+
.toast-bottom-left {
|
|
25
|
+
bottom: alert.$alert-margin;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.toast-top-left,
|
|
29
|
+
.toast-bottom-left,
|
|
30
|
+
.toast-top-full-width,
|
|
31
|
+
.toast-bottom-full-width,
|
|
32
|
+
.toast-center-left {
|
|
33
|
+
left: alert.$alert-margin;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.toast-top-right,
|
|
37
|
+
.toast-bottom-right,
|
|
38
|
+
.toast-top-full-width,
|
|
39
|
+
.toast-bottom-full-width,
|
|
40
|
+
.toast-center-right {
|
|
41
|
+
right: alert.$alert-margin;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.toast-top-center,
|
|
45
|
+
.toast-bottom-center {
|
|
46
|
+
left: 50%;
|
|
47
|
+
transform: translateX(-50%);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.toast-center-left,
|
|
51
|
+
.toast-center-right {
|
|
52
|
+
top: 50%;
|
|
53
|
+
transform: translateY(-50%);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.toast-center-center {
|
|
57
|
+
top: 50%;
|
|
58
|
+
left: 50%;
|
|
59
|
+
transform: translate(-50%, -50%);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.toast-top-full-width,
|
|
63
|
+
.toast-bottom-full-width {
|
|
64
|
+
.toast {
|
|
65
|
+
width: 100% !important;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Base styling
|
|
70
|
+
.toast-container {
|
|
71
|
+
@extend %notification-container;
|
|
72
|
+
position: fixed;
|
|
73
|
+
pointer-events: none;
|
|
74
|
+
|
|
75
|
+
* {
|
|
76
|
+
box-sizing: border-box;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.toast {
|
|
81
|
+
$effective-line-height: (alert.$alert-line-height * alert.$alert-font-size-small);
|
|
82
|
+
|
|
83
|
+
@extend %notification;
|
|
84
|
+
|
|
85
|
+
display: flex !important; // Needs to be important to override display styling by the ngx-toaster
|
|
86
|
+
width: alert.$alert-toast-width;
|
|
87
|
+
|
|
88
|
+
min-height: 2 * alert.$alert-toast-padding-y + 2 * $effective-line-height;
|
|
89
|
+
|
|
90
|
+
padding: alert.$alert-toast-padding-y alert.$alert-toast-padding-x;
|
|
91
|
+
padding-left: (alert.$alert-toast-padding-x * 2 + alert.$alert-toast-icon-size);
|
|
92
|
+
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
background-position: alert.$alert-toast-padding-x center;
|
|
95
|
+
|
|
96
|
+
background-size: alert.$alert-toast-icon-size;
|
|
97
|
+
font-size: alert.$alert-font-size-small;
|
|
98
|
+
pointer-events: auto;
|
|
99
|
+
|
|
100
|
+
&.no-icon {
|
|
101
|
+
padding-left: alert.$alert-toast-padding-x;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&:hover {
|
|
105
|
+
opacity: 1;
|
|
106
|
+
box-shadow: alert.$alert-toast-box-shadow-hover;
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.toast-close-button {
|
|
111
|
+
@extend %notification-close;
|
|
112
|
+
|
|
113
|
+
padding: alert.$alert-toast-padding-y alert.$alert-toast-padding-x;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.toast-title {
|
|
118
|
+
@extend %notification-title;
|
|
119
|
+
|
|
120
|
+
font-size: alert.$alert-font-size-small;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.toast-message {
|
|
124
|
+
font-size: alert.$alert-font-size-small;
|
|
125
|
+
word-wrap: break-word;
|
|
126
|
+
|
|
127
|
+
a:hover {
|
|
128
|
+
text-decoration: none;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* stylelint-disable */
|
|
133
|
+
.toast-close-button {
|
|
134
|
+
@extend .btn-close;
|
|
135
|
+
}
|
|
136
|
+
/* stylelint-enable */
|
|
137
|
+
|
|
138
|
+
.toast {
|
|
139
|
+
.toast-close-button,
|
|
140
|
+
.btn-close {
|
|
141
|
+
~ .toast-message,
|
|
142
|
+
~ .toast-title {
|
|
143
|
+
padding-right: calc(#{alert.$alert-toast-padding-x} + #{alert.$alert-close-icon-size});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
+ .toast-message {
|
|
147
|
+
font-weight: bold;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Variants
|
|
153
|
+
|
|
154
|
+
@each $name, $color, $icon in alert.$alert-list {
|
|
155
|
+
.toast-#{$name} {
|
|
156
|
+
--post-bg-rgb: #{color-fn.rgb-values($color)};
|
|
157
|
+
@extend %notification-#{$name};
|
|
158
|
+
|
|
159
|
+
@if (color-fn.get-contrast-color($color) != #000) {
|
|
160
|
+
@extend %color-background-dark-variables;
|
|
161
|
+
} @else {
|
|
162
|
+
@extend %color-background-light-variables;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.toast-close-button,
|
|
166
|
+
.btn-close {
|
|
167
|
+
@extend %notification-#{$name}-close;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Responsive Design
|
|
173
|
+
@include media-breakpoint-down(md) {
|
|
174
|
+
.toast-container .toast {
|
|
175
|
+
width: alert.$alert-toast-width-small-breakpoint;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
@include media-breakpoint-down(sm) {
|
|
179
|
+
.toast-container {
|
|
180
|
+
right: alert.$alert-margin;
|
|
181
|
+
left: alert.$alert-margin;
|
|
182
|
+
|
|
183
|
+
.toast {
|
|
184
|
+
width: 100%;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@forward '../variables/options';
|
|
2
|
+
|
|
3
|
+
@use '../lic/bootstrap-license';
|
|
4
|
+
@use '../themes/bootstrap/tooltip' as bt;
|
|
5
|
+
|
|
6
|
+
// There's a 1px-gap between the arrow and the tooltip-body.
|
|
7
|
+
// We can fix that by moving the arrow to the opposite direction, according to the tooltip-positioning (position top -> move direction bottom etc)
|
|
8
|
+
|
|
9
|
+
.bs-tooltip-top .arrow {
|
|
10
|
+
bottom: 1px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.bs-tooltip-right .arrow {
|
|
14
|
+
left: 1px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.bs-tooltip-bottom .arrow {
|
|
18
|
+
top: 1px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.bs-tooltip-left .arrow {
|
|
22
|
+
right: 1px;
|
|
23
|
+
}
|