Open raystubbs opened 10 months ago
Hmm right, not something I considered. Will think about it.
This is a surprisingly difficult thing to get right. While it won't be common it is absolutely possible to have both files use a (css ..)
form in the exact same spot. That would lead to a conflict, since all that is considered for the generated classname is the ns, line and column.
So, maybe the generation needs to consider whether it is a CLJ or CLJS context, which then becomes tricky for CLJC since thats often both at the same time.
Will think about it some more ...
FWIW one possible fix is using a .cljc
file instead of two separate files. Not something I usually recommend but reasonable for this case.
Huh, hadn't thought of that. Good idea.
@thheller Could shadow-css work on files rather than namespaces?
Maybe. See my comment from above.
My first attempt at fixing this issue was exactly that. Ran into quite a few quirks, so ultimately shelved it. One of the limiting things being that its not always easy to get the filename in the macro context (for example stuff eval'd at the REPL).
Didn't have too much time to think about this yet.
I have an
icons.clj
with a macro for generating icon markup, and anicon.cljs
with:require-macros
. The CSS foricons.clj
never gets generated. It looks like multiple files with the same ns will override each other.