energy-foundations 2.5.0-beta.0 → 2.5.0-beta.2
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/dist/foundations/_grid.scss +9 -66
- package/dist/generated/icon-layers.js +1 -1
- package/dist/generated/icon-layers.ts +1 -1
- package/dist/generated/icon-names.js +1 -1
- package/dist/generated/icon-names.ts +1 -1
- package/dist/index.css +25 -34
- package/dist/mixins/_breakpoint-fixed.scss +26 -0
- package/dist/mixins/_layout.scss +205 -13
- package/dist/mixins/_typography.scss +8 -8
- package/dist/style.css +25 -34
- package/dist/variables/_grid.scss +1 -1
- package/llms/01-classes.md +1 -1
- package/llms/03-sass-variables-and-mixins.md +19 -0
- package/llms/04-layouts.md +170 -55
- package/package.json +2 -1
- package/src/foundations/_grid.scss +9 -66
- package/src/generated/icon-layers.js +1 -1
- package/src/generated/icon-layers.ts +1 -1
- package/src/generated/icon-names.js +1 -1
- package/src/generated/icon-names.ts +1 -1
- package/src/mixins/_breakpoint-fixed.scss +26 -0
- package/src/mixins/_layout.scss +205 -13
- package/src/mixins/_typography.scss +8 -8
- package/src/variables/_grid.scss +1 -1
|
@@ -3,74 +3,17 @@
|
|
|
3
3
|
*************************/
|
|
4
4
|
@use 'sass:map';
|
|
5
5
|
@use '../rds-variables' as *;
|
|
6
|
+
@use '../mixins/breakpoint-fixed' as *;
|
|
6
7
|
|
|
8
|
+
// Contextual container: follows the page layout declared on body[data-rds-layout].
|
|
9
|
+
// Also available as the `layout-max` mixin for custom selectors.
|
|
7
10
|
.rds-e-layout-max,
|
|
8
11
|
.rds-layout-max {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@include breakpoint(tablet) {
|
|
12
|
-
padding: 0 $g-padding-tablet;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@include breakpoint(desktop) {
|
|
16
|
-
padding: 0 $g-padding-desktop;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@include breakpoint(ultrawide) {
|
|
20
|
-
margin: 0 auto;
|
|
21
|
-
max-width: 1600px;
|
|
22
|
-
padding: 0 $g-padding-ultrawide;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.rds-layout-editorial {
|
|
27
|
-
padding: 0 $g-padding-mobile;
|
|
28
|
-
|
|
29
|
-
@include breakpoint(tablet-v2) {
|
|
30
|
-
padding: 0 $g-padding-tablet;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@include breakpoint(desktop-v2) {
|
|
34
|
-
padding: 0 $g-padding-desktop;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
@include breakpoint(desktop-large-v2) {
|
|
38
|
-
padding: 0 72px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@include breakpoint(ultrawide-v2) {
|
|
42
|
-
margin: 0 auto;
|
|
43
|
-
max-width: 1584px;
|
|
44
|
-
padding: 0 72px;
|
|
45
|
-
}
|
|
12
|
+
@include layout-max;
|
|
46
13
|
}
|
|
47
14
|
|
|
48
15
|
.rds-grid {
|
|
49
|
-
|
|
50
|
-
margin-left: auto;
|
|
51
|
-
margin-right: auto;
|
|
52
|
-
width: 100%;
|
|
53
|
-
|
|
54
|
-
@each $breakpoint, $config in $grid-config {
|
|
55
|
-
@include breakpoint($breakpoint) {
|
|
56
|
-
gap: map.get($config, gap);
|
|
57
|
-
grid-template-columns: repeat(map.get($config, max-columns), 1fr);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.rds-grid-editorial {
|
|
63
|
-
display: grid;
|
|
64
|
-
margin-left: auto;
|
|
65
|
-
margin-right: auto;
|
|
66
|
-
width: 100%;
|
|
67
|
-
|
|
68
|
-
@each $breakpoint, $config in $grid-config-editorial {
|
|
69
|
-
@include breakpoint($breakpoint) {
|
|
70
|
-
gap: map.get($config, gap);
|
|
71
|
-
grid-template-columns: repeat(map.get($config, max-columns), 1fr);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
16
|
+
@include grid;
|
|
74
17
|
}
|
|
75
18
|
|
|
76
19
|
// Map of breakpoint names to abbreviations
|
|
@@ -86,7 +29,7 @@ $breakpoint-abbr: (
|
|
|
86
29
|
$max-columns: map.get($config, max-columns);
|
|
87
30
|
$abbr: map.get($breakpoint-abbr, $breakpoint);
|
|
88
31
|
|
|
89
|
-
@include breakpoint($breakpoint) {
|
|
32
|
+
@include fixed-breakpoint($breakpoint) {
|
|
90
33
|
// Clases sin offset: rds-col-sd-3
|
|
91
34
|
@for $i from 1 through $max-columns {
|
|
92
35
|
.rds-col-#{$abbr}-#{$i} {
|
|
@@ -111,7 +54,7 @@ $breakpoint-abbr: (
|
|
|
111
54
|
|
|
112
55
|
@for $i from 1 through $max-columns {
|
|
113
56
|
.rds-col-#{$i} {
|
|
114
|
-
@include breakpoint($breakpoint) {
|
|
57
|
+
@include fixed-breakpoint($breakpoint) {
|
|
115
58
|
grid-column: span #{$i};
|
|
116
59
|
}
|
|
117
60
|
}
|
|
@@ -153,7 +96,7 @@ $flex-prefix: 'rds-flex';
|
|
|
153
96
|
@each $breakpoint, $config in $grid-config {
|
|
154
97
|
$abbr: map.get($breakpoint-abbr, $breakpoint);
|
|
155
98
|
|
|
156
|
-
@include breakpoint($breakpoint) {
|
|
99
|
+
@include fixed-breakpoint($breakpoint) {
|
|
157
100
|
.#{$flex-prefix}-#{$abbr}-row {
|
|
158
101
|
flex-direction: row;
|
|
159
102
|
}
|
|
@@ -186,7 +129,7 @@ $flex-prefix: 'rds-flex';
|
|
|
186
129
|
@each $breakpoint, $config in $grid-config {
|
|
187
130
|
$abbr: map.get($breakpoint-abbr, $breakpoint);
|
|
188
131
|
|
|
189
|
-
@include breakpoint($breakpoint) {
|
|
132
|
+
@include fixed-breakpoint($breakpoint) {
|
|
190
133
|
.#{$flex-prefix}-grow-#{$abbr} {
|
|
191
134
|
flex-grow: 1;
|
|
192
135
|
}
|
package/dist/index.css
CHANGED
|
@@ -5029,46 +5029,44 @@ html {
|
|
|
5029
5029
|
padding: 0 16px;
|
|
5030
5030
|
}
|
|
5031
5031
|
@media (min-width: 720px) {
|
|
5032
|
-
.rds-e-layout-max,
|
|
5033
|
-
.rds-layout-max {
|
|
5032
|
+
:where(body:not([data-rds-layout=b]), body:not([data-rds-layout=b]) *).rds-e-layout-max, :where(body:not([data-rds-layout=b]), body:not([data-rds-layout=b]) *).rds-layout-max {
|
|
5034
5033
|
padding: 0 24px;
|
|
5035
5034
|
}
|
|
5036
5035
|
}
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
.rds-layout-max {
|
|
5040
|
-
padding: 0
|
|
5036
|
+
|
|
5037
|
+
@media (min-width: 800px) {
|
|
5038
|
+
:where(body[data-rds-layout=b], body[data-rds-layout=b] *).rds-e-layout-max, :where(body[data-rds-layout=b], body[data-rds-layout=b] *).rds-layout-max {
|
|
5039
|
+
padding: 0 24px;
|
|
5041
5040
|
}
|
|
5042
5041
|
}
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
.rds-layout-max {
|
|
5046
|
-
margin: 0 auto;
|
|
5047
|
-
max-width: 1600px;
|
|
5042
|
+
|
|
5043
|
+
@media (min-width: 1280px) {
|
|
5044
|
+
:where(body:not([data-rds-layout=b]), body:not([data-rds-layout=b]) *).rds-e-layout-max, :where(body:not([data-rds-layout=b]), body:not([data-rds-layout=b]) *).rds-layout-max {
|
|
5048
5045
|
padding: 0 32px;
|
|
5049
5046
|
}
|
|
5050
5047
|
}
|
|
5051
5048
|
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
@media (min-width: 800px) {
|
|
5056
|
-
.rds-layout-editorial {
|
|
5057
|
-
padding: 0 24px;
|
|
5049
|
+
@media (min-width: 1024px) {
|
|
5050
|
+
:where(body[data-rds-layout=b], body[data-rds-layout=b] *).rds-e-layout-max, :where(body[data-rds-layout=b], body[data-rds-layout=b] *).rds-layout-max {
|
|
5051
|
+
padding: 0 32px;
|
|
5058
5052
|
}
|
|
5059
5053
|
}
|
|
5060
|
-
|
|
5061
|
-
|
|
5054
|
+
|
|
5055
|
+
@media (min-width: 1600px) {
|
|
5056
|
+
:where(body:not([data-rds-layout=b]), body:not([data-rds-layout=b]) *).rds-e-layout-max, :where(body:not([data-rds-layout=b]), body:not([data-rds-layout=b]) *).rds-layout-max {
|
|
5057
|
+
margin: 0 auto;
|
|
5058
|
+
max-width: 1600px;
|
|
5062
5059
|
padding: 0 32px;
|
|
5063
5060
|
}
|
|
5064
5061
|
}
|
|
5062
|
+
|
|
5065
5063
|
@media (min-width: 1250px) {
|
|
5066
|
-
.rds-layout-
|
|
5064
|
+
:where(body[data-rds-layout=b], body[data-rds-layout=b] *).rds-e-layout-max, :where(body[data-rds-layout=b], body[data-rds-layout=b] *).rds-layout-max {
|
|
5067
5065
|
padding: 0 72px;
|
|
5068
5066
|
}
|
|
5069
5067
|
}
|
|
5070
5068
|
@media (min-width: 1584px) {
|
|
5071
|
-
.rds-layout-
|
|
5069
|
+
:where(body[data-rds-layout=b], body[data-rds-layout=b] *).rds-e-layout-max, :where(body[data-rds-layout=b], body[data-rds-layout=b] *).rds-layout-max {
|
|
5072
5070
|
margin: 0 auto;
|
|
5073
5071
|
max-width: 1584px;
|
|
5074
5072
|
padding: 0 72px;
|
|
@@ -5082,44 +5080,37 @@ html {
|
|
|
5082
5080
|
width: 100%;
|
|
5083
5081
|
}
|
|
5084
5082
|
@media (max-width: 719px) {
|
|
5085
|
-
.rds-grid {
|
|
5083
|
+
:where(body:not([data-rds-layout=b])) .rds-grid {
|
|
5086
5084
|
gap: 16px;
|
|
5087
5085
|
grid-template-columns: repeat(4, 1fr);
|
|
5088
5086
|
}
|
|
5089
5087
|
}
|
|
5090
5088
|
@media (min-width: 720px) {
|
|
5091
|
-
.rds-grid {
|
|
5089
|
+
:where(body:not([data-rds-layout=b])) .rds-grid {
|
|
5092
5090
|
gap: 16px;
|
|
5093
5091
|
grid-template-columns: repeat(8, 1fr);
|
|
5094
5092
|
}
|
|
5095
5093
|
}
|
|
5096
5094
|
@media (min-width: 1280px) {
|
|
5097
|
-
.rds-grid {
|
|
5095
|
+
:where(body:not([data-rds-layout=b])) .rds-grid {
|
|
5098
5096
|
gap: 24px;
|
|
5099
5097
|
grid-template-columns: repeat(12, 1fr);
|
|
5100
5098
|
}
|
|
5101
5099
|
}
|
|
5102
|
-
|
|
5103
|
-
.rds-grid-editorial {
|
|
5104
|
-
display: grid;
|
|
5105
|
-
margin-left: auto;
|
|
5106
|
-
margin-right: auto;
|
|
5107
|
-
width: 100%;
|
|
5108
|
-
}
|
|
5109
5100
|
@media (max-width: 799px) {
|
|
5110
|
-
.rds-grid
|
|
5101
|
+
:where(body[data-rds-layout=b]) .rds-grid {
|
|
5111
5102
|
gap: 16px;
|
|
5112
5103
|
grid-template-columns: repeat(4, 1fr);
|
|
5113
5104
|
}
|
|
5114
5105
|
}
|
|
5115
5106
|
@media (min-width: 800px) {
|
|
5116
|
-
.rds-grid
|
|
5107
|
+
:where(body[data-rds-layout=b]) .rds-grid {
|
|
5117
5108
|
gap: 24px;
|
|
5118
5109
|
grid-template-columns: repeat(8, 1fr);
|
|
5119
5110
|
}
|
|
5120
5111
|
}
|
|
5121
5112
|
@media (min-width: 1024px) {
|
|
5122
|
-
.rds-grid
|
|
5113
|
+
:where(body[data-rds-layout=b]) .rds-grid {
|
|
5123
5114
|
gap: 24px;
|
|
5124
5115
|
grid-template-columns: repeat(12, 1fr);
|
|
5125
5116
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../variables/layout' as *;
|
|
3
|
+
|
|
4
|
+
// Internal fixed media query, independent of body[data-rds-layout].
|
|
5
|
+
// Not forwarded by rds-variables: consumers must use `breakpoint`.
|
|
6
|
+
@mixin fixed-breakpoint($breakpoint) {
|
|
7
|
+
$value: map.get($breakpoints, $breakpoint);
|
|
8
|
+
|
|
9
|
+
// If the key exists in the map
|
|
10
|
+
@if $value {
|
|
11
|
+
@if $breakpoint == mobile or $breakpoint == mobile-v2 {
|
|
12
|
+
@media (max-width: $value) {
|
|
13
|
+
@content;
|
|
14
|
+
}
|
|
15
|
+
} @else {
|
|
16
|
+
@media (min-width: $value) {
|
|
17
|
+
@content;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// If the key doesn't exist in the map
|
|
23
|
+
@else {
|
|
24
|
+
@warn "Unfortunately, no value could be retrieved from `#{$breakpoint}`. " + "Please make sure it is defined in `$breakpoints` map.";
|
|
25
|
+
}
|
|
26
|
+
}
|
package/dist/mixins/_layout.scss
CHANGED
|
@@ -1,31 +1,223 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
1
2
|
@use 'sass:map';
|
|
3
|
+
@use 'sass:selector';
|
|
4
|
+
@use 'sass:string';
|
|
5
|
+
@use '../variables/grid' as *;
|
|
2
6
|
@use '../variables/layout' as *;
|
|
7
|
+
@use 'breakpoint-fixed' as *;
|
|
3
8
|
|
|
4
|
-
|
|
9
|
+
$_layout-b-keys: (
|
|
10
|
+
mobile: mobile-v2,
|
|
11
|
+
tablet: tablet-v2,
|
|
12
|
+
desktop: desktop-v2,
|
|
13
|
+
desktop-large: desktop-large-v2,
|
|
14
|
+
ultrawide: ultrawide-v2
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
$_layout-conditions: (
|
|
18
|
+
a: ":not([data-rds-layout='b'])",
|
|
19
|
+
b: "[data-rds-layout='b']"
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
// Layout resolved by an enclosing breakpoint; nested calls reuse it instead of adding a second body context.
|
|
23
|
+
$_active-layout: null;
|
|
24
|
+
|
|
25
|
+
// Responsive media queries that follow the layout declared on body[data-rds-layout].
|
|
26
|
+
// Semantic keys use Layout A by default and their *-v2 values with body[data-rds-layout='b'].
|
|
27
|
+
// Explicit *-v2 and custom keys are fixed media queries.
|
|
5
28
|
// use:
|
|
6
29
|
// .element {
|
|
7
|
-
// @include breakpoint(mobile|tablet|desktop|desktop-large|ultrawide){
|
|
30
|
+
// @include breakpoint(mobile|tablet|desktop|desktop-large|ultrawide) {
|
|
31
|
+
// ...
|
|
32
|
+
// }
|
|
33
|
+
// }
|
|
34
|
+
// or at the root:
|
|
35
|
+
// @include breakpoint(tablet) {
|
|
36
|
+
// .element {
|
|
8
37
|
// ...
|
|
9
38
|
// }
|
|
10
|
-
//
|
|
39
|
+
// }
|
|
11
40
|
@mixin breakpoint($breakpoint) {
|
|
12
|
-
|
|
41
|
+
@if map.has-key($_layout-b-keys, $breakpoint) {
|
|
42
|
+
$layout-b-key: map.get($_layout-b-keys, $breakpoint);
|
|
13
43
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
44
|
+
@if not map.get($breakpoints, $breakpoint) or not map.get($breakpoints, $layout-b-key) {
|
|
45
|
+
@error 'Missing layout A/B values for breakpoint: #{$breakpoint}.';
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@if $_active-layout == a {
|
|
49
|
+
@include fixed-breakpoint($breakpoint) {
|
|
18
50
|
@content;
|
|
19
51
|
}
|
|
20
|
-
} @else {
|
|
21
|
-
@
|
|
52
|
+
} @else if $_active-layout == b {
|
|
53
|
+
@include fixed-breakpoint($layout-b-key) {
|
|
22
54
|
@content;
|
|
23
55
|
}
|
|
56
|
+
} @else {
|
|
57
|
+
@include _layout-context(a) {
|
|
58
|
+
@include fixed-breakpoint($breakpoint) {
|
|
59
|
+
@content;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@include _layout-context(b) {
|
|
64
|
+
@include fixed-breakpoint($layout-b-key) {
|
|
65
|
+
@content;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
} @else {
|
|
70
|
+
@include fixed-breakpoint($breakpoint) {
|
|
71
|
+
@content;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@mixin _layout-context($layout) {
|
|
77
|
+
$previous-layout: $_active-layout;
|
|
78
|
+
$condition: map.get($_layout-conditions, $layout);
|
|
79
|
+
|
|
80
|
+
@if $previous-layout == $layout {
|
|
81
|
+
// Already resolved by an enclosing breakpoint: do not add a second body condition.
|
|
82
|
+
@content;
|
|
83
|
+
} @else if $previous-layout {
|
|
84
|
+
// Nested inside the other layout: these rules can never match.
|
|
85
|
+
} @else if & {
|
|
86
|
+
$_active-layout: $layout !global;
|
|
87
|
+
|
|
88
|
+
@at-root #{_contextualize(&, $condition)} {
|
|
89
|
+
@content;
|
|
90
|
+
}
|
|
91
|
+
} @else {
|
|
92
|
+
$_active-layout: $layout !global;
|
|
93
|
+
|
|
94
|
+
// At the root the context prefixes the selectors written inside the content.
|
|
95
|
+
:where(body#{$condition}) {
|
|
96
|
+
@content;
|
|
24
97
|
}
|
|
25
98
|
}
|
|
26
99
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
100
|
+
$_active-layout: $previous-layout !global;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Page container that follows the layout declared on body[data-rds-layout].
|
|
104
|
+
// Layout A: 16/24/32px gutters and 1600px max width. Layout B: up to 72px gutters and 1584px max width.
|
|
105
|
+
// use:
|
|
106
|
+
// .portal-main {
|
|
107
|
+
// @include layout-max;
|
|
108
|
+
// }
|
|
109
|
+
@mixin layout-max {
|
|
110
|
+
@if not & {
|
|
111
|
+
@error 'layout-max must be included inside a selector, e.g. `.portal-main { @include layout-max; }`.';
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
padding: 0 $g-padding-mobile;
|
|
115
|
+
|
|
116
|
+
@include breakpoint(tablet) {
|
|
117
|
+
padding: 0 $g-padding-tablet;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@include breakpoint(desktop) {
|
|
121
|
+
padding: 0 $g-padding-desktop;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@include _layout-context(a) {
|
|
125
|
+
@include fixed-breakpoint(ultrawide) {
|
|
126
|
+
margin: 0 auto;
|
|
127
|
+
max-width: 1600px;
|
|
128
|
+
padding: 0 $g-padding-ultrawide;
|
|
129
|
+
}
|
|
30
130
|
}
|
|
131
|
+
|
|
132
|
+
@include _layout-context(b) {
|
|
133
|
+
@include fixed-breakpoint(desktop-large-v2) {
|
|
134
|
+
padding: 0 72px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@include fixed-breakpoint(ultrawide-v2) {
|
|
138
|
+
margin: 0 auto;
|
|
139
|
+
max-width: 1584px;
|
|
140
|
+
padding: 0 72px;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@mixin grid {
|
|
146
|
+
@if not & {
|
|
147
|
+
@error 'grid must be included inside a selector, e.g. `.portal-grid { @include grid; }`.';
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
display: grid;
|
|
151
|
+
margin-left: auto;
|
|
152
|
+
margin-right: auto;
|
|
153
|
+
width: 100%;
|
|
154
|
+
|
|
155
|
+
@each $breakpoint, $config in $grid-config {
|
|
156
|
+
:where(body:not([data-rds-layout='b'])) & {
|
|
157
|
+
@include fixed-breakpoint($breakpoint) {
|
|
158
|
+
gap: map.get($config, gap);
|
|
159
|
+
grid-template-columns: repeat(map.get($config, max-columns), 1fr);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
@each $breakpoint, $config in $grid-config-b {
|
|
165
|
+
:where(body[data-rds-layout='b']) & {
|
|
166
|
+
@include fixed-breakpoint($breakpoint) {
|
|
167
|
+
gap: map.get($config, gap);
|
|
168
|
+
grid-template-columns: repeat(map.get($config, max-columns), 1fr);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// The condition is checked on the selected element itself, so other conditions such as `.dark` or `[dir='rtl']`
|
|
175
|
+
// keep working when they live on body or html. It is inserted at the start of the last compound (after a type
|
|
176
|
+
// selector), so `&--modifier`, `&__element` and pseudo-elements can still be appended by the content.
|
|
177
|
+
@function _contextualize($selector, $condition) {
|
|
178
|
+
$result: ();
|
|
179
|
+
|
|
180
|
+
@each $complex in selector.parse($selector) {
|
|
181
|
+
$subject: list.nth($complex, -1);
|
|
182
|
+
$check: ':where(body#{$condition}, body#{$condition} *)';
|
|
183
|
+
|
|
184
|
+
@if _starts-with-type($subject, 'html') or _starts-with-type($subject, ':root') {
|
|
185
|
+
// html and :root are never inside body: they check their child body, which requires :has().
|
|
186
|
+
$check: ':where(:has(> body#{$condition}))';
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
$result: list.append($result, list.set-nth($complex, -1, _insert-after-type($subject, $check)), $separator: comma);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
@return $result;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// A type or universal selector must stay first in a compound selector.
|
|
196
|
+
@function _insert-after-type($compound, $check) {
|
|
197
|
+
$compound: '#{$compound}';
|
|
198
|
+
$position: 1;
|
|
199
|
+
|
|
200
|
+
@if not string.index('.#[:', string.slice($compound, 1, 1)) {
|
|
201
|
+
@while $position <= string.length($compound) and not string.index('.#[:', string.slice($compound, $position, $position)) {
|
|
202
|
+
$position: $position + 1;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
@return string.unquote(string.insert($compound, $check, $position));
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@function _starts-with-type($compound, $type) {
|
|
210
|
+
$compound: string.to-lower-case('#{$compound}');
|
|
211
|
+
|
|
212
|
+
@if string.index($compound, $type) != 1 {
|
|
213
|
+
@return false;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
@if string.length($compound) == string.length($type) {
|
|
217
|
+
@return true;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
$next: string.slice($compound, string.length($type) + 1, string.length($type) + 1);
|
|
221
|
+
|
|
222
|
+
@return not string.index('abcdefghijklmnopqrstuvwxyz0123456789-_', $next);
|
|
31
223
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
@use '../variables/typography' as *;
|
|
5
5
|
@use '../mixins/utils' as *;
|
|
6
|
-
@use '../mixins/
|
|
6
|
+
@use '../mixins/breakpoint-fixed' as *;
|
|
7
7
|
|
|
8
8
|
@mixin numeric-typography($name) {
|
|
9
9
|
@if string.index($name, 'numbers') {
|
|
@@ -72,32 +72,32 @@
|
|
|
72
72
|
@if map.has-key($rds-types-fluid, $name) {
|
|
73
73
|
@include rds-font-style-sd($name);
|
|
74
74
|
|
|
75
|
-
@include breakpoint(tablet) {
|
|
75
|
+
@include fixed-breakpoint(tablet) {
|
|
76
76
|
@include rds-font-style-md($name);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
@include breakpoint(desktop) {
|
|
79
|
+
@include fixed-breakpoint(desktop) {
|
|
80
80
|
@include rds-font-style-ld($name);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
@include breakpoint(ultrawide) {
|
|
83
|
+
@include fixed-breakpoint(ultrawide) {
|
|
84
84
|
@include rds-font-style-xd($name);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
:where(body[data-rds-layout='b']) & {
|
|
88
|
-
@include breakpoint(tablet) {
|
|
88
|
+
@include fixed-breakpoint(tablet) {
|
|
89
89
|
@include rds-font-style-sd($name);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
@include breakpoint(tablet-v2) {
|
|
92
|
+
@include fixed-breakpoint(tablet-v2) {
|
|
93
93
|
@include rds-font-style-md($name);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
@include breakpoint(desktop-v2) {
|
|
96
|
+
@include fixed-breakpoint(desktop-v2) {
|
|
97
97
|
@include rds-font-style-ld($name);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
@include breakpoint(ultrawide-v2) {
|
|
100
|
+
@include fixed-breakpoint(ultrawide-v2) {
|
|
101
101
|
@include rds-font-style-xd($name);
|
|
102
102
|
}
|
|
103
103
|
}
|
package/dist/style.css
CHANGED
|
@@ -5029,46 +5029,44 @@ html {
|
|
|
5029
5029
|
padding: 0 16px;
|
|
5030
5030
|
}
|
|
5031
5031
|
@media (min-width: 720px) {
|
|
5032
|
-
.rds-e-layout-max,
|
|
5033
|
-
.rds-layout-max {
|
|
5032
|
+
:where(body:not([data-rds-layout=b]), body:not([data-rds-layout=b]) *).rds-e-layout-max, :where(body:not([data-rds-layout=b]), body:not([data-rds-layout=b]) *).rds-layout-max {
|
|
5034
5033
|
padding: 0 24px;
|
|
5035
5034
|
}
|
|
5036
5035
|
}
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
.rds-layout-max {
|
|
5040
|
-
padding: 0
|
|
5036
|
+
|
|
5037
|
+
@media (min-width: 800px) {
|
|
5038
|
+
:where(body[data-rds-layout=b], body[data-rds-layout=b] *).rds-e-layout-max, :where(body[data-rds-layout=b], body[data-rds-layout=b] *).rds-layout-max {
|
|
5039
|
+
padding: 0 24px;
|
|
5041
5040
|
}
|
|
5042
5041
|
}
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
.rds-layout-max {
|
|
5046
|
-
margin: 0 auto;
|
|
5047
|
-
max-width: 1600px;
|
|
5042
|
+
|
|
5043
|
+
@media (min-width: 1280px) {
|
|
5044
|
+
:where(body:not([data-rds-layout=b]), body:not([data-rds-layout=b]) *).rds-e-layout-max, :where(body:not([data-rds-layout=b]), body:not([data-rds-layout=b]) *).rds-layout-max {
|
|
5048
5045
|
padding: 0 32px;
|
|
5049
5046
|
}
|
|
5050
5047
|
}
|
|
5051
5048
|
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
@media (min-width: 800px) {
|
|
5056
|
-
.rds-layout-editorial {
|
|
5057
|
-
padding: 0 24px;
|
|
5049
|
+
@media (min-width: 1024px) {
|
|
5050
|
+
:where(body[data-rds-layout=b], body[data-rds-layout=b] *).rds-e-layout-max, :where(body[data-rds-layout=b], body[data-rds-layout=b] *).rds-layout-max {
|
|
5051
|
+
padding: 0 32px;
|
|
5058
5052
|
}
|
|
5059
5053
|
}
|
|
5060
|
-
|
|
5061
|
-
|
|
5054
|
+
|
|
5055
|
+
@media (min-width: 1600px) {
|
|
5056
|
+
:where(body:not([data-rds-layout=b]), body:not([data-rds-layout=b]) *).rds-e-layout-max, :where(body:not([data-rds-layout=b]), body:not([data-rds-layout=b]) *).rds-layout-max {
|
|
5057
|
+
margin: 0 auto;
|
|
5058
|
+
max-width: 1600px;
|
|
5062
5059
|
padding: 0 32px;
|
|
5063
5060
|
}
|
|
5064
5061
|
}
|
|
5062
|
+
|
|
5065
5063
|
@media (min-width: 1250px) {
|
|
5066
|
-
.rds-layout-
|
|
5064
|
+
:where(body[data-rds-layout=b], body[data-rds-layout=b] *).rds-e-layout-max, :where(body[data-rds-layout=b], body[data-rds-layout=b] *).rds-layout-max {
|
|
5067
5065
|
padding: 0 72px;
|
|
5068
5066
|
}
|
|
5069
5067
|
}
|
|
5070
5068
|
@media (min-width: 1584px) {
|
|
5071
|
-
.rds-layout-
|
|
5069
|
+
:where(body[data-rds-layout=b], body[data-rds-layout=b] *).rds-e-layout-max, :where(body[data-rds-layout=b], body[data-rds-layout=b] *).rds-layout-max {
|
|
5072
5070
|
margin: 0 auto;
|
|
5073
5071
|
max-width: 1584px;
|
|
5074
5072
|
padding: 0 72px;
|
|
@@ -5082,44 +5080,37 @@ html {
|
|
|
5082
5080
|
width: 100%;
|
|
5083
5081
|
}
|
|
5084
5082
|
@media (max-width: 719px) {
|
|
5085
|
-
.rds-grid {
|
|
5083
|
+
:where(body:not([data-rds-layout=b])) .rds-grid {
|
|
5086
5084
|
gap: 16px;
|
|
5087
5085
|
grid-template-columns: repeat(4, 1fr);
|
|
5088
5086
|
}
|
|
5089
5087
|
}
|
|
5090
5088
|
@media (min-width: 720px) {
|
|
5091
|
-
.rds-grid {
|
|
5089
|
+
:where(body:not([data-rds-layout=b])) .rds-grid {
|
|
5092
5090
|
gap: 16px;
|
|
5093
5091
|
grid-template-columns: repeat(8, 1fr);
|
|
5094
5092
|
}
|
|
5095
5093
|
}
|
|
5096
5094
|
@media (min-width: 1280px) {
|
|
5097
|
-
.rds-grid {
|
|
5095
|
+
:where(body:not([data-rds-layout=b])) .rds-grid {
|
|
5098
5096
|
gap: 24px;
|
|
5099
5097
|
grid-template-columns: repeat(12, 1fr);
|
|
5100
5098
|
}
|
|
5101
5099
|
}
|
|
5102
|
-
|
|
5103
|
-
.rds-grid-editorial {
|
|
5104
|
-
display: grid;
|
|
5105
|
-
margin-left: auto;
|
|
5106
|
-
margin-right: auto;
|
|
5107
|
-
width: 100%;
|
|
5108
|
-
}
|
|
5109
5100
|
@media (max-width: 799px) {
|
|
5110
|
-
.rds-grid
|
|
5101
|
+
:where(body[data-rds-layout=b]) .rds-grid {
|
|
5111
5102
|
gap: 16px;
|
|
5112
5103
|
grid-template-columns: repeat(4, 1fr);
|
|
5113
5104
|
}
|
|
5114
5105
|
}
|
|
5115
5106
|
@media (min-width: 800px) {
|
|
5116
|
-
.rds-grid
|
|
5107
|
+
:where(body[data-rds-layout=b]) .rds-grid {
|
|
5117
5108
|
gap: 24px;
|
|
5118
5109
|
grid-template-columns: repeat(8, 1fr);
|
|
5119
5110
|
}
|
|
5120
5111
|
}
|
|
5121
5112
|
@media (min-width: 1024px) {
|
|
5122
|
-
.rds-grid
|
|
5113
|
+
:where(body[data-rds-layout=b]) .rds-grid {
|
|
5123
5114
|
gap: 24px;
|
|
5124
5115
|
grid-template-columns: repeat(12, 1fr);
|
|
5125
5116
|
}
|