chore(pds-box): replace deprecated Sass if() with @if directive #644
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Replace deprecated Sass
if()function with@if/@elsedirectives to resolve deprecation warnings when running Storybook.Solution
The Sass
if()function is deprecated in favor of the native CSSif()function. To resolve this, the conditional class name assignment was refactored to use@if/@elsedirectives instead.The pattern declares a variable with a default value first, then uses
@ifto conditionally reassign it when a prefix/direction is provided. This produces identical CSS output while avoiding the deprecation warning.Three mixins were updated in
pds-box.mixins.scss:generate-spacing-classes- generates pds-spacing-* utility classesgenerate-columns- generates pds-box-* column width classesgenerate-column-offsets- generates pds-box-offset-* classesFixes DSS-90
Type of change
How Has This Been Tested?
Checklist: