Giter Club home page Giter Club logo

Comments (5)

adamwathan avatar adamwathan commented on June 11, 2024 1

Reopening so we fix this in v3 as well.

from tailwindcss.

brandonmcconnell avatar brandonmcconnell commented on June 11, 2024

One solution here could be to explicitly detect and ignore known function syntaxes, as it appears to be a very finite and set concrete list:

  • font-format()
  • font-tech()
  • selector()

Doing it this way and not arbitrarily matching a string(…) pattern would also avoid matching for all strings where some others are valid non-function syntax (e.g. and|or|not).


UPDATE: In my related PR #13596, I opted to support the hyphen character in supports checks, which appears to fix the issue and resolve the cases you mentioned with one exception (details below) and add support for custom properties the same way we currently support native ones.

  • supports-[display]@supports (display: var(--tw))
  • supports-[--test]@supports (--test: var(--tw))

from tailwindcss.

brandonmcconnell avatar brandonmcconnell commented on June 11, 2024

Thoughts for the future — it could be helpful to set up extensions to the supports rule to support each of the function syntaxes in the future, e.g.:

  • supports-font-format-[opentype]
  • supports-font-selector-[h2>p]

⚠️ This still wouldn't account for the present use case of using them inline, which is the immediate need

from tailwindcss.

brandonmcconnell avatar brandonmcconnell commented on June 11, 2024

@adamwathan I opened PR #13596, which should resolve this issue. It does not fix the supports-[content:"("]:grid test you mentioned, but as that does not appear to be directly related to the supports-variant effort and is more related to the parser itself, I would prefer to handle that case in a separate PR.

You can see here that this was an issue before: https://play.tailwindcss.com/M7FOiImx9l

I confirmed that example (supports-[content:"("]:grid) doesn't reach the test, so it would appear to be filtered out by the parser. supports-[content:"test"]:grid works, indicating that the parenthesis is the other example is problematic. I'll take a deeper look at how the parser handles quoted strings inside arbitrary values and see if something is missing there.

from tailwindcss.

brandonmcconnell avatar brandonmcconnell commented on June 11, 2024

@adamwathan #13605 should fix this for v3

from tailwindcss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.