css

For all your CSS related content...
grounded_sage 2016-02-23T10:53:59.000010Z

#channel Could I ask for some quick help from anyone using Garden. I am trying to use pseudo elements. When I do this (defpseudoelement after) and run this (css [:body after {:background 'blue}]) in the repl I get back this "body, ::after {\n background: blue;\n}". Not sure how to stop the comma from after body.

niamu 2016-02-23T14:41:15.000011Z

@grounded_sage: (defselector body) (defpseudoelement after) (css [(body after) {:background 'blue}])

niamu 2016-02-23T14:41:53.000013Z

I think that should work.

grounded_sage 2016-02-23T14:48:24.000014Z

@niamu: I'll give that a go. I tried it earlier after reading the source and followed the (defselector p) example and it didn't work for me 😞

niamu 2016-02-23T14:50:17.000015Z

You may also be able to do something like (css [body [:&:after {:background ‘blue}]]) It’s not exactly correct but I think every browser will render that correctly.

niamu 2016-02-23T14:51:19.000016Z

And then there’s always (css [“body::after” {:background ‘blue}])

niamu 2016-02-23T14:53:12.000017Z

I usually just end up going with the strings with garden just because I can’t be bothered to bring in the other namespaces to compose the more complicated selectors when I generally don’t need the flexibility beyond one or two styles. Feels like a lot of overhead for me personally.

grounded_sage 2016-02-23T14:55:04.000018Z

Yes I agree. Saw string version and was like THATS IT. But wanted to see if the first one you gave me worked which it did... so must have been something else I was doing.

grounded_sage 2016-02-23T14:56:15.000019Z

I didn't think it would unstring the string so I was using (read-string (str ...)) which was just keeping the function as is and not evaluating it lol.

niamu 2016-02-23T14:56:22.000020Z

The strings don’t really make me feel great, but at least I’m in and out quickly and I can move on to the next style rather than pausing and realizing I need to pull in another piece of garden before I can continue.

grounded_sage 2016-02-23T14:58:43.000021Z

Yep I know the feeling. I decided to build my static site using all of this plus following Atomic Design principles which has resulted in a bucket load of namespaces. Way overkill but I am learning!