Skip to content

BOX ALIGNMENT - Justify Items : justify-items-auto not supported by google chrome #3855

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

Closed
devhoussam opened this issue Mar 27, 2021 · 16 comments

Comments

@devhoussam
Copy link

What version of Tailwind CSS are you using?

v2.0.4

What version of Node.js are you using?

v12.0.0

What browser are you using?

Chrome

What operating system are you using?

Windows 10

Reproduction repository

https://i.imgur.com/Pl7I3Gv.png

Image

@fedeci
Copy link
Contributor

fedeci commented Mar 27, 2021

Hi @devhoussam, what version of chrome are you using? Can you share a reproduction repo or the affected code, please?

@devhoussam
Copy link
Author

devhoussam commented Mar 27, 2021

Hi @devhoussam, what version of chrome are you using? Can you share a reproduction repo or the affected code, please?

Google Chrome Version : 89.0.4389.90
Windows 10

Image

as you can see in this example the place-items-auto Utility class not supported on chrome.

.place-items-auto {
    place-items: auto;
}

https://tailwindcss.com/docs/place-items

@fedeci
Copy link
Contributor

fedeci commented Mar 27, 2021

I think that since auto does not apply any specific behavior it is considered as invalid property (is like specifying nothing). Not sure though.

@devhoussam
Copy link
Author

I think that since auto does not apply any specific behavior it is considered as invalid property (is like specifying nothing). Not sure though.

maybe maybe not so what is the solution because it is an Utility class supported by Tailwind CSS so I will keep searching to find how can I fix it.

@adamwathan
Copy link
Member

Yep looks like MDN lies about this, as far as I can tell in my own testing there is no actual auto value unless it's just in the spec and no browsers support it.

I would just not use it, we'll likely just remove it from Tailwind since it does nothing.

@fedeci
Copy link
Contributor

fedeci commented Mar 27, 2021

Isn't it useful with breakpoints?
eg.
sm:align-items-left md:align-items-auto

@adamwathan
Copy link
Member

Well it doesn't exist so it can't really be useful 😅 align-items: auto isn't understood by the browser:

image

Instead you just want to explicitly set it to the value you want, like align-items: start which is the default 👍

@fedeci
Copy link
Contributor

fedeci commented Mar 27, 2021

The value used is the value of the justify-items property of the parents box, unless the box has no parent, or is absolutely positioned, in these cases, auto represents normal.

From mozilla docs 🤔

@adamwathan
Copy link
Member

Yeah but those docs are wrong which is what we have learned in this issue 😅 I added it originally because it was included in MDN, but it doesn't actually work in any browser as evident in the screenshot, hah.

@devhoussam
Copy link
Author

Yeah but those docs are wrong which is what we have learned in this issue 😅 I added it originally because it was included in MDN, but it doesn't actually work in any browser as evident in the screenshot, hah.

This is what it looks like to me too, so I think it would be better if it were removed from the doc

@fedeci
Copy link
Contributor

fedeci commented Mar 27, 2021

Yeah but those docs are wrong which is what we have learned in this issue 😅 I added it originally because it was included in MDN, but it doesn't actually work in any browser as evident in the screenshot, hah.

Well yes😁, but if the default behavior is the one specified there (where normaly it is start but if the box is absolutely positioned it is normal) then we can't just expect the users to adopt start as the default value because the default value is relative to the context. I don't know if I explained well or if my thoughts have sense😂.

@alpadev
Copy link

alpadev commented Mar 31, 2021

Yep looks like MDN lies about this, as far as I can tell in my own testing there is no actual auto value unless it's just in the spec and no browsers support it.

I would just not use it, we'll likely just remove it from Tailwind since it does nothing.

auto isn't even mentioned in the specs (anymore). https://www.w3.org/TR/css-align-3/#justify-items-property

According to w3c/csswg-drafts#1318 looks like they renamed it to legacy.

@alpadev
Copy link

alpadev commented Mar 31, 2021

Well it doesn't exist so it can't really be useful 😅 align-items: auto isn't understood by the browser:

image

Instead you just want to explicitly set it to the value you want, like align-items: start which is the default 👍

In regards to the spec https://www.w3.org/TR/css-align-3/#align-items-property. Looks like align-items: normal is the initial value. 😊

@devhoussam
Copy link
Author

so the tailwind css core team should update the documentation

@adamwathan
Copy link
Member

Removed justify-auto and place-items-auto for the next version since they do nothing, and removed from docs. They will disappear from the class table in the docs when we publish the next version 👍🏻

@devhoussam
Copy link
Author

Removed justify-auto and place-items-auto for the next version since they do nothing, and removed from docs. They will disappear from the class table in the docs when we publish the next version 👍🏻

@adamwathan amazing 👍

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

No branches or pull requests

4 participants