Skip to content
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

Arbitrary responsive screen values not working with custom screen values #9718

Closed
treb00 opened this issue Nov 2, 2022 · 1 comment
Closed

Comments

@treb00
Copy link

treb00 commented Nov 2, 2022

What version of Tailwind CSS are you using?

v3.2.1

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

Tailwind play

What version of Node.js are you using?

Tailwind play

What browser are you using?

Chrome

What operating system are you using?

Windows

Reproduction URL

Tailwind play

Describe your issue

The arbitrary responsive screen values (example: max-[1000px]:flex-col) not working if at least one screen value is added in tailwind config, either in the theme.screens or theme.extend.screens. If you try to remove that one screen value in the provided example, it works again.

If you make a custom screen like:
screens: { sm: '500px' }
it still works. However, if you do this:
screens: { sm: { max: '500px' } }
it stops working.

@thecrypticace
Copy link
Contributor

The min and max variants are disabled for screen configurations when objects are present. You will also notice that max-sm:*, max-md:*, etc… don't generate anything. This is an intentional design limitation for now. This is discussed in the description of #9558 in the "restrictions" section. The tl;dr is we did this for simplicity and predictability.

We also issue a warning in the console for the arbitrary value case. We do not in the case of pre-configured screens because we would end up adding invalid suggestions to Intellisense (because we would say we explicitly support a value only to then not generate anything for it). This warning is surfaced in the browser console for Play and the CDN and the terminal for Node:

Screen Shot 2022-11-02 at 16 31 50

Screen Shot 2022-11-02 at 16 39 04

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

2 participants