Skip to content

space-x- and space-y- breaking change #17695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kocv59 opened this issue Apr 16, 2025 · 3 comments
Open

space-x- and space-y- breaking change #17695

kocv59 opened this issue Apr 16, 2025 · 3 comments

Comments

@kocv59
Copy link

kocv59 commented Apr 16, 2025

What version of Tailwind CSS are you using?

v4.1.3

What build tool (or framework if it abstracts the build tool) are you using?

webpack 5.98.0
postcss 8.5.3
postcss-loader 8.1.1

What version of Node.js are you using?

v20.19.0

What browser are you using?

Chrome

Describe your issue

space-x- and space-y- don't work with all the values in https://developer.mozilla.org/en-US/docs/Web/CSS/margin-block-start like inherit, initial and revert (space-x-[revert]). It worked in tailwind 3 but it's a breaking change. It's trying to use those words with calc which isn't possible.

	
& > :not(:last-child) {
  --tw-space-x-reverse: 0;
  margin-inline-start: calc(<value> * var(--tw-space-x-reverse));
  margin-inline-end: calc(<value> * calc(1 - var(--tw-space-x-reverse)));
};
@philipp-spiess
Copy link
Member

Hey there! What exactly is the syntax that worked with v3? I tried space-x-[revert] and the others in the playground and it seems to behave the same there: https://play.tailwindcss.com/cE8PAWA99Q

Image

@kocv59
Copy link
Author

kocv59 commented Apr 17, 2025

I can't reproduce either it was working a long time ago maybe it was added as a custom utility. The same problem is with all arbitrary values because most props take the same global values. Tailwind shouldn't generate them with calc because that's not valid in the css spec.

@kocv59
Copy link
Author

kocv59 commented Apr 21, 2025

Some utilities like margin and width work with global values like [revert] but space-x- and space-y- don't.

I think css global values shouldn't need to use arbitrary value. m-revert should be supported instead of m-[revert].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants