Skip to content

fix(gap): target axis gap properties#2315

Open
dancormier wants to merge 4 commits into
mainfrom
STACKS-908/adjust-gap-atomic-classes
Open

fix(gap): target axis gap properties#2315
dancormier wants to merge 4 commits into
mainfrom
STACKS-908/adjust-gap-atomic-classes

Conversation

@dancormier

@dancormier dancormier commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

What this PR does

  1. Adds the !important declaration to all gap property atomic classes
    We expect all of our atomic classes to include !important so they override the given style of a component in all cases.
  2. Updates the .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 gap property 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.
  3. Updates the gap docs and Less snapshot to reflect these changes

Related Issue

STACKS-908

Changes

  • Updates .g* classes to emit gap: var(--_gap-y, 0) var(--_gap-x, 0) !important.
  • Updates .gx* classes to emit row-gap: var(--_gap-x) !important.
  • Updates .gy* classes to emit column-gap: var(--_gap-y, 0) !important.
  • Keeps the explicit selector lists in gap.less.
  • Updates the gap docs tables to reflect the new emitted properties.

Testing

  • npm run lint:css -w packages/stacks-classic
  • npx vitest run lib/atomic/gap.less.test.ts -u
  • npm run test:less -w packages/stacks-classic

@changeset-bot

changeset-bot Bot commented Jul 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7f54ac6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stackoverflow/stacks Patch

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

@netlify

netlify Bot commented Jul 1, 2026

Copy link
Copy Markdown

Deploy Preview for stacks ready!

Name Link
🔨 Latest commit 7f54ac6
🔍 Latest deploy log https://app.netlify.com/projects/stacks/deploys/6a4694d51def1000084a2936
😎 Deploy Preview https://deploy-preview-2315--stacks.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@dancormier dancormier marked this pull request as ready for review July 1, 2026 21:11
@dancormier dancormier requested a review from a team as a code owner July 1, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant