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.
-->
This commit is contained in:
Bernardo Cardoso
2024-12-09 09:41:17 +00:00
committed by GitHub
parent 861b4bfdca
commit 826e7e229a
2 changed files with 68 additions and 1 deletions

View File

@ -231,7 +231,14 @@ function generateSpaceUtilityClasses(prop, className) {
};
`;
return `${marginPaddingTemplate('margin')}\n${marginPaddingTemplate('padding')}`;
// Add gap utility classes for gap tokens
const generateGapUtilityClasses = () =>`
.${variablesPrefix}-gap-${prop.name} {
gap: #{$${variablesPrefix}-${prop.name}};
};
`;
return `${generateGapUtilityClasses()}\n${marginPaddingTemplate('margin')}\n${marginPaddingTemplate('padding')}`;
}
// Generates a valid box-shadow value from a shadow Design Token structure