Giter Site home page Giter Site logo

Comments (4)

lukejacksonn avatar lukejacksonn commented on August 22, 2024 1

Good spot, I wonder why.. will look into it. Thanks for the repro πŸ™‡

from twind.

lukejacksonn avatar lukejacksonn commented on August 22, 2024 1

Ahh ok, I have seen this before somewhere.. the reason the content keys are being stripped is because the values should be wrapped in quotes and the translate process will strip these usually which makes it invalid CSS.

So the following works because the resolved value is '😊' as supposed to 😊:

const styles = css({
  "&::before": { background: "red", content: "'πŸ™'" },
  "&::after": { background: "green", content: "'😊'" }
});

from twind.

caminad avatar caminad commented on August 22, 2024 1

Ah that makes sense! Now that you've explained it this feels like normal CSS-in-JS behavior, including in tailwindcss plugins. I'll open a PR to fix the examples in the docs.

from twind.

sastan avatar sastan commented on August 22, 2024

The content property can have several values that are not in quotes. User that are using content must use a valid CSS value. In this case '"😊"' (notice the additional ' ).

We should adjust the examples.

from twind.

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.