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

excaped characters break selector detection with tailwind v3 #169

Open
hichemfantar opened this issue Nov 24, 2024 · 3 comments
Open

excaped characters break selector detection with tailwind v3 #169

hichemfantar opened this issue Nov 24, 2024 · 3 comments

Comments

@hichemfantar
Copy link

hichemfantar commented Nov 24, 2024

it seems it breaks with escaped characters

terminal warning:

2:3     ⚠  Nested @tailwind rules were detected, but are not supported.
Consider using a prefix to scope Tailwind's classes: https://tailwindcss.com/docs/configuration#prefix
Alternatively, use the important selector strategy: https://tailwindcss.com/docs/configuration#selector-strategy [undefined]

local config:
"postcss-nested": "^7.0.2",

module.exports = {
  plugins: {
    'postcss-import': {},
    'postcss-nested': {},
    tailwindcss: {},
    autoprefixer: {},
  },
}

css file:

#bluesky-embed {
  @tailwind base;
  @tailwind components;
  @tailwind utilities;

  .break-word {
    word-break: break-word;
  }
}

result:

@media (min-width: 1536px) {

// not escaped
  #bluesky-embed .container {
    max-width: 1536px;
  }
}

// : is escaped 
.hover\:underline:hover {
  text-decoration-line: underline;
}

@media (min-width: 300px) {
 // : [ ] are escaped 
  .min-\[300px\]\:text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
  }
}

following https://tailwindcss.com/docs/using-with-preprocessors#nesting

https://play.tailwindcss.com/4L4HQiVNmh

image

related to tailwindlabs/tailwindcss#14753 (comment)

@hichemfantar hichemfantar changed the title hover and media queries not being nested with tailwind v3 excaped characters break nesting with tailwind v3 Nov 24, 2024
@hichemfantar hichemfantar changed the title excaped characters break nesting with tailwind v3 excaped characters break selector detection with tailwind v3 Nov 24, 2024
@ai
Copy link
Member

ai commented Nov 25, 2024

I need a PR which will fix the issue

@hichemfantar
Copy link
Author

not sure if the issue is with this lib or postcss-selector-parser

@ai
Copy link
Member

ai commented Nov 25, 2024

Try to do a debug to find out

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