This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-14
Channels
- # aws-lambda (5)
- # beginners (38)
- # boot (197)
- # carry (7)
- # clara (3)
- # cljs-dev (7)
- # cljsjs (6)
- # cljsrn (24)
- # clojure (39)
- # clojure-art (10)
- # clojure-austin (7)
- # clojure-dusseldorf (1)
- # clojure-italy (8)
- # clojure-russia (89)
- # clojure-spec (119)
- # clojure-taiwan (1)
- # clojure-uk (19)
- # clojurescript (104)
- # community-development (2)
- # conf-proposals (22)
- # copenhagen-clojurians (8)
- # cursive (2)
- # datomic (35)
- # devcards (4)
- # dirac (79)
- # euroclojure (2)
- # immutant (35)
- # om (138)
- # om-next (2)
- # onyx (172)
- # proton (4)
- # protorepl (1)
- # re-frame (36)
- # reagent (34)
- # spacemacs (1)
- # specter (7)
- # untangled (89)
- # yada (2)
@anmonteiro Your project reminds me of the lisp based DSSSL https://eager.io/blog/the-languages-which-almost-were-css/#the-turing-complete-stylesheet
@stephenway wasn’t aware of that
that project uses garden to generate the styles
the rationale behind it is that if we’re colocating queries, why not styles too 🙂
didn’t think about that (yet)
can’t we do it in garden?
I believe there is going to be a new alpha release of Garden with a bunch of changes in the next few weeks - might be some useful ideas to look at there as well
@shaun-mahood Do you know where I can find that? Can’t find a branch or tag on github.
Not out yet, you could check with @noprompt when he is planning a release
@anmonteiro I'm noticing a trend of people overriding defui
. It occurs to me that this approach does not compose. The next challenge, perhaps?
@tony.kay yes! That’s one thing I regret
we're wanting to instrument it to add in debugging capabilities in the browser during dev, and lots of libs seem to want to do things like your css lib
one of the hard requirements of that project though is that we generate a CSS file in the end
this has to be done on the JVM side, of course
I understand. Same problem for the debugging tools. The hack has to take place at the react level
well the thing is it needs to be a macro
it probably doesn’t need to be colocated in the sense that it’s a protocol to implement in defui
maybe some other macro like defcss
that can be colocated above the defui
macro, like core.typed
annotations are
I have to think about that. feel free to open issues if you wanna discuss that
@anmonteiro my expectation is to have an alpha available in the next couple of weeks. the next version of garden is addressing specific pain points of issues that are difficult to close with the current implementation. the most significant improvements will be support for parsing/manipulating "raw" CSS and a dramatically cleaner, clearer, and more extensible compiler.
@anmonteiro how about, instead of a defui override, a function that can be called in the body of render? E.g. (render [this] (apply-css (dom/div #js {:class :root} ...)))
@tony.kay where would you define the actual styles?
"<= use a vector [:one :two]
to add multiple classes to an element"
and yeah, for render I just need to know the munging
what I meant earlier by the defcss
was that it could take the class
somewhat akin to clojure.spec/fdef
but we’d lose colocation actually inside defui
which might actually not be that important
couldn’t use a static protocol without overriding the defui macro
because I do static analysis on the defined styles
and evaluate them on the Clojure side
to generate the CSS file
which is also the reason why variables must be defined in a .cljc
file
https://github.com/ladderlife/om-css#user-defined-variables-in-colocated-styles
btw, the current CSS spitting works great with e.g. Figwheel development
we’d lose that if Node
Yeah, I'm liking the defcss idea. avoids the defui composition problem, but gets all of the good results.
not currently I think
it was but they’ve replaced it with something very similar
so definitely up for the churn
problem with defcss
is then we’d need to wrap the render function too
that can be a pro as well, though, because it opens the door to further composition and reuse
which you mentioned above with apply-css
Oh we’re thinking different things
and your idea is probably better
I was thinking:
(defcss Foo ..)
(defui Foo ..)
and the Foo styles would only be applied to Foo
probably harder to do your idea because of prefixing
actually maybe not