Fork me on GitHub

is there a way to add custom CSS to the browser REPL and have it hot reload?

👀 1

The browser devtools should reload it for you automagically when it changes on disk, if you use the built-in server and whatnot


I'm asking about using the browser REPL, rather than configuring a build


I know how to configure a build with my own index.html that includes my CSS. I would like to avoid that for a simple project, and just include the CSS in the default browser REPL page


I see. Seemingly, it won't know if files on disk has changed unless you have some devtool connection between the browser and the clojure process that shadow-cljs runs its builds from. Would be a lot of additional setup to get that running.


You could manually remove/add link tags in your DOM I guess and point it to the CSS file on disk, trigger that action on change somehow


I don't think you need any fancy "hot reload" but can simply reload the entire file at once without any concern


I wonder how shadow-cljs reloads the CSS. is it just adding/removing the link tags?


browser-repl doesn't allow custom css currently


but browser-repl is nothing but a regular :browser build so technically it would be easy to add. there just aren't any options for it


thats the html being served


thats the build config used


thanks! this doesn't directly solve my problem, but I've been thinking about how to build better tools for doing REPL driven UI development and this gives me more to chew on (how to add & dynamically reload CSS)


Can I change the location of shadow-cljs.edn somehow? Search around both in the docs, on the web and in the code base for any parameter/environment variable that allows me to point it to a different one