Fork me on GitHub
#reagent
<
2020-09-17
>
jhacks14:09:23

Is it possible to add :hover to an element using hiccup? I’ve tried variations of the attached snippet but the only thing that works is adding the css to a class externally (not inline in hiccup).

p-himik14:09:39

Pseudo classes cannot be used in inline styles. You will have to use a <style> tag and CSS selectors.

jhacks14:09:13

Ahhh, thanks for the clarification @U2FRKM4TW . Much appreciated!

juhoteperi15:09:34

https://github.com/clj-commons/cljss https://github.com/Jarzka/stylefy Some libraries provide components that can manage <style> to provide such feature

jhacks15:09:45

Thanks for the links!

p-himik16:09:30

Can reagent/with-let be safely used within the :reagent-render function of a form-3 component? What about the inner function of a form-2 component?

lilactown18:09:09

It looks like with-let basically emits the body of a form-2 component

lilactown18:09:26

So I would not expect you can nest it inside another form-2

lilactown18:09:40

Hmm maybe I’m wrong. The with-let code is a bit hard to follow

lukasz18:09:41

More on that - are there any examples on how to use with-let - I only found a reference here and there, but no clear explanation (granted, it was few months ago)

p-himik18:09:22

Here's one example in the blog post where it was introduced: https://reagent-project.github.io/news/news060-alpha.html

lukasz18:09:20

Thanks! That's super helpful - I remember seeing this post, but (silly me) I disregarded it since it was from 2015 ;-)

p-himik18:09:52

@lilactown Not sure I follow. with-let doesn't emit any fn except for the destroy clause.

lilactown18:09:51

Yeah I was wrong

p-himik18:09:12

Its implementation is indeed hard to follow, especially given that I'm not that familiar with the rest of the Reagent internals on which with-let relies. But my preliminary assessment along with my intuition tell me that using with-let in form-{2,3} components is prooobably fine. :)

lilactown18:09:15

It might be cool to add some tests for that

p-himik18:09:35

Another potential use-case - with-let within with-let.

lilactown18:09:15

I think that is in reagent tests when I peeked