Custom library - how import only custom library without install tailwind #14311
Unanswered
True-Slimen
asked this question in
Help
Replies: 1 comment
-
Short version : |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello Tailwind Community ! Happy to meet you.
I encounter some problem on my project.
I have created a simple html / npm / tailwind project to create an UI library.
This project include html components and sccs style.
Most of the style is constructed on custom class (e.g : .my-btn) and defined in style.scss by '@apply some tailwind class;'
So my library is compiled and push on private npm repo. The goal is to install this library and use the compiled stylesheet without install Tailwind again.
In fact this is (almost) perfectly work. I install my lib and import the style.css (who contain all tailwind...).
I can use my custom class (who use tailwind class under the hood) and i can add tailwind class in the html to override my custom class on demand.
The problem is with responsive pattern, none of the breakpoint work : sm: md: ... i can write font-bold but md:font-bold doesn't work...
On the browser i can see, but in grey :
@media (min-width: 1024px) {
.lg:columns-4 {
columns: 4;
}
}
But is never applied. How the browser can read the good rule but not apply it ? The style rules order is false may be ?
Finally, do you no a way to have tailwind in my library and all this features in my project who import my library without import tailwind himself ? I guess there is a clean way to do this.
Sorry for long post, and thanks to people who read it 🙂
Beta Was this translation helpful? Give feedback.
All reactions