-
Notifications
You must be signed in to change notification settings - Fork 214
Support for ClojureScript? #400
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
Comments
Also interested in that! |
Hey! I am not familiar with ClojureScript. How do you use CSS classes with that? |
Hi! Basically, ClojureScript uses Hiccup (https://github.com/weavejester/hiccup).
or (as a map with attributes)
And Tailwind Intellisense doesn't work in these cases, at least for me. If I start typing |
Thanks for that @WindOfMind! I am reluctant to add first-class support for syntaxes that don't resemble traditional HTML (i.e.
You can read more about this here: tailwindlabs/tailwindcss#7553. Hope that helps! |
This works great, thanks so much. Has anyone figured out the proper regex for the |
i had some success in the past with this, hope it helps |
Hey, thought I would share this for those who end up here when looking for a Clojure or ClojureScript solution like I did, some nice folks on the Clojure slack helped me find this full solution that gives you autocompletion using both styles of hiccup (eg.
|
Does the above solution still work for everyone? For some reason the Probably unrelated but I noticed there is a Also, is anyone able to get sorting to work from this tool: https://github.com/heybourn/headwind in your clojure code? I am using this vim plug-in if that makes a difference in why things are different for me: https://github.com/yaegassy/coc-tailwindcss3 |
I developed these regex's for hiccup. Supported forms: :div.c1.c2
:.c1.c2 ;defaults to div
{:class :c1.c2
{:class "c1 c2"}
{:class ["c1" :c2]} depending on the hiccup flavour, some of these hiccup forms may not be supported. VScode Settings: "tailwindCSS.includeLanguages": {
"clojure": "",
"clojurescript": ""
},
"tailwindCSS.experimental.classRegex": [
[
"\\[:[^.\\s]*((?:\\.[^.\\s\\]]*)+)[\\s\\]]",
"\\.([^.]*)"
],
[
"\\:class\\s+(\\:[^\\s\\}]*)[\\s\\}]",
"[\\:.]([^.]*)"
],
[
"\\:class\\s+(\"[^\\}\"]*)\"",
"[\"\\s]([^\\s\"]*)"
],
[
"\\:class\\s+\\[(.*)\\]",
"[\"\\:]([^\\s\"]*)[\"]?"
]
], |
Hi @milelo, the |
That makes me think you could have some conflicting settings. Look at https://github.com/milelo/biff-electric-hiccup and its HTML Styling section. Ensure you don't have any user-settings for the plugin while you try it. |
@milelo thanks for your settings, they are working for me. I've updated the settings to support some multiline class vectors, by using keywords or symbols. For example, this settings work for: [:div {:class [:h-4
:w-10
:bg-slate-200]}] and for [:div {:class '[h-4
w-10
bg-slate-200]}] The only changes are on your last regex and a new added another one. Here is the full setup: "tailwindCSS.includeLanguages": {
"clojure": "",
"clojurescript": ""
},
"tailwindCSS.experimental.classRegex": [
[
"\\[:[^.\\s]*((?:\\.[^.\\s\\]]*)+)[\\s\\]]",
"\\.([^.]*)"
],
[
"\\:class\\s+(\\:[^\\s\\}]*)[\\s\\}]",
"[\\:.]([^.]*)"
],
[
"\\:class\\s+(\"[^\\}\"]*)\"",
"[\"\\s]([^\\s\"]*)"
],
[
"\\:class\\s+\\[([\\s\\S]*)\\]",
"[\"\\:]([^\\s\"]*)[\"]?"
],
[
"\\:class\\s+'\\[([\\s\\S]*)\\]",
"([^\\s]*)?"
]
], I don't know if this has other side effects, but for now it's working. Regards. |
I tweaked the ones above to also include Fulcro's style syntax sugar
And for any neovim users here is how I got this all working when I switched from
|
is there any plans on adding support for ClojureScript? i'd be willing to help!
The text was updated successfully, but these errors were encountered: