shadow-cljs

Casey 2025-03-03T16:02:54.839019Z

@thheller I started using shadow-css on an existing project, trying to migrate from tailwind to it (tailwind just breaks stuff too often for no good reason). I am slowly adding more aliases, but currently if I use an alias and it doesn't exist there is no warning or error. Is there an easy place to slot in some optional warnings if aliases are used but don't exist?

thheller 2025-03-03T16:44:32.995059Z

they should be printen, if you are using a build setup such as the one from the README

(defn css-release [& args]
  (let [build-state
        (-> (cb/start)
            (cb/index-path (io/file "src" "main") {})
            (cb/generate
              '{:ui
                {:entries []}})
            (cb/minify)
            (cb/write-outputs-to (io/file "public" "css")))]

    (doseq [mod (:outputs build-state)
            {:keys [warning-type] :as warning} (:warnings mod)]
      (prn [:CSS (name warning-type) (dissoc warning :warning-type)]))))

thheller 2025-03-03T16:44:51.131269Z

you can adjust this to whatever you need

thheller 2025-03-03T16:51:55.523989Z

oh just noticed that is a bit outdated, switch (:outputs build-state) to (vals (:chunks build-state))

thheller 2025-03-03T16:53:27.185629Z

its ugly but better than nothing 😛

Casey 2025-03-03T18:03:44.945989Z

Aha yes, that's perfect. I even already had it in my build css, but it wasn't working because it was using :outputs 🙂

👍 1