Giter Club home page Giter Club logo

Comments (4)

sastan avatar sastan commented on August 20, 2024

Idea from #190 (comment): Concat labels

I figured the cleanest way to do this would be a utility plugin-type thing to allow classnames like label:btn, which my hash fn would then look for to generate out something like btn::[css hash]. For handling the apply, my hash fn would also look for the :: (or whatever separator I use) and concat any newly found labels on. So if I was adding on a set of styles that include label:ghost to the generated-from-apply btn::[hash], I'd concat them into something like btn-ghost::[new(?) hash].

from twind.

sastan avatar sastan commented on August 20, 2024

Implemented in twind v1.

  • inline apply: styles are generated in order they are declared
    • @(underline font-bold) -> @(underline,font-bold)
    • Link@(underline font-bold) -> Link#12345
  • inline shortcut: style are generated as defined by twind — same as if they where used alone
    • ~(underline font-bold) -> ~(underline,font-bold)
    • Link~(underline font-bold) -> Link#abcdef

Please give it a try. Here are some links to get you started:

Closing this for now. Feel free to re-open.

from twind.

HowieG avatar HowieG commented on August 20, 2024

Hi @sastan I'm trying to add a custom prefix like we can here https://tailwindcss.com/docs/configuration#prefix
Is this possible in twind? I'm injecting my component into an existing site and getting style leakage that I hope can be prevented with this prefix

from twind.

tometo-dev avatar tometo-dev commented on August 20, 2024

Hi @sastan I'm trying to add a custom prefix like we can here https://tailwindcss.com/docs/configuration#prefix Is this possible in twind? I'm injecting my component into an existing site and getting style leakage that I hope can be prevented with this prefix

@HowieG , were you able to get this working? If yes, please do share the method. My use-case is also similar. Thank you.

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.