@festo-ui/web-essentials 8.2.0-dev.630 → 8.2.0-dev.637
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/README.md +83 -83
- package/dist/css/festo-web-essentials.css +9 -12
- package/dist/css/festo-web-essentials.css.map +1 -1
- package/dist/css/festo-web-essentials.min.css +12 -12
- package/dist/css/festo-web-essentials.min.css.map +1 -1
- package/dist/css/light/festo-web-essentials-light.css +0 -3
- package/dist/css/light/festo-web-essentials-light.css.map +1 -1
- package/dist/css/themes/flatpickr/festo.css +1 -1
- package/dist/css/themes/flatpickr/festo.min.css +1 -1
- package/dist/scss/_badge.scss +49 -49
- package/dist/scss/_border.scss +86 -86
- package/dist/scss/_bottom-navigation.scss +47 -47
- package/dist/scss/_bottom-sheet.scss +116 -116
- package/dist/scss/_colors.scss +11 -11
- package/dist/scss/_display.scss +63 -63
- package/dist/scss/_flex.scss +269 -269
- package/dist/scss/_grid.scss +44 -44
- package/dist/scss/_layout.scss +64 -64
- package/dist/scss/_list.scss +211 -211
- package/dist/scss/_misc.scss +51 -51
- package/dist/scss/_mixins.scss +51 -51
- package/dist/scss/_modal.scss +233 -233
- package/dist/scss/_normalize.scss +369 -369
- package/dist/scss/_pagination.scss +124 -124
- package/dist/scss/_rfs.scss +177 -177
- package/dist/scss/_segment.scss +146 -146
- package/dist/scss/_sidebar-overlay.scss +51 -51
- package/dist/scss/_slider.scss +150 -150
- package/dist/scss/_snackbar.scss +159 -159
- package/dist/scss/_spacing.scss +51 -51
- package/dist/scss/_switch.scss +145 -145
- package/dist/scss/_text-input.scss +191 -191
- package/dist/scss/_text-link.scss +52 -52
- package/dist/scss/_toolbar.scss +83 -83
- package/dist/scss/_type.scss +50 -50
- package/dist/scss/_utils.scss +9 -9
- package/dist/scss/festo-web-essentials.scss +1 -1
- package/dist/scss/light/_border-light.scss +75 -75
- package/dist/scss/light/_flex-light.scss +258 -258
- package/dist/scss/light/_spacing-light.scss +52 -52
- package/dist/scss/light/festo-web-essentials-light.scss +59 -59
- package/dist/scss/organisms/_header-modul.scss +111 -111
- package/dist/scss/organisms/_teaser.scss +96 -96
- package/dist/scss/themes/flatpickr/festo.scss +1 -1
- package/package.json +10 -16
- package/scss/_badge.scss +49 -49
- package/scss/_border.scss +86 -86
- package/scss/_bottom-navigation.scss +47 -47
- package/scss/_bottom-sheet.scss +116 -116
- package/scss/_colors.scss +11 -11
- package/scss/_display.scss +63 -63
- package/scss/_flex.scss +269 -269
- package/scss/_grid.scss +44 -44
- package/scss/_layout.scss +64 -64
- package/scss/_list.scss +211 -211
- package/scss/_misc.scss +51 -51
- package/scss/_mixins.scss +51 -51
- package/scss/_modal.scss +233 -233
- package/scss/_normalize.scss +369 -369
- package/scss/_pagination.scss +124 -124
- package/scss/_rfs.scss +177 -177
- package/scss/_segment.scss +146 -146
- package/scss/_sidebar-overlay.scss +51 -51
- package/scss/_slider.scss +150 -150
- package/scss/_snackbar.scss +159 -159
- package/scss/_spacing.scss +51 -51
- package/scss/_switch.scss +145 -145
- package/scss/_text-input.scss +191 -191
- package/scss/_text-link.scss +52 -52
- package/scss/_toolbar.scss +83 -83
- package/scss/_type.scss +50 -50
- package/scss/_utils.scss +9 -9
- package/scss/light/_border-light.scss +75 -75
- package/scss/light/_flex-light.scss +258 -258
- package/scss/light/_spacing-light.scss +52 -52
- package/scss/light/festo-web-essentials-light.scss +59 -59
- package/scss/organisms/_header-modul.scss +111 -111
- package/scss/organisms/_teaser.scss +96 -96
package/scss/_pagination.scss
CHANGED
|
@@ -1,124 +1,124 @@
|
|
|
1
|
-
@use "variables";
|
|
2
|
-
|
|
3
|
-
.fwe-pagination {
|
|
4
|
-
display: flex;
|
|
5
|
-
|
|
6
|
-
.fwe-navigate-btn {
|
|
7
|
-
&::before {
|
|
8
|
-
content: "";
|
|
9
|
-
height: 24px;
|
|
10
|
-
width: 24px;
|
|
11
|
-
background-color: variables.$text;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
line-height: normal;
|
|
15
|
-
box-sizing: border-box;
|
|
16
|
-
display: inline-flex;
|
|
17
|
-
align-items: center;
|
|
18
|
-
text-align: center;
|
|
19
|
-
font-family: variables.$font-family-base;
|
|
20
|
-
padding: 0px;
|
|
21
|
-
height: 24px;
|
|
22
|
-
width: 24px;
|
|
23
|
-
background: transparent;
|
|
24
|
-
cursor: pointer;
|
|
25
|
-
border: none;
|
|
26
|
-
|
|
27
|
-
&:hover {
|
|
28
|
-
&::before {
|
|
29
|
-
background-color: variables.$hero;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&:active {
|
|
34
|
-
&::before {
|
|
35
|
-
background-color: variables.$hero-hover;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
&:focus {
|
|
40
|
-
outline: 0;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
&:disabled,
|
|
44
|
-
&.fwe-disabled {
|
|
45
|
-
cursor: default;
|
|
46
|
-
|
|
47
|
-
&::before {
|
|
48
|
-
background-color: variables.$text-disabled;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.fwe-navigate-btn-up {
|
|
54
|
-
@extend .fwe-navigate-btn;
|
|
55
|
-
|
|
56
|
-
&::before {
|
|
57
|
-
mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGRhdGEtbmFtZT0id2hpdGUgYmFja2dyb3VuZCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSJub25lIiBkPSJNMCAyNFYwaDI0djI0eiIvPjxwYXRoIGQ9Ik05LjE3MiAxOC4zNjQgMTUuNTM2IDEyIDkuMTcyIDUuNjM2bC0uNzA4LjcwN0wxNC4xMjEgMTJsLTUuNjU3IDUuNjU3LjcwOC43MDd6Ii8+PC9zdmc+");
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.fwe-navigate-btn-down {
|
|
62
|
-
@extend .fwe-navigate-btn;
|
|
63
|
-
|
|
64
|
-
&::before {
|
|
65
|
-
mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGRhdGEtbmFtZT0id2hpdGUgYmFja2dyb3VuZCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSJub25lIiBkPSJNMCAyNFYwaDI0djI0eiIvPjxwYXRoIGQ9Ik0xNC44MjggNS42MzYgOC40NjQgMTJsNi4zNjQgNi4zNjQuNzA4LS43MDdMOS44NzkgMTJsNS42NTctNS42NTctLjcwOC0uNzA3eiIvPjwvc3ZnPg==");
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.fwe-page-dot {
|
|
70
|
-
cursor: pointer;
|
|
71
|
-
display: inline-block;
|
|
72
|
-
width: 6px;
|
|
73
|
-
height: 6px;
|
|
74
|
-
margin: 9px 4px;
|
|
75
|
-
background: variables.$control-border;
|
|
76
|
-
border-radius: 50%;
|
|
77
|
-
|
|
78
|
-
&:hover {
|
|
79
|
-
background: variables.$control-border-hover;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
&.fwe-selected {
|
|
83
|
-
background: variables.$hero;
|
|
84
|
-
cursor: default;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.fwe-page-current {
|
|
89
|
-
font-feature-settings: variables.$font-feature-settings;
|
|
90
|
-
font-weight: variables.$font-weight-bold;
|
|
91
|
-
border-right: 1px solid variables.$text;
|
|
92
|
-
padding: 0px 12px 0px 4px;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.fwe-page-max {
|
|
96
|
-
font-feature-settings: variables.$font-feature-settings;
|
|
97
|
-
line-height: 24px;
|
|
98
|
-
padding: 0px 4px 0px 12px;
|
|
99
|
-
font-weight: variables.$font-weight-normal;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.fwe-pagination.fwe-pagination--on-dark-bg {
|
|
104
|
-
.fwe-navigate-btn-down {
|
|
105
|
-
&::before {
|
|
106
|
-
background-color: variables.$white;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.fwe-navigate-btn-up {
|
|
111
|
-
&::before {
|
|
112
|
-
background-color: variables.$white;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.fwe-page-current {
|
|
117
|
-
color: variables.$white;
|
|
118
|
-
border-right: 1px solid variables.$white;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.fwe-page-max {
|
|
122
|
-
color: variables.$white;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
1
|
+
@use "variables";
|
|
2
|
+
|
|
3
|
+
.fwe-pagination {
|
|
4
|
+
display: flex;
|
|
5
|
+
|
|
6
|
+
.fwe-navigate-btn {
|
|
7
|
+
&::before {
|
|
8
|
+
content: "";
|
|
9
|
+
height: 24px;
|
|
10
|
+
width: 24px;
|
|
11
|
+
background-color: variables.$text;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
line-height: normal;
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
text-align: center;
|
|
19
|
+
font-family: variables.$font-family-base;
|
|
20
|
+
padding: 0px;
|
|
21
|
+
height: 24px;
|
|
22
|
+
width: 24px;
|
|
23
|
+
background: transparent;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
border: none;
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
&::before {
|
|
29
|
+
background-color: variables.$hero;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&:active {
|
|
34
|
+
&::before {
|
|
35
|
+
background-color: variables.$hero-hover;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:focus {
|
|
40
|
+
outline: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&:disabled,
|
|
44
|
+
&.fwe-disabled {
|
|
45
|
+
cursor: default;
|
|
46
|
+
|
|
47
|
+
&::before {
|
|
48
|
+
background-color: variables.$text-disabled;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.fwe-navigate-btn-up {
|
|
54
|
+
@extend .fwe-navigate-btn;
|
|
55
|
+
|
|
56
|
+
&::before {
|
|
57
|
+
mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGRhdGEtbmFtZT0id2hpdGUgYmFja2dyb3VuZCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSJub25lIiBkPSJNMCAyNFYwaDI0djI0eiIvPjxwYXRoIGQ9Ik05LjE3MiAxOC4zNjQgMTUuNTM2IDEyIDkuMTcyIDUuNjM2bC0uNzA4LjcwN0wxNC4xMjEgMTJsLTUuNjU3IDUuNjU3LjcwOC43MDd6Ii8+PC9zdmc+");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.fwe-navigate-btn-down {
|
|
62
|
+
@extend .fwe-navigate-btn;
|
|
63
|
+
|
|
64
|
+
&::before {
|
|
65
|
+
mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGRhdGEtbmFtZT0id2hpdGUgYmFja2dyb3VuZCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSJub25lIiBkPSJNMCAyNFYwaDI0djI0eiIvPjxwYXRoIGQ9Ik0xNC44MjggNS42MzYgOC40NjQgMTJsNi4zNjQgNi4zNjQuNzA4LS43MDdMOS44NzkgMTJsNS42NTctNS42NTctLjcwOC0uNzA3eiIvPjwvc3ZnPg==");
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.fwe-page-dot {
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
display: inline-block;
|
|
72
|
+
width: 6px;
|
|
73
|
+
height: 6px;
|
|
74
|
+
margin: 9px 4px;
|
|
75
|
+
background: variables.$control-border;
|
|
76
|
+
border-radius: 50%;
|
|
77
|
+
|
|
78
|
+
&:hover {
|
|
79
|
+
background: variables.$control-border-hover;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&.fwe-selected {
|
|
83
|
+
background: variables.$hero;
|
|
84
|
+
cursor: default;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.fwe-page-current {
|
|
89
|
+
font-feature-settings: variables.$font-feature-settings;
|
|
90
|
+
font-weight: variables.$font-weight-bold;
|
|
91
|
+
border-right: 1px solid variables.$text;
|
|
92
|
+
padding: 0px 12px 0px 4px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.fwe-page-max {
|
|
96
|
+
font-feature-settings: variables.$font-feature-settings;
|
|
97
|
+
line-height: 24px;
|
|
98
|
+
padding: 0px 4px 0px 12px;
|
|
99
|
+
font-weight: variables.$font-weight-normal;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.fwe-pagination.fwe-pagination--on-dark-bg {
|
|
104
|
+
.fwe-navigate-btn-down {
|
|
105
|
+
&::before {
|
|
106
|
+
background-color: variables.$white;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.fwe-navigate-btn-up {
|
|
111
|
+
&::before {
|
|
112
|
+
background-color: variables.$white;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.fwe-page-current {
|
|
117
|
+
color: variables.$white;
|
|
118
|
+
border-right: 1px solid variables.$white;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.fwe-page-max {
|
|
122
|
+
color: variables.$white;
|
|
123
|
+
}
|
|
124
|
+
}
|
package/scss/_rfs.scss
CHANGED
|
@@ -1,177 +1,177 @@
|
|
|
1
|
-
@use "sass:meta";
|
|
2
|
-
// SCSS RFS mixin
|
|
3
|
-
// Automated responsive font sizes
|
|
4
|
-
// Licensed under MIT (https://github.com/twbs/rfs/blob/master/LICENSE)
|
|
5
|
-
|
|
6
|
-
// Configuration
|
|
7
|
-
|
|
8
|
-
// Base font size
|
|
9
|
-
@use "sass:math";
|
|
10
|
-
|
|
11
|
-
$rfs-base-font-size: 1.25rem !default;
|
|
12
|
-
$rfs-font-size-unit: rem !default;
|
|
13
|
-
|
|
14
|
-
@if $rfs-font-size-unit != rem and $rfs-font-size-unit != px {
|
|
15
|
-
@error "`#{$rfs-font-size-unit}` is not a valid unit for $rfs-font-size-unit. Use `px` or `rem`.";
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Breakpoint at where font-size starts decreasing if screen width is smaller
|
|
19
|
-
$rfs-breakpoint: 1200px !default;
|
|
20
|
-
$rfs-breakpoint-unit: px !default;
|
|
21
|
-
|
|
22
|
-
@if $rfs-breakpoint-unit != px and $rfs-breakpoint-unit != em and $rfs-breakpoint-unit != rem {
|
|
23
|
-
@error "`#{$rfs-breakpoint-unit}` is not a valid unit for $rfs-breakpoint-unit. Use `px`, `em` or `rem`.";
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Resize font size based on screen height and width
|
|
27
|
-
$rfs-two-dimensional: false !default;
|
|
28
|
-
|
|
29
|
-
// Factor of decrease
|
|
30
|
-
$rfs-factor: 10 !default;
|
|
31
|
-
|
|
32
|
-
@if meta.type-of($rfs-factor) != "number" or $rfs-factor <= 1 {
|
|
33
|
-
@error "`#{$rfs-factor}` is not a valid $rfs-factor, it must be greater than 1.";
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Generate enable or disable classes. Possibilities: false, "enable" or "disable"
|
|
37
|
-
$rfs-class: false !default;
|
|
38
|
-
|
|
39
|
-
// 1 rem = $rfs-rem-value px
|
|
40
|
-
$rfs-rem-value: 16 !default;
|
|
41
|
-
|
|
42
|
-
// Safari iframe resize bug: https://github.com/twbs/rfs/issues/14
|
|
43
|
-
$rfs-safari-iframe-resize-bug-fix: false !default;
|
|
44
|
-
|
|
45
|
-
// Disable RFS by setting $enable-responsive-font-sizes to false
|
|
46
|
-
$enable-responsive-font-sizes: true !default;
|
|
47
|
-
|
|
48
|
-
// Cache $rfs-base-font-size unit
|
|
49
|
-
$rfs-base-font-size-unit: math.unit($rfs-base-font-size);
|
|
50
|
-
|
|
51
|
-
// Remove px-unit from $rfs-base-font-size for calculations
|
|
52
|
-
@if $rfs-base-font-size-unit == "px" {
|
|
53
|
-
$rfs-base-font-size: math.div($rfs-base-font-size, $rfs-base-font-size * 0 + 1);
|
|
54
|
-
} @else if $rfs-base-font-size-unit == "rem" {
|
|
55
|
-
$rfs-base-font-size: math.div($rfs-base-font-size, $rfs-base-font-size * 0 + math.div(1, $rfs-rem-value));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// Cache $rfs-breakpoint unit to prevent multiple calls
|
|
59
|
-
$rfs-breakpoint-unit-cache: math.unit($rfs-breakpoint);
|
|
60
|
-
|
|
61
|
-
// Remove unit from $rfs-breakpoint for calculations
|
|
62
|
-
@if $rfs-breakpoint-unit-cache == "px" {
|
|
63
|
-
$rfs-breakpoint: math.div($rfs-breakpoint, $rfs-breakpoint * 0 + 1);
|
|
64
|
-
} @else if $rfs-breakpoint-unit-cache == "rem" or $rfs-breakpoint-unit-cache == "em" {
|
|
65
|
-
$rfs-breakpoint: math.div($rfs-breakpoint, $rfs-breakpoint * 0 + math.div(1, $rfs-rem-value));
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Internal mixin that adds disable classes to the selector if needed.
|
|
69
|
-
@mixin _rfs-disable-class {
|
|
70
|
-
@if $rfs-class == "disable" {
|
|
71
|
-
// Adding an extra class increases specificity, which prevents the media query to override the font size
|
|
72
|
-
&,
|
|
73
|
-
.disable-responsive-font-size &,
|
|
74
|
-
&.disable-responsive-font-size {
|
|
75
|
-
@content;
|
|
76
|
-
}
|
|
77
|
-
} @else {
|
|
78
|
-
@content;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// Internal mixin that adds enable classes to the selector if needed.
|
|
83
|
-
@mixin _rfs-enable-class {
|
|
84
|
-
@if $rfs-class == "enable" {
|
|
85
|
-
.enable-responsive-font-size &,
|
|
86
|
-
&.enable-responsive-font-size {
|
|
87
|
-
@content;
|
|
88
|
-
}
|
|
89
|
-
} @else {
|
|
90
|
-
@content;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// Internal mixin used to determine which media query needs to be used
|
|
95
|
-
@mixin _rfs-media-query($mq-value) {
|
|
96
|
-
@if $rfs-two-dimensional {
|
|
97
|
-
@media (max-width: #{$mq-value}), (max-height: #{$mq-value}) {
|
|
98
|
-
@content;
|
|
99
|
-
}
|
|
100
|
-
} @else {
|
|
101
|
-
@media (max-width: #{$mq-value}) {
|
|
102
|
-
@content;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Responsive font size mixin
|
|
108
|
-
@mixin rfs($fs, $important: false) {
|
|
109
|
-
// Cache $fs unit
|
|
110
|
-
$fs-unit: if(meta.type-of($fs) == "number", math.unit($fs), false);
|
|
111
|
-
|
|
112
|
-
// Add !important suffix if needed
|
|
113
|
-
$rfs-suffix: if($important, " !important", "");
|
|
114
|
-
|
|
115
|
-
// If $fs isn't a number (like inherit) or $fs has a unit (not px or rem, like 1.5em) or $ is 0, just print the value
|
|
116
|
-
@if not $fs-unit or $fs-unit != "" and $fs-unit != "px" and $fs-unit != "rem" or $fs == 0 {
|
|
117
|
-
font-size: #{$fs}#{$rfs-suffix};
|
|
118
|
-
} @else {
|
|
119
|
-
// Remove unit from $fs for calculations
|
|
120
|
-
@if $fs-unit == "px" {
|
|
121
|
-
$fs: math.div($fs, $fs * 0 + 1);
|
|
122
|
-
} @else if $fs-unit == "rem" {
|
|
123
|
-
$fs: math.div($fs, $fs * 0 + math.div(1, $rfs-rem-value));
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// Set default font size
|
|
127
|
-
$rfs-static: if($rfs-font-size-unit == rem, #{math.div($fs, $rfs-rem-value)}rem, #{$fs}px);
|
|
128
|
-
|
|
129
|
-
// Only add the media query if the font size is bigger than the minimum font size
|
|
130
|
-
@if $fs <= $rfs-base-font-size or not $enable-responsive-font-sizes {
|
|
131
|
-
font-size: #{$rfs-static}#{$rfs-suffix};
|
|
132
|
-
} @else {
|
|
133
|
-
// Calculate the minimum font size for $fs
|
|
134
|
-
$fs-min: $rfs-base-font-size + math.div($fs - $rfs-base-font-size, $rfs-factor);
|
|
135
|
-
|
|
136
|
-
// Calculate difference between $fs and the minimum font size
|
|
137
|
-
$fs-diff: $fs - $fs-min;
|
|
138
|
-
|
|
139
|
-
// Base font-size formatting
|
|
140
|
-
$min-width: if($rfs-font-size-unit == rem, #{math.div($fs-min, $rfs-rem-value)}rem, #{$fs-min}px);
|
|
141
|
-
|
|
142
|
-
// Use `vmin` if two-dimensional is enabled
|
|
143
|
-
$variable-unit: if($rfs-two-dimensional, vmin, vw);
|
|
144
|
-
|
|
145
|
-
// Calculate the variable width between 0 and $rfs-breakpoint
|
|
146
|
-
$variable-width: #{math.div($fs-diff * 100, $rfs-breakpoint)}#{$variable-unit};
|
|
147
|
-
|
|
148
|
-
// Set the calculated font-size
|
|
149
|
-
$rfs-fluid: calc(#{$min-width} + #{$variable-width}) #{$rfs-suffix};
|
|
150
|
-
|
|
151
|
-
// Breakpoint formatting
|
|
152
|
-
$mq-value: if($rfs-breakpoint-unit == px, #{$rfs-breakpoint}px, #{math.div($rfs-breakpoint, $rfs-rem-value)}#{$rfs-breakpoint-unit});
|
|
153
|
-
|
|
154
|
-
@include _rfs-disable-class {
|
|
155
|
-
font-size: #{$rfs-static}#{$rfs-suffix};
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
@include _rfs-media-query($mq-value) {
|
|
159
|
-
@include _rfs-enable-class {
|
|
160
|
-
font-size: $rfs-fluid;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// Include safari iframe resize fix if needed
|
|
164
|
-
min-width: if($rfs-safari-iframe-resize-bug-fix, (0 * 1vw), null);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// The font-size & responsive-font-size mixins use RFS to rescale the font size
|
|
171
|
-
@mixin font-size($fs, $important: false) {
|
|
172
|
-
@include rfs($fs, $important);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
@mixin responsive-font-size($fs, $important: false) {
|
|
176
|
-
@include rfs($fs, $important);
|
|
177
|
-
}
|
|
1
|
+
@use "sass:meta";
|
|
2
|
+
// SCSS RFS mixin
|
|
3
|
+
// Automated responsive font sizes
|
|
4
|
+
// Licensed under MIT (https://github.com/twbs/rfs/blob/master/LICENSE)
|
|
5
|
+
|
|
6
|
+
// Configuration
|
|
7
|
+
|
|
8
|
+
// Base font size
|
|
9
|
+
@use "sass:math";
|
|
10
|
+
|
|
11
|
+
$rfs-base-font-size: 1.25rem !default;
|
|
12
|
+
$rfs-font-size-unit: rem !default;
|
|
13
|
+
|
|
14
|
+
@if $rfs-font-size-unit != rem and $rfs-font-size-unit != px {
|
|
15
|
+
@error "`#{$rfs-font-size-unit}` is not a valid unit for $rfs-font-size-unit. Use `px` or `rem`.";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Breakpoint at where font-size starts decreasing if screen width is smaller
|
|
19
|
+
$rfs-breakpoint: 1200px !default;
|
|
20
|
+
$rfs-breakpoint-unit: px !default;
|
|
21
|
+
|
|
22
|
+
@if $rfs-breakpoint-unit != px and $rfs-breakpoint-unit != em and $rfs-breakpoint-unit != rem {
|
|
23
|
+
@error "`#{$rfs-breakpoint-unit}` is not a valid unit for $rfs-breakpoint-unit. Use `px`, `em` or `rem`.";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Resize font size based on screen height and width
|
|
27
|
+
$rfs-two-dimensional: false !default;
|
|
28
|
+
|
|
29
|
+
// Factor of decrease
|
|
30
|
+
$rfs-factor: 10 !default;
|
|
31
|
+
|
|
32
|
+
@if meta.type-of($rfs-factor) != "number" or $rfs-factor <= 1 {
|
|
33
|
+
@error "`#{$rfs-factor}` is not a valid $rfs-factor, it must be greater than 1.";
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Generate enable or disable classes. Possibilities: false, "enable" or "disable"
|
|
37
|
+
$rfs-class: false !default;
|
|
38
|
+
|
|
39
|
+
// 1 rem = $rfs-rem-value px
|
|
40
|
+
$rfs-rem-value: 16 !default;
|
|
41
|
+
|
|
42
|
+
// Safari iframe resize bug: https://github.com/twbs/rfs/issues/14
|
|
43
|
+
$rfs-safari-iframe-resize-bug-fix: false !default;
|
|
44
|
+
|
|
45
|
+
// Disable RFS by setting $enable-responsive-font-sizes to false
|
|
46
|
+
$enable-responsive-font-sizes: true !default;
|
|
47
|
+
|
|
48
|
+
// Cache $rfs-base-font-size unit
|
|
49
|
+
$rfs-base-font-size-unit: math.unit($rfs-base-font-size);
|
|
50
|
+
|
|
51
|
+
// Remove px-unit from $rfs-base-font-size for calculations
|
|
52
|
+
@if $rfs-base-font-size-unit == "px" {
|
|
53
|
+
$rfs-base-font-size: math.div($rfs-base-font-size, $rfs-base-font-size * 0 + 1);
|
|
54
|
+
} @else if $rfs-base-font-size-unit == "rem" {
|
|
55
|
+
$rfs-base-font-size: math.div($rfs-base-font-size, $rfs-base-font-size * 0 + math.div(1, $rfs-rem-value));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Cache $rfs-breakpoint unit to prevent multiple calls
|
|
59
|
+
$rfs-breakpoint-unit-cache: math.unit($rfs-breakpoint);
|
|
60
|
+
|
|
61
|
+
// Remove unit from $rfs-breakpoint for calculations
|
|
62
|
+
@if $rfs-breakpoint-unit-cache == "px" {
|
|
63
|
+
$rfs-breakpoint: math.div($rfs-breakpoint, $rfs-breakpoint * 0 + 1);
|
|
64
|
+
} @else if $rfs-breakpoint-unit-cache == "rem" or $rfs-breakpoint-unit-cache == "em" {
|
|
65
|
+
$rfs-breakpoint: math.div($rfs-breakpoint, $rfs-breakpoint * 0 + math.div(1, $rfs-rem-value));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Internal mixin that adds disable classes to the selector if needed.
|
|
69
|
+
@mixin _rfs-disable-class {
|
|
70
|
+
@if $rfs-class == "disable" {
|
|
71
|
+
// Adding an extra class increases specificity, which prevents the media query to override the font size
|
|
72
|
+
&,
|
|
73
|
+
.disable-responsive-font-size &,
|
|
74
|
+
&.disable-responsive-font-size {
|
|
75
|
+
@content;
|
|
76
|
+
}
|
|
77
|
+
} @else {
|
|
78
|
+
@content;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Internal mixin that adds enable classes to the selector if needed.
|
|
83
|
+
@mixin _rfs-enable-class {
|
|
84
|
+
@if $rfs-class == "enable" {
|
|
85
|
+
.enable-responsive-font-size &,
|
|
86
|
+
&.enable-responsive-font-size {
|
|
87
|
+
@content;
|
|
88
|
+
}
|
|
89
|
+
} @else {
|
|
90
|
+
@content;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Internal mixin used to determine which media query needs to be used
|
|
95
|
+
@mixin _rfs-media-query($mq-value) {
|
|
96
|
+
@if $rfs-two-dimensional {
|
|
97
|
+
@media (max-width: #{$mq-value}), (max-height: #{$mq-value}) {
|
|
98
|
+
@content;
|
|
99
|
+
}
|
|
100
|
+
} @else {
|
|
101
|
+
@media (max-width: #{$mq-value}) {
|
|
102
|
+
@content;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Responsive font size mixin
|
|
108
|
+
@mixin rfs($fs, $important: false) {
|
|
109
|
+
// Cache $fs unit
|
|
110
|
+
$fs-unit: if(meta.type-of($fs) == "number", math.unit($fs), false);
|
|
111
|
+
|
|
112
|
+
// Add !important suffix if needed
|
|
113
|
+
$rfs-suffix: if($important, " !important", "");
|
|
114
|
+
|
|
115
|
+
// If $fs isn't a number (like inherit) or $fs has a unit (not px or rem, like 1.5em) or $ is 0, just print the value
|
|
116
|
+
@if not $fs-unit or $fs-unit != "" and $fs-unit != "px" and $fs-unit != "rem" or $fs == 0 {
|
|
117
|
+
font-size: #{$fs}#{$rfs-suffix};
|
|
118
|
+
} @else {
|
|
119
|
+
// Remove unit from $fs for calculations
|
|
120
|
+
@if $fs-unit == "px" {
|
|
121
|
+
$fs: math.div($fs, $fs * 0 + 1);
|
|
122
|
+
} @else if $fs-unit == "rem" {
|
|
123
|
+
$fs: math.div($fs, $fs * 0 + math.div(1, $rfs-rem-value));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Set default font size
|
|
127
|
+
$rfs-static: if($rfs-font-size-unit == rem, #{math.div($fs, $rfs-rem-value)}rem, #{$fs}px);
|
|
128
|
+
|
|
129
|
+
// Only add the media query if the font size is bigger than the minimum font size
|
|
130
|
+
@if $fs <= $rfs-base-font-size or not $enable-responsive-font-sizes {
|
|
131
|
+
font-size: #{$rfs-static}#{$rfs-suffix};
|
|
132
|
+
} @else {
|
|
133
|
+
// Calculate the minimum font size for $fs
|
|
134
|
+
$fs-min: $rfs-base-font-size + math.div($fs - $rfs-base-font-size, $rfs-factor);
|
|
135
|
+
|
|
136
|
+
// Calculate difference between $fs and the minimum font size
|
|
137
|
+
$fs-diff: $fs - $fs-min;
|
|
138
|
+
|
|
139
|
+
// Base font-size formatting
|
|
140
|
+
$min-width: if($rfs-font-size-unit == rem, #{math.div($fs-min, $rfs-rem-value)}rem, #{$fs-min}px);
|
|
141
|
+
|
|
142
|
+
// Use `vmin` if two-dimensional is enabled
|
|
143
|
+
$variable-unit: if($rfs-two-dimensional, vmin, vw);
|
|
144
|
+
|
|
145
|
+
// Calculate the variable width between 0 and $rfs-breakpoint
|
|
146
|
+
$variable-width: #{math.div($fs-diff * 100, $rfs-breakpoint)}#{$variable-unit};
|
|
147
|
+
|
|
148
|
+
// Set the calculated font-size
|
|
149
|
+
$rfs-fluid: calc(#{$min-width} + #{$variable-width}) #{$rfs-suffix};
|
|
150
|
+
|
|
151
|
+
// Breakpoint formatting
|
|
152
|
+
$mq-value: if($rfs-breakpoint-unit == px, #{$rfs-breakpoint}px, #{math.div($rfs-breakpoint, $rfs-rem-value)}#{$rfs-breakpoint-unit});
|
|
153
|
+
|
|
154
|
+
@include _rfs-disable-class {
|
|
155
|
+
font-size: #{$rfs-static}#{$rfs-suffix};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@include _rfs-media-query($mq-value) {
|
|
159
|
+
@include _rfs-enable-class {
|
|
160
|
+
font-size: $rfs-fluid;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Include safari iframe resize fix if needed
|
|
164
|
+
min-width: if($rfs-safari-iframe-resize-bug-fix, (0 * 1vw), null);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// The font-size & responsive-font-size mixins use RFS to rescale the font size
|
|
171
|
+
@mixin font-size($fs, $important: false) {
|
|
172
|
+
@include rfs($fs, $important);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
@mixin responsive-font-size($fs, $important: false) {
|
|
176
|
+
@include rfs($fs, $important);
|
|
177
|
+
}
|