@ch-post-common/common-web-frontend 0.0.1-security → 1.934.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of @ch-post-common/common-web-frontend might be problematic. Click here for more details.

Files changed (97) hide show
  1. package/components/accordion.scss +177 -0
  2. package/components/alert.scss +217 -0
  3. package/components/badge.scss +95 -0
  4. package/components/breadcrumb.scss +43 -0
  5. package/components/button.scss +168 -0
  6. package/components/card.scss +227 -0
  7. package/components/carousel.scss +161 -0
  8. package/components/custom-choice-control.scss +217 -0
  9. package/components/custom-range-input.scss +51 -0
  10. package/components/custom-select.scss +60 -0
  11. package/components/datatable.scss +147 -0
  12. package/components/datepicker.scss +220 -0
  13. package/components/detail-summary.scss +72 -0
  14. package/components/dropdown.scss +71 -0
  15. package/components/floating-label.scss +65 -0
  16. package/components/fonts.scss +35 -0
  17. package/components/form-feedback.scss +70 -0
  18. package/components/forms.scss +31 -0
  19. package/components/grid.scss +103 -0
  20. package/components/icons.scss +62 -0
  21. package/components/intranet-header/_icon.scss +6 -0
  22. package/components/intranet-header/_language-chooser.scss +40 -0
  23. package/components/intranet-header/_logo.scss +74 -0
  24. package/components/intranet-header/_nav-overflow.scss +56 -0
  25. package/components/intranet-header/_scaffolding.scss +96 -0
  26. package/components/intranet-header/_searchbox.scss +56 -0
  27. package/components/intranet-header/_settings.scss +23 -0
  28. package/components/intranet-header/_sidebar.scss +118 -0
  29. package/components/intranet-header/_top-navigation.scss +83 -0
  30. package/components/list-group.scss +156 -0
  31. package/components/modal.scss +87 -0
  32. package/components/pagination.scss +67 -0
  33. package/components/popover.scss +21 -0
  34. package/components/product-card.scss +74 -0
  35. package/components/progress.scss +15 -0
  36. package/components/reboot.scss +17 -0
  37. package/components/root.scss +10 -0
  38. package/components/sizing.scss +90 -0
  39. package/components/spinner.scss +58 -0
  40. package/components/stepper.scss +158 -0
  41. package/components/subnavigation.scss +131 -0
  42. package/components/switch.scss +132 -0
  43. package/components/tabs.scss +122 -0
  44. package/components/timepicker.scss +110 -0
  45. package/components/toast.scss +172 -0
  46. package/components/tooltip.scss +23 -0
  47. package/components/topic-teaser.scss +133 -0
  48. package/components/type.scss +106 -0
  49. package/components/utilities.scss +93 -0
  50. package/index.js +28 -0
  51. package/layouts/portal/_type.scss +83 -0
  52. package/lic/_bootstrap-license.scss +29 -0
  53. package/lic/_cwf-license.scss +7 -0
  54. package/mixins/_animation.scss +39 -0
  55. package/mixins/_button.scss +232 -0
  56. package/mixins/_forms.scss +188 -0
  57. package/mixins/_icons.scss +27 -0
  58. package/mixins/_scroll-shadows.scss +13 -0
  59. package/mixins/_size.scss +69 -0
  60. package/mixins/_type.scss +187 -0
  61. package/mixins/_utilities.scss +73 -0
  62. package/package.json +11 -3
  63. package/placeholders/_dropdown.scss +11 -0
  64. package/placeholders/_floating-label.scss +143 -0
  65. package/placeholders/_notifications.scss +160 -0
  66. package/placeholders/_text.scss +187 -0
  67. package/variables/_animation.scss +36 -0
  68. package/variables/_color.scss +240 -0
  69. package/variables/_commons.scss +57 -0
  70. package/variables/_icons.scss +2071 -0
  71. package/variables/_spacing.scss +180 -0
  72. package/variables/_type.scss +157 -0
  73. package/variables/components/_accordion.scss +22 -0
  74. package/variables/components/_alert.scss +50 -0
  75. package/variables/components/_badge.scss +29 -0
  76. package/variables/components/_breadcrumbs.scss +21 -0
  77. package/variables/components/_button.scss +152 -0
  78. package/variables/components/_card.scss +29 -0
  79. package/variables/components/_carousel.scss +27 -0
  80. package/variables/components/_close.scss +9 -0
  81. package/variables/components/_datatable.scss +49 -0
  82. package/variables/components/_datepicker.scss +14 -0
  83. package/variables/components/_dropdowns.scss +30 -0
  84. package/variables/components/_forms.scss +256 -0
  85. package/variables/components/_intranet-header.scss +9 -0
  86. package/variables/components/_modals.scss +68 -0
  87. package/variables/components/_nav.scss +82 -0
  88. package/variables/components/_pagination.scss +41 -0
  89. package/variables/components/_paragraph.scss +6 -0
  90. package/variables/components/_popovers.scss +28 -0
  91. package/variables/components/_progress-bars.scss +16 -0
  92. package/variables/components/_stepper.scss +26 -0
  93. package/variables/components/_subnavigation.scss +36 -0
  94. package/variables/components/_switch.scss +3 -0
  95. package/variables/components/_tables.scss +31 -0
  96. package/variables/components/_tooltips.scss +26 -0
  97. package/README.md +0 -5
@@ -0,0 +1,232 @@
1
+ @use "sass:map";
2
+ @use "../themes/bootstrap/overrides" as bootstrap;
3
+ @use "./animation";
4
+ @use "../functions";
5
+ @use "../variables";
6
+ @use "../variables/components/button";
7
+ @use "../variables/options";
8
+
9
+ @mixin reset-button {
10
+ background: none;
11
+ border: 0;
12
+ color: inherit;
13
+ font: inherit;
14
+ line-height: normal;
15
+ overflow: visible;
16
+ padding: 0;
17
+ appearance: button; // for input
18
+ user-select: none;
19
+ }
20
+
21
+ @mixin _btn($size) {
22
+ $container-height: functions.calculate-inner-height(
23
+ map.get(variables.$font-size-map, $size),
24
+ map.get(button.$btn-line-height-map, $size),
25
+ map.get(button.$btn-padding-y-map, $size)
26
+ );
27
+ $offset: -#{map.get(button.$btn-padding-y-map, $size)};
28
+
29
+ &.btn-animated {
30
+ @include animation.hover-animation(
31
+ map.get(variables.$font-size-map, $size),
32
+ map.get(button.$btn-animation-distance-map, $size),
33
+ $container-height,
34
+ $offset
35
+ );
36
+ @include bootstrap.button-size(
37
+ map.get(button.$btn-padding-y-map, $size),
38
+ map.get(button.$btn-padding-animate-x-map, $size),
39
+ map.get(variables.$font-size-map, $size),
40
+ map.get(button.$btn-line-height-map, $size),
41
+ map.get(button.$btn-border-radius-map, $size)
42
+ );
43
+ }
44
+
45
+ &.btn-icon {
46
+ $adjusted-padding: (
47
+ $container-height - map.get(button.$btn-icon-size-map, $size)
48
+ )/2;
49
+ padding: $adjusted-padding;
50
+
51
+ .pi {
52
+ width: map.get(button.$btn-icon-size-map, $size);
53
+ height: map.get(button.$btn-icon-size-map, $size);
54
+ }
55
+ }
56
+ }
57
+
58
+ @mixin btn-sm {
59
+ @include _btn("sm");
60
+ }
61
+
62
+ @mixin btn-rg {
63
+ @include bootstrap.button-size(
64
+ button.$btn-padding-y-rg,
65
+ button.$btn-padding-x-rg,
66
+ variables.$font-size-rg,
67
+ button.$btn-line-height-rg,
68
+ button.$btn-border-radius-rg
69
+ );
70
+ @include _btn("rg");
71
+ }
72
+
73
+ @mixin btn {
74
+ @include _btn("md");
75
+ }
76
+
77
+ @mixin btn-lg {
78
+ @include _btn("lg");
79
+ }
80
+
81
+ // Placeholder selectors are used so the resulting output css is smaller
82
+ %btn-animation-arrow-light {
83
+ @include animation.hover-animation-svg-icon(
84
+ variables.$yiq-text-light,
85
+ "2050",
86
+ 2
87
+ );
88
+ }
89
+
90
+ %btn-animation-arrow-dark {
91
+ @include animation.hover-animation-svg-icon(
92
+ variables.$yiq-text-dark,
93
+ "2050",
94
+ 2
95
+ );
96
+ }
97
+
98
+ // Button variants
99
+ @mixin button-variant(
100
+ $background,
101
+ $border,
102
+ $hover-background: darken(functions.get-solid-color($background), 10%),
103
+ $hover-border: $hover-background,
104
+ $active-background: map.get(variables.$theme-colors, "active"),
105
+ $active-border: $active-background
106
+ ) {
107
+ @include bootstrap.gradient-bg($background);
108
+ @include bootstrap.box-shadow(button.$btn-box-shadow);
109
+
110
+ color: bootstrap.color-yiq($background);
111
+ border-color: $border;
112
+ text-decoration: none;
113
+
114
+ @include bootstrap.hover {
115
+ @include bootstrap.gradient-bg($hover-background);
116
+
117
+ color: bootstrap.color-yiq($hover-background);
118
+ border-color: $hover-border;
119
+ }
120
+
121
+ &:focus,
122
+ &.focus {
123
+ // Avoid using mixin so we can pass custom focus shadow properly
124
+ @if options.$enable-shadows {
125
+ box-shadow: button.$btn-box-shadow,
126
+ 0 0 0 button.$btn-focus-width rgba($border, .5);
127
+ } @else if $border != transparent {
128
+ box-shadow: 0 0 0 button.$btn-focus-width rgba($border, .5);
129
+ }
130
+ }
131
+
132
+ // Disabled comes first so active can properly restyle
133
+ &.disabled,
134
+ &:disabled {
135
+ color: bootstrap.color-yiq($background);
136
+ background-color: opacify($background, .8);
137
+ border-color: $border;
138
+
139
+ //stylelint-disable-next-line order/order
140
+ @if ($background == transparent) {
141
+ background-color: transparent;
142
+ }
143
+
144
+ //stylelint-disable-next-line order/order
145
+ @if $border != transparent {
146
+ border-color: opacify($border, .5);
147
+ }
148
+ }
149
+
150
+ &:not(:disabled):not(.disabled).active,
151
+ .show > &.dropdown-toggle {
152
+ @if options.$enable-gradients {
153
+ background-image: none; // Remove the gradient for the pressed/active state
154
+ }
155
+
156
+ color: bootstrap.color-yiq($active-background);
157
+ background-color: $active-background;
158
+ border-color: $active-border;
159
+
160
+ &:focus {
161
+ // Avoid using mixin so we can pass custom focus shadow properly
162
+ @if options.$enable-shadows {
163
+ box-shadow: button.$btn-active-box-shadow,
164
+ 0 0 0 button.$btn-focus-width rgba($border, .5);
165
+ } @else {
166
+ box-shadow: 0 0 0 button.$btn-focus-width rgba($border, .5);
167
+ }
168
+ }
169
+ }
170
+
171
+ &.btn-animated {
172
+ @if (bootstrap.color-yiq($hover-background) == variables.$yiq-text-dark) {
173
+ @extend %btn-animation-arrow-dark;
174
+ } @else {
175
+ @extend %btn-animation-arrow-light;
176
+ }
177
+ }
178
+ }
179
+
180
+ @mixin button-outline-variant(
181
+ $color,
182
+ $color-hover: variables.$black,
183
+ $active-background: transparent,
184
+ $active-border: $color-hover
185
+ ) {
186
+ color: $color;
187
+ background-color: transparent;
188
+ background-image: none;
189
+ border-color: rgba($color, .5);
190
+ text-decoration: none;
191
+
192
+ &:hover,
193
+ &:not(:disabled):not(.disabled).active,
194
+ .show > &.dropdown-toggle {
195
+ color: $color-hover;
196
+ background-color: $active-background;
197
+ border-color: $color-hover;
198
+ }
199
+
200
+ &:focus,
201
+ &.focus {
202
+ box-shadow: 0 0 0 button.$btn-focus-width rgba($color, .5);
203
+ }
204
+
205
+ &.disabled,
206
+ &:disabled {
207
+ color: $color;
208
+ background-color: transparent;
209
+ border-color: rgba($color, .5);
210
+ }
211
+
212
+ &:not(:disabled):not(.disabled).active,
213
+ .show > &.dropdown-toggle {
214
+ &:focus {
215
+ // Avoid using mixin so we can pass custom focus shadow properly
216
+ @if options.$enable-shadows and button.$btn-active-box-shadow != none {
217
+ box-shadow: button.$btn-active-box-shadow,
218
+ 0 0 0 button.$btn-focus-width rgba($color, .5);
219
+ } @else {
220
+ box-shadow: 0 0 0 button.$btn-focus-width rgba($color, .5);
221
+ }
222
+ }
223
+ }
224
+
225
+ &.btn-animated {
226
+ @if (bootstrap.color-yiq($color-hover) == variables.$yiq-text-dark) {
227
+ @extend %btn-animation-arrow-light;
228
+ } @else {
229
+ @extend %btn-animation-arrow-dark;
230
+ }
231
+ }
232
+ }
@@ -0,0 +1,188 @@
1
+ @use "../themes/bootstrap/overrides" as bootstrap;
2
+
3
+ @use "../variables";
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
+ &::-webkit-input-placeholder {
17
+ @content;
18
+ }
19
+ }
20
+
21
+ // Bootstrap override
22
+ /// The entire mixin had to be overriden to adjust the feedback on custom controls.
23
+ /// For the most part, it is exactly like the bootstrap mixin.
24
+ @mixin form-validation-state($state, $color, $icon) {
25
+
26
+ .#{$state}-feedback {
27
+ display: none;
28
+ width: 100%;
29
+ margin-top: forms.$form-feedback-margin-top;
30
+ font-size: forms.$form-feedback-font-size;
31
+ color: $color;
32
+ }
33
+
34
+ .#{$state}-tooltip {
35
+ @include bootstrap.border-radius(tooltips.$tooltip-border-radius);
36
+
37
+ position: absolute;
38
+ top: 100%;
39
+ z-index: 5;
40
+ display: none;
41
+ max-width: 100%; // Contain to parent when possible
42
+ padding: tooltips.$tooltip-padding-y tooltips.$tooltip-padding-x;
43
+ margin-top: .1rem;
44
+ font-size: tooltips.$tooltip-font-size;
45
+ line-height: variables.$line-height-base;
46
+ color: bootstrap.color-yiq($color);
47
+
48
+ /* Keeping borders gray while maintaining a green background on tooltips */
49
+ //stylelint-disable-next-line order/order
50
+ @if ($state == "valid") {
51
+ background-color: rgba(forms.$form-feedback-valid-bg, tooltips.$tooltip-opacity);
52
+ } @else {
53
+ background-color: rgba($color, tooltips.$tooltip-opacity);
54
+ }
55
+ }
56
+
57
+ .form-control,
58
+ .custom-select {
59
+ .was-validated &:#{$state},
60
+ &.is-#{$state} {
61
+ border-color: $color;
62
+
63
+ &:focus {
64
+ border-color: $color;
65
+ box-shadow: 0 0 0 forms.$input-focus-width rgba($color, .25);
66
+ }
67
+
68
+ ~ .#{$state}-feedback,
69
+ ~ .#{$state}-tooltip {
70
+ display: block;
71
+ }
72
+ }
73
+ }
74
+
75
+ .form-control-file {
76
+ .was-validated &:#{$state},
77
+ &.is-#{$state} {
78
+ ~ .#{$state}-feedback,
79
+ ~ .#{$state}-tooltip {
80
+ display: block;
81
+ }
82
+ }
83
+ }
84
+
85
+ .form-check-input {
86
+ .was-validated &:#{$state},
87
+ &.is-#{$state} {
88
+ ~ .form-check-label {
89
+ color: $color;
90
+ }
91
+
92
+ ~ .#{$state}-feedback,
93
+ ~ .#{$state}-tooltip {
94
+ display: block;
95
+ }
96
+ }
97
+ }
98
+
99
+ .custom-control-input {
100
+ .was-validated &:#{$state},
101
+ &.is-#{$state} {
102
+ ~ .custom-control-label {
103
+ color: $color;
104
+
105
+ &::before {
106
+ border-color: $color;
107
+ background: variables.$white;
108
+ }
109
+ }
110
+
111
+ ~ .#{$state}-feedback,
112
+ ~ .#{$state}-tooltip {
113
+ display: block;
114
+ }
115
+
116
+ &:focus {
117
+ ~ .custom-control-label::before {
118
+ box-shadow: 0 0 0 1px variables.$body-bg,
119
+ 0 0 0 forms.$input-focus-width rgba($color, .25);
120
+ }
121
+ }
122
+ }
123
+ }
124
+
125
+ // custom file
126
+ .custom-file-input {
127
+ .was-validated &:#{$state},
128
+ &.is-#{$state} {
129
+ ~ .custom-file-label {
130
+ border-color: $color;
131
+
132
+ &::after {
133
+ border-color: inherit;
134
+ }
135
+ }
136
+
137
+ ~ .#{$state}-feedback,
138
+ ~ .#{$state}-tooltip {
139
+ display: block;
140
+ }
141
+
142
+ &:focus {
143
+ ~ .custom-file-label {
144
+ box-shadow: 0 0 0 forms.$input-focus-width rgba($color, .25);
145
+ }
146
+ }
147
+ }
148
+ }
149
+ }
150
+
151
+ @mixin label-floated-style {
152
+ font-size: forms.$floating-label-font-size-small;
153
+ top: forms.$floating-label-transition-distance * -1;
154
+ }
155
+
156
+ @mixin icon-placement {
157
+ background-repeat: no-repeat;
158
+ background-position: calc(100% - #{forms.$form-feedback-icon-offset}) center;
159
+ padding-right: forms.$form-feedback-icon-offset + forms.$form-feedback-icon-size;
160
+ }
161
+
162
+ @mixin floating-label-style {
163
+ @include utilities.truncate;
164
+
165
+ display: block;
166
+ color: forms.$floating-label-color;
167
+ font-size: forms.$floating-label-font-size;
168
+ width: calc(100% - 2 * #{variables.$spacer} - #{forms.$input-border-width} - #{forms.$floating-label-spacing-x});
169
+
170
+ position: absolute;
171
+ top: forms.$input-border-width;
172
+ margin-left: forms.$input-border-width;
173
+
174
+ padding: forms.$floating-label-padding;
175
+ transition: variables.$transition-base;
176
+
177
+ font-weight: normal;
178
+ pointer-events: none;
179
+ }
180
+
181
+ @mixin form-control-rg {
182
+ @include bootstrap.border-radius(forms.$input-border-radius-rg);
183
+
184
+ height: forms.$input-height-rg;
185
+ padding: forms.$input-padding-y-rg forms.$input-padding-x-rg;
186
+ font-size: variables.$font-size-rg;
187
+ line-height: forms.$input-line-height-rg;
188
+ }
@@ -0,0 +1,27 @@
1
+ @use "sass:map";
2
+ @use "sass:meta";
3
+ @use "sass:color";
4
+
5
+ @use "../variables/color" as color-var;
6
+ @use "../functions/icons" as icon-fn;
7
+
8
+ @mixin pi($name, $color: color-var.$body-color) {
9
+ $type: meta.type-of($color);
10
+ $final-color: $color;
11
+
12
+ @if ($type != color) {
13
+ $final-color: map.get(color-var.$icon-colors, $color);
14
+
15
+ @if (not $final-color) {
16
+ $valid-colors: map.keys(color-var.$icon-colors);
17
+
18
+ @error "Error in Mixin 'pi(name, color?)'. Color '#{$color}' is not available. Please choose one of the following: #{$valid-colors}.";
19
+ }
20
+ }
21
+ background-image: url(icon-fn.get-colored-svg-url($name, $final-color));
22
+ border-color: $final-color;
23
+ }
24
+
25
+ @mixin pi-pre($name) {
26
+ background-image: url(icon-fn.get-pre-colored-svg-url($name));
27
+ }
@@ -0,0 +1,13 @@
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, .2), rgba(color.$black, .1) 25%, transparent) center top/100% 4px no-repeat scroll;
8
+ $shadow-bottom: linear-gradient(transparent, rgba(color.$black, .1) 75%, rgba(color.$black, .2)) center bottom/100% 4px no-repeat scroll;
9
+ $shadow-cover-top: linear-gradient(#{$background-color}, #{$background-color}) center top/100% 4px no-repeat local;
10
+ $shadow-cover-bottom: linear-gradient(#{$background-color}, #{$background-color}) center bottom/100% 4px no-repeat local;
11
+
12
+ background: $shadow-cover-top, $shadow-top, $shadow-cover-bottom, $shadow-bottom;
13
+ }
@@ -0,0 +1,69 @@
1
+ @use "sass:map";
2
+ @use "sass:string";
3
+
4
+ @use "../themes/bootstrap/overrides" as bootstrap;
5
+
6
+ @use "../variables/spacing";
7
+ @use "../functions/utilities";
8
+
9
+ @mixin bezel-small() {
10
+ padding: map.get(spacing.$post-sizes, "mini")
11
+ map.get(spacing.$post-sizes, "regular");
12
+ }
13
+
14
+ @mixin bezel-small-regular() {
15
+ padding: map.get(spacing.$post-sizes, "small-regular")
16
+ map.get(spacing.$post-sizes, "regular");
17
+ }
18
+
19
+ @mixin bezel-regular() {
20
+ padding: map.get(spacing.$post-sizes, "regular");
21
+ }
22
+
23
+ @mixin bezel-bigger-regular() {
24
+ padding: map.get(spacing.$post-sizes, "small-large");
25
+ }
26
+
27
+ @mixin bezel-medium() {
28
+ padding: map.get(spacing.$post-sizes, "small-large")
29
+ map.get(spacing.$post-sizes, "large");
30
+ }
31
+
32
+ @mixin bezel-large() {
33
+ padding: map.get(spacing.$post-sizes, "big");
34
+ }
35
+
36
+ @mixin bezel-big() {
37
+ padding: map.get(spacing.$post-sizes, "bigger-big");
38
+ }
39
+
40
+ ///**
41
+ // * Generate responsive size properties for things like height, width, margin, padding, etc.
42
+ // * @param $curve-size One of the curve sizes predefined at https://www.experience-hub.ch/document/2307#/grundlagen-web/abstaende
43
+ // * @param $property Property key (height, width, padding, margin, top, etc.)
44
+ // * @param $template Value template string used for shorthand declarations like padding ("$value auto" = padding: 1rem auto)
45
+ // */
46
+ @mixin responsive-size($curve-size: "regular", $property-key: "padding", $template: "$value") {
47
+ $curve: map.get(spacing.$size-curves, $curve-size);
48
+
49
+ @if ($curve) {
50
+ $cache: "";
51
+
52
+ @each $key, $value in $curve {
53
+ @if ($key == "xs") {
54
+ #{$property-key}: string.unquote(utilities.replace($template, "$value", $value));
55
+ } @else {
56
+ // Don't write unnecessary media queries
57
+ @if ($cache != $value) {
58
+ @include bootstrap.media-breakpoint-up($key) {
59
+ #{$property-key}: string.unquote(utilities.replace($template, "$value", $value));
60
+ }
61
+ }
62
+ }
63
+ //stylelint-disable-next-line order/order
64
+ $cache: $value;
65
+ }
66
+ } @else {
67
+ @warn "@mixin responsive-size: Can't find $curve-size: " + $curve-size;
68
+ }
69
+ }
@@ -0,0 +1,187 @@
1
+ @use "../variables/breakpoints";
2
+ @use "../functions/sizing";
3
+ @use "../functions/utilities";
4
+ @use "../themes/bootstrap/overrides" as bootstrap;
5
+
6
+ // TODO: rewrite this as docblockr comment
7
+ // Sets font-size and calculate line-height depending on the font-size
8
+ // $argList: ($minValueS, $maxValueS, $minValueM, $maxValueM, $minValueL, $maxValueL);
9
+ @mixin fontSizeAndLineHeight($argList...) {
10
+ @include fontSizeCalc($argList...);
11
+ @include fontLineHeight($argList...);
12
+ }
13
+
14
+ @mixin font-curve($minFontSize, $maxFontSize, $minScreenSize, $maxScreenSize) {
15
+ @media screen and (min-width: #{$minScreenSize}) {
16
+ @if (sizing.strip-unit($minFontSize) == sizing.strip-unit($maxFontSize)) {
17
+ font-size: $minFontSize;
18
+ } @else {
19
+ // prettier-ignore
20
+ font-size: calc(
21
+ #{$minFontSize}
22
+ + #{sizing.strip-unit($maxFontSize)
23
+ - sizing.strip-unit($minFontSize)}
24
+ * (
25
+ (100vw - #{sizing.px-to-rem($minScreenSize)})
26
+ / #{sizing.strip-unit(sizing.px-to-rem($maxScreenSize))
27
+ - sizing.strip-unit(sizing.px-to-rem($minScreenSize))}
28
+ )
29
+ );
30
+ }
31
+ }
32
+ }
33
+
34
+ @mixin fontSizeCalc($argList...) {
35
+ // Smallest size with no scaling
36
+ font-size: nth($argList, 1);
37
+
38
+ // stylelint-disable-next-line order/order
39
+ @include font-curve(
40
+ nth($argList, 1),
41
+ nth($argList, 2),
42
+ 320px,
43
+ map-get(breakpoints.$grid-breakpoints, sm)
44
+ );
45
+
46
+ @if (length($argList) > 2) {
47
+ @include font-curve(
48
+ nth($argList, 2),
49
+ nth($argList, 3),
50
+ map-get(breakpoints.$grid-breakpoints, sm),
51
+ map-get(breakpoints.$grid-breakpoints, rg)
52
+ );
53
+ }
54
+
55
+ @if (length($argList) > 3) {
56
+ @include font-curve(
57
+ nth($argList, 3),
58
+ nth($argList, 4),
59
+ map-get(breakpoints.$grid-breakpoints, rg),
60
+ map-get(breakpoints.$grid-breakpoints, md)
61
+ );
62
+ }
63
+
64
+ @if (length($argList) > 4) {
65
+ @include font-curve(
66
+ nth($argList, 4),
67
+ nth($argList, 5),
68
+ map-get(breakpoints.$grid-breakpoints, md),
69
+ map-get(breakpoints.$grid-breakpoints, lg)
70
+ );
71
+ }
72
+
73
+ @if (length($argList) > 5) {
74
+ @include font-curve(
75
+ nth($argList, 5),
76
+ nth($argList, 6),
77
+ map-get(breakpoints.$grid-breakpoints, lg),
78
+ map-get(breakpoints.$grid-breakpoints, xl)
79
+ );
80
+
81
+ // Largest size with no scaling
82
+ @include bootstrap.media-breakpoint-up(xl) {
83
+ font-size: nth($argList, 6);
84
+ }
85
+ }
86
+ }
87
+
88
+ @mixin fontLineHeight($argList...) {
89
+ $min: (nth($argList, 1) / 1rem);
90
+ $max: (nth($argList, 2) / 1rem);
91
+ $line-height: sizing.line-height-calc(utilities.average($min, $max));
92
+
93
+ // stylelint-disable order/order
94
+ line-height: $line-height;
95
+
96
+ @if (length($argList) > 2) {
97
+ $min: (nth($argList, 2) / 1rem);
98
+ $max: (nth($argList, 3) / 1rem);
99
+ $line-height-old: $line-height;
100
+ $line-height: sizing.line-height-calc(utilities.average($min, $max));
101
+
102
+ // Only render new line-height, if not the same as on last breakpoint
103
+ @if $line-height != $line-height-old {
104
+ @include bootstrap.media-breakpoint-up(sm) {
105
+ line-height: $line-height;
106
+ }
107
+ }
108
+ }
109
+
110
+ @if (length($argList) > 3) {
111
+ $min: (nth($argList, 3) / 1rem);
112
+ $max: (nth($argList, 4) / 1rem);
113
+ $line-height-old: $line-height;
114
+ $line-height: sizing.line-height-calc(utilities.average($min, $max));
115
+
116
+ // Only render new line-height, if not the same as on last breakpoint
117
+ @if $line-height != $line-height-old {
118
+ @include bootstrap.media-breakpoint-up(rg) {
119
+ line-height: $line-height;
120
+ }
121
+ }
122
+ }
123
+
124
+ @if (length($argList) > 4) {
125
+ $min: (nth($argList, 4) / 1rem);
126
+ $max: (nth($argList, 5) / 1rem);
127
+ $line-height-old: $line-height;
128
+ $line-height: sizing.line-height-calc(utilities.average($min, $max));
129
+
130
+ // Only render new line-height, if not the same as on last breakpoint
131
+ @if $line-height != $line-height-old {
132
+ @include bootstrap.media-breakpoint-up(md) {
133
+ line-height: $line-height;
134
+ }
135
+ }
136
+ }
137
+
138
+ @if (length($argList) > 5) {
139
+ $min: (nth($argList, 5) / 1rem);
140
+ $max: (nth($argList, 6) / 1rem);
141
+ $line-height-old: $line-height;
142
+ $line-height: sizing.line-height-calc(utilities.average($min, $max));
143
+
144
+ // Only render new line-height, if not the same as on last breakpoint
145
+ @if $line-height != $line-height-old {
146
+ @include bootstrap.media-breakpoint-up(lg) {
147
+ line-height: $line-height;
148
+ }
149
+ }
150
+ }
151
+
152
+ @if (length($argList) > 5) {
153
+ $line-height-old: $line-height;
154
+ $line-height: sizing.line-height-calc(nth($argList, 6) / 1rem);
155
+
156
+ // Only render new line-height, if not the same as on last breakpoint
157
+ @if $line-height != $line-height-old {
158
+ @include bootstrap.media-breakpoint-up(xl) {
159
+ line-height: $line-height;
160
+ }
161
+ }
162
+ }
163
+
164
+ // stylelint-enable order/order
165
+ }
166
+
167
+ // Better font rendering (on OS X)
168
+ // http://maximilianhoffmann.com/posts/better-font-rendering-on-osx
169
+ //
170
+ // Usage:
171
+ //
172
+ // .xy--dark-on-light {
173
+ // @include fontSmoothing;
174
+ // }
175
+ // .xy--light-on-dark {
176
+ // @include fontSmoothingReset;
177
+ // }
178
+
179
+ @mixin font-smoothing() {
180
+ -webkit-font-smoothing: antialiased;
181
+ -moz-osx-font-smoothing: grayscale;
182
+ }
183
+
184
+ @mixin font-smoothing-reset() {
185
+ -webkit-font-smoothing: subpixel-antialiased;
186
+ -moz-osx-font-smoothing: auto;
187
+ }