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

Support for Arbitrary Values with Custom Breakpoint configuration #14121

Closed
hamidreza4dev opened this issue Aug 4, 2024 · 2 comments
Closed

Comments

@hamidreza4dev
Copy link

What version of Tailwind CSS are you using?

v3.4.7

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

postcss 8.4.40, Next.js 14.2.5

What version of Node.js are you using?

For example: v20.15.0

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction URL

https://play.tailwindcss.com/DN6QPm53oY

Describe your issue

The class min-[800px]:bg-red-500 is not recognized because I switched to max-width breakpoints instead of the default min-width. Here is my configuration:

/** @type {import('tailwindcss').Config} */
export default {
  theme: {
    screens: {
      '3xl': { max: '1899px' },
      '2xl': { max: '1535px' },
      xl: { max: '1399px' },
      xxl: { max: '1279px' },
      lg: { max: '1023px' },
      md: { max: '767px' },
      sm: { max: '639px' },
      xs: { max: '479px' },
      xxs: { max: '399px' },
    },
  }
}
@wongjn
Copy link
Contributor

wongjn commented Aug 4, 2024

Possible duplicate of #12489. Also, consider reading up on #9558 (comment) if you have not done so already. As a work-around, you could use arbitrary variants like [@media(min-width:800px)]:bg-red-500.

@adamwathan
Copy link
Member

Hey! As mentioned by @wongjn this is by design at the moment and is explained in the original PR because of the amount of complexity involved in sorting the utilities to be in a useful order in the final CSS, so going to close this one.

I think we do need to rework the responsive design page to just not talk about configuring max-width breakpoints though honestly because of this and encourage the max-* variants instead.

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

3 participants