Fork me on GitHub
#clojurescript
<
2022-02-18
>
Richard Bowen18:02:46

Hey, how does one handle changing hover styling with material-ui?

dvingo18:02:58

same way as in javascript - either using component state with mouseover etc handlers, or use css :hover pseudo-class

Richard Bowen18:02:41

Could you give an example of using the :hover pseudo-class using Reagent?

p-himik18:02:34

Pseudo-classes are not Reagent-specific but it's something you can use in Material UI. Here's a link that describes them in general, using plain CSS: https://mui.com/customization/how-to-customize/#state-classes And here's a link on how to use some CSS approach with MUI: https://mui.com/guides/interoperability/ MUI itself uses Emotion, so it would make more sense to either go with that or with plain CSS. Also, just in case - since version 5 it's called MUI, not Material UI. If you need version 4 that was called Material UI, then you need different docs. But they're available on the same website - there's a version switch in the top left corner.

Richard Bowen18:02:12

Thanks. Still on v4.

sun-one19:02:49

My project has a transitive dependency on an npm module from a local clojurescript project. Is their a recommended approach for dealing with this (should I just compile the local clojurescript project to js? Or can I have my project resolve the dependencies npm modules itself).

emccue19:02:10

Im unsure the best way - but you can have local deps in npm as well

emccue19:02:24

so maybe have a package.json in your project that refers to the shared component?

dnolen22:02:15

@chesslunatic create a deps.cljs file at the top level of this other ClojureScript project - in there declare {:npm-deps ...}

dnolen22:02:54

now any project that depends on it will get the right dependency when you run install deps

dnolen22:02:29

need to update the website to include a basic example

🙌 1
sun-one18:02:40

Fantastic thanks