Skip to content

excaped characters break selector detection with tailwind v3 #169

@clicktodev

Description

@clicktodev

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions