energy-foundations 2.5.0-beta.2 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/foundations/_grid.scss +3 -3
- 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/mixins/_layout.scss +19 -9
- package/llms/03-sass-variables-and-mixins.md +2 -2
- package/llms/04-layouts.md +14 -7
- package/package.json +3 -3
- package/src/foundations/_grid.scss +3 -3
- 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/_layout.scss +19 -9
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
@use '../mixins/breakpoint-fixed' as *;
|
|
7
7
|
|
|
8
8
|
// Contextual container: follows the page layout declared on body[data-rds-layout].
|
|
9
|
-
//
|
|
9
|
+
// Preserve historical physical padding; the default mixin only manages inline gutters.
|
|
10
10
|
.rds-e-layout-max,
|
|
11
11
|
.rds-layout-max {
|
|
12
|
-
@include layout-max;
|
|
12
|
+
@include layout-max($legacy-padding: true);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.rds-grid {
|
|
16
|
-
@include grid;
|
|
16
|
+
@include rds-grid;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
// Map of breakpoint names to abbreviations
|
package/dist/mixins/_layout.scss
CHANGED
|
@@ -100,51 +100,61 @@ $_active-layout: null;
|
|
|
100
100
|
$_active-layout: $previous-layout !global;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
// Keep the public CSS classes' physical padding and responsive resets unchanged.
|
|
104
|
+
@mixin _layout-max-padding($value, $legacy-padding) {
|
|
105
|
+
@if $legacy-padding {
|
|
106
|
+
padding: 0 $value;
|
|
107
|
+
} @else {
|
|
108
|
+
padding-inline: $value;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
103
112
|
// Page container that follows the layout declared on body[data-rds-layout].
|
|
104
113
|
// Layout A: 16/24/32px gutters and 1600px max width. Layout B: up to 72px gutters and 1584px max width.
|
|
114
|
+
// Inline gutters preserve consumer block padding. Legacy padding is reserved for class compatibility.
|
|
105
115
|
// use:
|
|
106
116
|
// .portal-main {
|
|
107
117
|
// @include layout-max;
|
|
108
118
|
// }
|
|
109
|
-
@mixin layout-max {
|
|
119
|
+
@mixin layout-max($legacy-padding: false) {
|
|
110
120
|
@if not & {
|
|
111
121
|
@error 'layout-max must be included inside a selector, e.g. `.portal-main { @include layout-max; }`.';
|
|
112
122
|
}
|
|
113
123
|
|
|
114
|
-
padding
|
|
124
|
+
@include _layout-max-padding($g-padding-mobile, $legacy-padding);
|
|
115
125
|
|
|
116
126
|
@include breakpoint(tablet) {
|
|
117
|
-
padding
|
|
127
|
+
@include _layout-max-padding($g-padding-tablet, $legacy-padding);
|
|
118
128
|
}
|
|
119
129
|
|
|
120
130
|
@include breakpoint(desktop) {
|
|
121
|
-
padding
|
|
131
|
+
@include _layout-max-padding($g-padding-desktop, $legacy-padding);
|
|
122
132
|
}
|
|
123
133
|
|
|
124
134
|
@include _layout-context(a) {
|
|
125
135
|
@include fixed-breakpoint(ultrawide) {
|
|
126
136
|
margin: 0 auto;
|
|
127
137
|
max-width: 1600px;
|
|
128
|
-
padding
|
|
138
|
+
@include _layout-max-padding($g-padding-ultrawide, $legacy-padding);
|
|
129
139
|
}
|
|
130
140
|
}
|
|
131
141
|
|
|
132
142
|
@include _layout-context(b) {
|
|
133
143
|
@include fixed-breakpoint(desktop-large-v2) {
|
|
134
|
-
padding
|
|
144
|
+
@include _layout-max-padding(72px, $legacy-padding);
|
|
135
145
|
}
|
|
136
146
|
|
|
137
147
|
@include fixed-breakpoint(ultrawide-v2) {
|
|
138
148
|
margin: 0 auto;
|
|
139
149
|
max-width: 1584px;
|
|
140
|
-
padding
|
|
150
|
+
@include _layout-max-padding(72px, $legacy-padding);
|
|
141
151
|
}
|
|
142
152
|
}
|
|
143
153
|
}
|
|
144
154
|
|
|
145
|
-
@mixin grid {
|
|
155
|
+
@mixin rds-grid {
|
|
146
156
|
@if not & {
|
|
147
|
-
@error 'grid must be included inside a selector, e.g. `.portal-grid { @include grid; }`.';
|
|
157
|
+
@error 'rds-grid must be included inside a selector, e.g. `.portal-grid { @include rds-grid; }`.';
|
|
148
158
|
}
|
|
149
159
|
|
|
150
160
|
display: grid;
|
package/llms/04-layouts.md
CHANGED
|
@@ -140,7 +140,7 @@ CONTEXTUAL A/B
|
|
|
140
140
|
Layout A: padding 16px mobile, 24px tablet y 32px desktop, máximo 1600px. Layout B: padding progresivo hasta 72px, máximo 1584px.
|
|
141
141
|
MIXIN SASS
|
|
142
142
|
`@include layout-max`
|
|
143
|
-
|
|
143
|
+
Espaciado interior responsive en el eje en línea y ancho máximo para tu propio selector, sin reiniciar el padding del eje de bloque.
|
|
144
144
|
|
|
145
145
|
`.rds-layout-max` sigue el layout declarado en `body[data-rds-layout]`: aplica los márgenes de A sin atributo (o con `"a"`) y los de B con `data-rds-layout="b"`. Así, componentes y plantillas transversales no necesitan conocer el layout de la página.
|
|
146
146
|
|
|
@@ -155,22 +155,29 @@ El mismo contenedor aplicado a tu propio selector, para cuando no puedes o no qu
|
|
|
155
155
|
|
|
156
156
|
#### Como mixin Sass
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
Usa `layout-max` para selectores propios, por ejemplo en componentes de AEM o plantillas de terceros. Aplica el mismo espaciado interior responsive y los mismos anchos máximos que las clases de contenedor, pero conserva el padding del eje de bloque definido por el consumidor:
|
|
159
159
|
|
|
160
160
|
```scss
|
|
161
161
|
@use 'energy-foundations/src/rds-variables' as rds;
|
|
162
162
|
|
|
163
163
|
.portal-main {
|
|
164
|
+
padding-block: 40px;
|
|
164
165
|
@include rds.layout-max;
|
|
165
166
|
}
|
|
166
167
|
```
|
|
167
168
|
|
|
168
|
-
|
|
169
|
+
El mixin genera `padding-inline` en todos los breakpoints. En escritura horizontal, el ejemplo conserva 40px de padding superior e inferior, mientras que el espaciado izquierdo y derecho sigue el Layout A o B. Puedes declarar el padding del eje de bloque antes o después del include; ya no necesitas sobrescribir un reset responsive.
|
|
170
|
+
|
|
171
|
+
- `.rds-layout-max` y `.rds-e-layout-max` conservan su `padding: 0 X` histórico en todos los breakpoints, incluido el reset superior e inferior. Los proyectos que ya usan estas clases no necesitan migrar.
|
|
172
|
+
- El argumento opcional `$legacy-padding: true` reproduce ese padding físico por compatibilidad; las clases públicas lo utilizan internamente. Para selectores propios, normalmente debes usar el comportamiento por defecto, sin argumentos.
|
|
173
|
+
- `padding-inline` sigue el modo de escritura: afecta a izquierda/derecha en `horizontal-tb` y a arriba/abajo en `vertical-rl` o `vertical-lr`. El mixin conserva el padding del eje de bloque, no necesariamente el padding físico superior e inferior. Las media queries y `max-width` siguen usando ejes físicos.
|
|
174
|
+
- El comportamiento por defecto requiere un navegador compatible con `padding-inline`; no se generan declaraciones físicas alternativas. Las clases existentes conservan sus declaraciones físicas.
|
|
175
|
+
- El comportamiento de los márgenes no cambia: las reglas ultrawide siguen usando `margin: 0 auto`.
|
|
169
176
|
|
|
170
177
|
- Debe usarse dentro de un selector; en el nivel raíz la compilación falla con un mensaje claro.
|
|
171
178
|
- Funciona con cualquier selector, también sobre el propio `body` o con condiciones del `body` o del `html`, como `.dark .portal-main`.
|
|
172
179
|
- La especificidad es la de tu selector: el mixin no la aumenta.
|
|
173
|
-
-
|
|
180
|
+
- Las propiedades abreviadas del consumidor, como `padding`, pueden seguir sobrescribiendo el espaciado del eje en línea según la especificidad y el orden de las reglas. Usa preferentemente `padding-block` para controlar el espaciado del eje de bloque de forma independiente.
|
|
174
181
|
|
|
175
182
|
### Composición contextual
|
|
176
183
|
|
|
@@ -218,17 +225,17 @@ No existe una escala tipográfica específica para tablet. El breakpoint `deskto
|
|
|
218
225
|
|
|
219
226
|
### Mixin Sass de grid
|
|
220
227
|
|
|
221
|
-
El mixin público `grid` aplica el mismo comportamiento que `.rds-grid` a un selector propio, sin añadir esa clase al HTML:
|
|
228
|
+
El mixin público `rds-grid` aplica el mismo comportamiento que `.rds-grid` a un selector propio, sin añadir esa clase al HTML:
|
|
222
229
|
|
|
223
230
|
```scss
|
|
224
231
|
@use 'energy-foundations/src/rds-variables' as rds;
|
|
225
232
|
|
|
226
233
|
.mi-grid {
|
|
227
|
-
@include rds.grid;
|
|
234
|
+
@include rds.rds-grid;
|
|
228
235
|
}
|
|
229
236
|
```
|
|
230
237
|
|
|
231
|
-
También está disponible desde `energy-foundations/src/mixins/layout`. Con `@use 'energy-foundations/src/rds-variables' as *`, se incluye mediante `@include grid
|
|
238
|
+
También está disponible desde `energy-foundations/src/mixins/layout`. Con `@use 'energy-foundations/src/rds-variables' as *`, se incluye mediante `@include rds-grid;`.
|
|
232
239
|
|
|
233
240
|
La clase `.rds-grid` consume ese mismo mixin. Ambos conservan display, ancho completo, centrado, columnas y gaps según los mapas `$grid-config` y `$grid-config-b` y el layout global del `body`. Inclúyelo dentro de un selector de un elemento descendiente del `body`; invocarlo en la raíz de la hoja Sass produce un error explícito.
|
|
234
241
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "energy-foundations",
|
|
3
|
-
"version": "2.5.0
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"config": {
|
|
5
5
|
"commitizen": {
|
|
6
6
|
"path": "node_modules/cz-customizable"
|
|
7
7
|
},
|
|
8
8
|
"cz-customizable": {
|
|
9
|
-
"config": ".cz-config.
|
|
9
|
+
"config": ".cz-config.cjs"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"postcss-banner": "^4.0.1",
|
|
40
40
|
"react": "^18.3.1",
|
|
41
41
|
"react-dom": "^18.3.1",
|
|
42
|
-
"release-it": "^
|
|
42
|
+
"release-it": "^21.1.1",
|
|
43
43
|
"sass": "^1.94.2",
|
|
44
44
|
"storybook": "^8.2.1",
|
|
45
45
|
"storybook-addon-sass-postcss": "^0.3.0",
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
@use '../mixins/breakpoint-fixed' as *;
|
|
7
7
|
|
|
8
8
|
// Contextual container: follows the page layout declared on body[data-rds-layout].
|
|
9
|
-
//
|
|
9
|
+
// Preserve historical physical padding; the default mixin only manages inline gutters.
|
|
10
10
|
.rds-e-layout-max,
|
|
11
11
|
.rds-layout-max {
|
|
12
|
-
@include layout-max;
|
|
12
|
+
@include layout-max($legacy-padding: true);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.rds-grid {
|
|
16
|
-
@include grid;
|
|
16
|
+
@include rds-grid;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
// Map of breakpoint names to abbreviations
|
package/src/mixins/_layout.scss
CHANGED
|
@@ -100,51 +100,61 @@ $_active-layout: null;
|
|
|
100
100
|
$_active-layout: $previous-layout !global;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
// Keep the public CSS classes' physical padding and responsive resets unchanged.
|
|
104
|
+
@mixin _layout-max-padding($value, $legacy-padding) {
|
|
105
|
+
@if $legacy-padding {
|
|
106
|
+
padding: 0 $value;
|
|
107
|
+
} @else {
|
|
108
|
+
padding-inline: $value;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
103
112
|
// Page container that follows the layout declared on body[data-rds-layout].
|
|
104
113
|
// Layout A: 16/24/32px gutters and 1600px max width. Layout B: up to 72px gutters and 1584px max width.
|
|
114
|
+
// Inline gutters preserve consumer block padding. Legacy padding is reserved for class compatibility.
|
|
105
115
|
// use:
|
|
106
116
|
// .portal-main {
|
|
107
117
|
// @include layout-max;
|
|
108
118
|
// }
|
|
109
|
-
@mixin layout-max {
|
|
119
|
+
@mixin layout-max($legacy-padding: false) {
|
|
110
120
|
@if not & {
|
|
111
121
|
@error 'layout-max must be included inside a selector, e.g. `.portal-main { @include layout-max; }`.';
|
|
112
122
|
}
|
|
113
123
|
|
|
114
|
-
padding
|
|
124
|
+
@include _layout-max-padding($g-padding-mobile, $legacy-padding);
|
|
115
125
|
|
|
116
126
|
@include breakpoint(tablet) {
|
|
117
|
-
padding
|
|
127
|
+
@include _layout-max-padding($g-padding-tablet, $legacy-padding);
|
|
118
128
|
}
|
|
119
129
|
|
|
120
130
|
@include breakpoint(desktop) {
|
|
121
|
-
padding
|
|
131
|
+
@include _layout-max-padding($g-padding-desktop, $legacy-padding);
|
|
122
132
|
}
|
|
123
133
|
|
|
124
134
|
@include _layout-context(a) {
|
|
125
135
|
@include fixed-breakpoint(ultrawide) {
|
|
126
136
|
margin: 0 auto;
|
|
127
137
|
max-width: 1600px;
|
|
128
|
-
padding
|
|
138
|
+
@include _layout-max-padding($g-padding-ultrawide, $legacy-padding);
|
|
129
139
|
}
|
|
130
140
|
}
|
|
131
141
|
|
|
132
142
|
@include _layout-context(b) {
|
|
133
143
|
@include fixed-breakpoint(desktop-large-v2) {
|
|
134
|
-
padding
|
|
144
|
+
@include _layout-max-padding(72px, $legacy-padding);
|
|
135
145
|
}
|
|
136
146
|
|
|
137
147
|
@include fixed-breakpoint(ultrawide-v2) {
|
|
138
148
|
margin: 0 auto;
|
|
139
149
|
max-width: 1584px;
|
|
140
|
-
padding
|
|
150
|
+
@include _layout-max-padding(72px, $legacy-padding);
|
|
141
151
|
}
|
|
142
152
|
}
|
|
143
153
|
}
|
|
144
154
|
|
|
145
|
-
@mixin grid {
|
|
155
|
+
@mixin rds-grid {
|
|
146
156
|
@if not & {
|
|
147
|
-
@error 'grid must be included inside a selector, e.g. `.portal-grid { @include grid; }`.';
|
|
157
|
+
@error 'rds-grid must be included inside a selector, e.g. `.portal-grid { @include rds-grid; }`.';
|
|
148
158
|
}
|
|
149
159
|
|
|
150
160
|
display: grid;
|