thheller / shadow-css

CSS-in-CLJ(S)
https://github.com/thheller/shadow-css
Eclipse Public License 1.0
114 stars 10 forks source link

Keyframe workaround #21

Closed jeans11 closed 1 year ago

jeans11 commented 1 year ago

Hi!

I'm wonder what if the workaround to deals with the keyframes. Just create a css file and add it into the index.html? or there is a better way?

Thanks

thheller commented 1 year ago

You can include arbitrary .css files via the :shadow.css/include directive in one of your CLJS ns forms.

See here

(ns shadow.cljs.ui.components.code-editor
  {:shadow.css/include ["shadow/cljs/ui/components/code-editor.css"]}
  ...)

This will cause the build process to include the linked css file in the final output. The file needs to be located on the classpath, so ideally just next to your source file doing the include.

This is just a regular CSS file, no processing of any kind is done. An extra CSS file linked via HTML of course also works.

jeans11 commented 1 year ago

Thanks @thheller!