-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider not relying on previously defined mixin in file for "@apply" #150
Comments
I tried using https://github.com/ben-eb/postcss-discard-duplicates to discard the duplicate code created by The only other option would be to have the core include a "reverse parser", something that can take in a css class, and spit out a config key path. Probably not the easiest thing to do, but with it you could avoid including |
Follow up: I was able to dedupe the rules using https://github.com/ChristianMurphy/postcss-combine-duplicated-selectors, so that is an option. |
…cing Add customization docs to letter spacing
Currently
@apply
works by walking through all previously defined "mixins"[1] in the file before substituting the found ones, which constrains you to either only use one file, or to import all of your css in one place [2] before defining your custom utilities.It of course won't work with popular css-in-js solutions [3] simply because the css fragment using
@apply
has no knowledge of tailwind's utilities, yielding the dreadedunable to find $SELECTOR
error.Importing them beforehand using
@tailwind utilities
everywhere is obviously not a solution because of duplication.An idea would be to:
[1] which are actually selectors, making me wonder why the mixin terminology was used
[2] #53 (comment)
[3] such as styled-component, emotionjs or even vue's "single file component" (#1 (comment))
They all are processed by postcss under the hood
The text was updated successfully, but these errors were encountered: