Skip to content

Commit 826e7e2

Browse files
authored
feat(tokens): added gap utility-classes (#30063)
Issue number: internal --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Added generation of gao utility-classes on the context of the padding and margin ones. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. -->
1 parent 861b4bf commit 826e7e2

File tree

2 files changed

+68
-1
lines changed

2 files changed

+68
-1
lines changed

core/scripts/tokens/utils.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,14 @@ function generateSpaceUtilityClasses(prop, className) {
231231
};
232232
`;
233233

234-
return `${marginPaddingTemplate('margin')}\n${marginPaddingTemplate('padding')}`;
234+
// Add gap utility classes for gap tokens
235+
const generateGapUtilityClasses = () =>`
236+
.${variablesPrefix}-gap-${prop.name} {
237+
gap: #{$${variablesPrefix}-${prop.name}};
238+
};
239+
`;
240+
241+
return `${generateGapUtilityClasses()}\n${marginPaddingTemplate('margin')}\n${marginPaddingTemplate('padding')}`;
235242
}
236243

237244
// Generates a valid box-shadow value from a shadow Design Token structure

core/src/foundations/ionic.utility.scss

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,6 +2432,10 @@ Do not edit directly, this file was auto-generated.
24322432
box-shadow: $ion-elevation-4;
24332433
}
24342434

2435+
.ion-gap-space-0 {
2436+
gap: #{$ion-space-0};
2437+
}
2438+
24352439
.ion-margin-space-0 {
24362440
--margin-top: #{$ion-space-0};
24372441
--margin-end: #{$ion-space-0};
@@ -2498,6 +2502,10 @@ Do not edit directly, this file was auto-generated.
24982502
@include padding(null, null, null, $ion-space-0);
24992503
}
25002504

2505+
.ion-gap-space-100 {
2506+
gap: #{$ion-space-100};
2507+
}
2508+
25012509
.ion-margin-space-100 {
25022510
--margin-top: #{$ion-space-100};
25032511
--margin-end: #{$ion-space-100};
@@ -2564,6 +2572,10 @@ Do not edit directly, this file was auto-generated.
25642572
@include padding(null, null, null, $ion-space-100);
25652573
}
25662574

2575+
.ion-gap-space-150 {
2576+
gap: #{$ion-space-150};
2577+
}
2578+
25672579
.ion-margin-space-150 {
25682580
--margin-top: #{$ion-space-150};
25692581
--margin-end: #{$ion-space-150};
@@ -2630,6 +2642,10 @@ Do not edit directly, this file was auto-generated.
26302642
@include padding(null, null, null, $ion-space-150);
26312643
}
26322644

2645+
.ion-gap-space-200 {
2646+
gap: #{$ion-space-200};
2647+
}
2648+
26332649
.ion-margin-space-200 {
26342650
--margin-top: #{$ion-space-200};
26352651
--margin-end: #{$ion-space-200};
@@ -2696,6 +2712,10 @@ Do not edit directly, this file was auto-generated.
26962712
@include padding(null, null, null, $ion-space-200);
26972713
}
26982714

2715+
.ion-gap-space-250 {
2716+
gap: #{$ion-space-250};
2717+
}
2718+
26992719
.ion-margin-space-250 {
27002720
--margin-top: #{$ion-space-250};
27012721
--margin-end: #{$ion-space-250};
@@ -2762,6 +2782,10 @@ Do not edit directly, this file was auto-generated.
27622782
@include padding(null, null, null, $ion-space-250);
27632783
}
27642784

2785+
.ion-gap-space-300 {
2786+
gap: #{$ion-space-300};
2787+
}
2788+
27652789
.ion-margin-space-300 {
27662790
--margin-top: #{$ion-space-300};
27672791
--margin-end: #{$ion-space-300};
@@ -2828,6 +2852,10 @@ Do not edit directly, this file was auto-generated.
28282852
@include padding(null, null, null, $ion-space-300);
28292853
}
28302854

2855+
.ion-gap-space-400 {
2856+
gap: #{$ion-space-400};
2857+
}
2858+
28312859
.ion-margin-space-400 {
28322860
--margin-top: #{$ion-space-400};
28332861
--margin-end: #{$ion-space-400};
@@ -2894,6 +2922,10 @@ Do not edit directly, this file was auto-generated.
28942922
@include padding(null, null, null, $ion-space-400);
28952923
}
28962924

2925+
.ion-gap-space-500 {
2926+
gap: #{$ion-space-500};
2927+
}
2928+
28972929
.ion-margin-space-500 {
28982930
--margin-top: #{$ion-space-500};
28992931
--margin-end: #{$ion-space-500};
@@ -2960,6 +2992,10 @@ Do not edit directly, this file was auto-generated.
29602992
@include padding(null, null, null, $ion-space-500);
29612993
}
29622994

2995+
.ion-gap-space-600 {
2996+
gap: #{$ion-space-600};
2997+
}
2998+
29632999
.ion-margin-space-600 {
29643000
--margin-top: #{$ion-space-600};
29653001
--margin-end: #{$ion-space-600};
@@ -3026,6 +3062,10 @@ Do not edit directly, this file was auto-generated.
30263062
@include padding(null, null, null, $ion-space-600);
30273063
}
30283064

3065+
.ion-gap-space-700 {
3066+
gap: #{$ion-space-700};
3067+
}
3068+
30293069
.ion-margin-space-700 {
30303070
--margin-top: #{$ion-space-700};
30313071
--margin-end: #{$ion-space-700};
@@ -3092,6 +3132,10 @@ Do not edit directly, this file was auto-generated.
30923132
@include padding(null, null, null, $ion-space-700);
30933133
}
30943134

3135+
.ion-gap-space-800 {
3136+
gap: #{$ion-space-800};
3137+
}
3138+
30953139
.ion-margin-space-800 {
30963140
--margin-top: #{$ion-space-800};
30973141
--margin-end: #{$ion-space-800};
@@ -3158,6 +3202,10 @@ Do not edit directly, this file was auto-generated.
31583202
@include padding(null, null, null, $ion-space-800);
31593203
}
31603204

3205+
.ion-gap-space-900 {
3206+
gap: #{$ion-space-900};
3207+
}
3208+
31613209
.ion-margin-space-900 {
31623210
--margin-top: #{$ion-space-900};
31633211
--margin-end: #{$ion-space-900};
@@ -3224,6 +3272,10 @@ Do not edit directly, this file was auto-generated.
32243272
@include padding(null, null, null, $ion-space-900);
32253273
}
32263274

3275+
.ion-gap-space-1000 {
3276+
gap: #{$ion-space-1000};
3277+
}
3278+
32273279
.ion-margin-space-1000 {
32283280
--margin-top: #{$ion-space-1000};
32293281
--margin-end: #{$ion-space-1000};
@@ -3290,6 +3342,10 @@ Do not edit directly, this file was auto-generated.
32903342
@include padding(null, null, null, $ion-space-1000);
32913343
}
32923344

3345+
.ion-gap-space-1200 {
3346+
gap: #{$ion-space-1200};
3347+
}
3348+
32933349
.ion-margin-space-1200 {
32943350
--margin-top: #{$ion-space-1200};
32953351
--margin-end: #{$ion-space-1200};
@@ -3356,6 +3412,10 @@ Do not edit directly, this file was auto-generated.
33563412
@include padding(null, null, null, $ion-space-1200);
33573413
}
33583414

3415+
.ion-gap-space-050 {
3416+
gap: #{$ion-space-050};
3417+
}
3418+
33593419
.ion-margin-space-050 {
33603420
--margin-top: #{$ion-space-050};
33613421
--margin-end: #{$ion-space-050};

0 commit comments

Comments
 (0)