Fork me on GitHub
#off-topic
<
2018-09-28
>
idiomancy13:09:03

oh my god basic CSS question: How do you select the child of an element generically? Like if I say .my-class::nth-child(1) that targets the first my-class element that is a child. how do I select the first child of the my-class element???

Daniel Hines13:09:56

@josh_tackett That's my bread and butter. I've written some Clojure for working with it (though the library is rather incomplete) https://github.com/d4hines/dynamics-clj . Are you On-Premise or Online?

Daniel Hines13:09:02

@idiomancy, I think it's as easy as .my-class:first-child. https://codepen.io/d4hines/pen/QZWVrg

idiomancy13:09:35

>:first-child p:first-child Selects every <p> element that is the first child of its parent

idiomancy13:09:45

nah, that's just a shortcut of nth-child(1)

manutter5113:09:14

Hmm, .my-class > :first-child?

idiomancy13:09:00

does that work? is that a thing?

manutter5113:09:42

The > works, it means "direct descendant of"

idiomancy13:09:00

yeah, but how would I select the "first" one?

idiomancy13:09:22

in my use case, I guess I can rely on there only ever being one, so I could do > *, but its imprecise

manutter5113:09:19

I think what I gave you should select the first child element that is a direct descendant of .my-class (if I'm getting the pseudo-class syntax right)

idiomancy13:09:35

huh, yeah you might be right, let me check it out

idiomancy13:09:03

totally works!!

manutter5113:09:32

woot, awesome! Thanks for letting me know.

idiomancy13:09:36

(your example only worked because color is an inherited property lol)

Daniel Hines13:09:51

Ah, woops! Good catch.

Digital Baboon15:09:01

Day 4 with Clojure/Script: have learned how to separate logic with namespaces so everything isn't a big ugly mess in core.cljs, learned how to do routing with html5 pushState, learned how to do events. I'm pretty proud of today.

👍 20
🚀 8
souenzzo15:09:02

clojure itself is "The mess that rich writes and dont need to live in my code" If you think that cljs.core is a mess, dont look at clojure.RT

Digital Baboon15:09:23

Oh by core I meant namespace.core in CLJS. Did not know previously I can separate logic into different namespaces (files) so had a huge pile in one file.

👍 4
Digital Baboon15:09:52

First day was like "holy shit what did I get myself into by getting this job" 😄

souenzzo15:09:39

@UCTNL1JNN also fell into the bait Clojure is a really high quality bait

Digital Baboon10:09:03

@U2J4FRT2T I am liking it very much thus far

Digital Baboon15:09:21

They bait and switched me. Job ad was for JS. Job itself is for Clojure.

👍 8
mg17:09:18

Usually the bait and switch goes the other way

☝️ 8
borkdude15:09:00

@im hope you enjoy yourself, welcome to the cult community 😉

😆 4
Digital Baboon15:09:37

Oh I definitely do! Clojure is fun. First few days were dizzying as I'm merely a mediocre full-stack developer (php, js) as far as my background goes, but I'm increasingly so getting the hang of it. I have to thank @U06B8J0AJ who invited me to this slack as well, it has been helpful.

🎉 4
quadron23:09:11

has anyone tried lux by any chance?