fix(gap): target axis gap properties#2315
Conversation
🦋 Changeset detectedLatest commit: 13a85f3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for stacks ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
asblanco
left a comment
There was a problem hiding this comment.
I believe we have inverted the x/y axes. We had gap: <row-gap | gap-y> <column-gap | gap-x> and now we're setting row-gap to gx and column-gap to gy 👀
Co-authored-by: Andrea Sánchez Blanco <asanchezblanco@stackoverflow.com>
Co-authored-by: Andrea Sánchez Blanco <asanchezblanco@stackoverflow.com>
Oh wow, I can't believe I did that 🤦 Thank you for catching this! I've accepted your changes and have updated the Less snapshots so this should be ready for another review |
Summary
What this PR does
!importantdeclaration to allgapproperty atomic classesWe expect all of our atomic classes to include
!importantso they override the given style of a component in all cases..gx*and.gy*atomic classes so they only impact the the CSS property for a single axis, as intended.Prior to this PR, those properties set a
gapproperty which included some value for both axes. This would result in the property potentially overwriting an existing gap value for the axis not intended to be set by the atomic class applied.Related Issue
STACKS-908
Changes
.g*classes to emitgap: var(--_gap-y, 0) var(--_gap-x, 0) !important..gx*classes to emitrow-gap: var(--_gap-x) !important..gy*classes to emitcolumn-gap: var(--_gap-y, 0) !important.gap.less.Testing
npm run lint:css -w packages/stacks-classicnpx vitest run lib/atomic/gap.less.test.ts -unpm run test:less -w packages/stacks-classic