Fork me on GitHub
Drew Verlee14:05:55

Can someone explain why i would want to use tailwind? I assume it's an optimization as h-12 is harder to understand then height 12

Drew Verlee14:05:41

My intuition is always that what you want is something to read :height 12 and produce the class (if it's reused/faster) as a complier stage. Then you can treat your css just like any other clojure var (def button {:blah "blah" :foo "bar}) or maybe even just one giant hashmap called "styles".

Noah Bogart14:05:10

i believe the idea is two-fold. first, makes writing the css inline easier: instead of having to say: style="height: 12px", you can say class="h-12" and it'll handle the transformation for you. second, decouples/removes the cascading part, so you don't have to say style="height: 12px" and then in the nested thing say style="height: 16px" or whatever.

Noah Bogart14:05:14

and then tailwind handles building the correct css for each section behind the scenes

Noah Bogart14:05:32

but i've not actually used it, that's just what i've gotten from reading the docs a while back

Drew Verlee14:05:40

thanks for the input. My take away from reading about it for about half an hour now is that it's just prebuilt css classes. If true, i wish they would just say as much rather then all the marketing fluff. I understand the need, but it's next to impossible to want to buy into something when everything is "amazing" "fast" "easy"!

Noah Bogart14:05:02

hah yeah, i definitely feel that

Drew Verlee14:05:43

ok, so at a glance this library does what i suggested > defstyles macro expands into a function which accepts an arbitrary number of arguments and returns a string of auto-generated class names that references both static and dynamic styles. > (defstyles button [bg] > {:font-size "14px" > :background-color bg}) > > (button "#000") > ;; "-css-43696 -vars-43696"

Drew Verlee14:05:22

i guess by dynamic style they mean ones created by functions. or maybe css really has functions, i think it's sort of irrelevant depending on how you compile it. My personal goal I have in any project is to only have to deal with clojure data in my program (not css).

Drew Verlee14:05:07

oh it says on the next line: > Dynamic styles are updated via CSS Variables (see

Drew Verlee14:05:00

> Custom properties (sometimes referred to as CSS variables or cascading variables) are entities defined by CSS authors that contain specific values to be reused throughout a document.Feb 3, 2021 Or cascading? cascading implies it would flow down the dom tree to me. But that's a lot more then "reusable" why are definations so hard to understand without examples.

Drew Verlee14:05:53

i don't think it cascades at all..