[Feature] Add function/at-rule to get a property value from a utility ruleset #2246
Replies: 3 comments
-
@adamwathan Any thoughts on this? |
Beta Was this translation helpful? Give feedback.
-
What’s your issue with using the existing |
Beta Was this translation helpful? Give feedback.
-
Well, TBH - I thought the That being said, it seems the difference between the two would be that Either way, thanks for you response! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Let me get this out of the way: Tailwind is awesome and I'm grateful for what it has done to popularize the concept of "utility-first" styles.
How I arrived at this suggestion is a long story and may warrant it's own feature request / conversation.
The short version is this:
The organization that I work for has adopted Angular as the framework of choice. Our engineers (myself included) were not comfortable with the additional dependencies and tooling that would be needed for a postcss-based library within an Angular project. I'm not looking to start an argument about whether or not @angular-builder/custom-webpack or pre-build scripts or any other workarounds are a good solution (in the context of Angular). I'm just providing some back story.
So...my team created a sass plugin/importer that is fundamentally inspired by Tailwind. It's only true dependency is sass and requires no additional configuration for angular cli.
DON'T LOOK AWAY YET! THIS ISN'T ANOTHER QUESTION ABOUT SASS OR USAGE IN AN ANGULAR PROJECT!
Using our sass library looks like this:
The
get-apply
function in that example is the basis for my feature request. I think this could be very useful for Tailwind users - to be able to "reach into" a utility and get property value within a plugin ruleset.min-w-
sizing scale rules.calc()
, (i.e.calc(get-apply('w-32', 'width') * 0.5)
)Something like this?
I actually would love to contribute to Tailwind so if folks think this would be useful, I'd be happy to work on a PR (if the core team can suggest a starting point)
Beta Was this translation helpful? Give feedback.
All reactions