css

For all your CSS related content...
2021-05-04T14:16:55.004500Z

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

2021-05-04T14:21:41.006300Z

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".

NoahTheDuke 2021-05-04T14:36:10.009500Z

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.

NoahTheDuke 2021-05-04T14:37:14.010200Z

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

NoahTheDuke 2021-05-04T14:37:32.010600Z

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

2021-05-04T14:41:40.014700Z

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"!

NoahTheDuke 2021-05-04T14:43:02.014900Z

hah yeah, i definitely feel that

2021-05-04T14:45:43.015500Z

ok, so at a glance this library does what i suggested https://github.com/clj-commons/cljss > 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"

2021-05-04T14:46:22.016100Z

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).

2021-05-04T14:48:07.016500Z

oh it says on the next line: > Dynamic styles are updated via CSS Variables (see http://caniuse.com/#feat=css-variables).

2021-05-04T14:50:00.018Z

> 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.

2021-05-04T14:51:53.018500Z

i don't think it cascades at all..