This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-04
Channels
- # announcements (1)
- # asami (61)
- # babashka (71)
- # beginners (170)
- # biff (1)
- # calva (14)
- # clj-kondo (23)
- # cljsrn (28)
- # clojars (1)
- # clojure (152)
- # clojure-australia (2)
- # clojure-europe (65)
- # clojure-nl (2)
- # clojure-spec (8)
- # clojure-sweden (3)
- # clojure-uk (45)
- # clojurescript (1)
- # css (12)
- # cursive (16)
- # datomic (9)
- # devcards (2)
- # emacs (1)
- # events (1)
- # graalvm (31)
- # honeysql (10)
- # jackdaw (2)
- # jobs (5)
- # lambdaisland (9)
- # lsp (4)
- # malli (11)
- # meander (43)
- # off-topic (6)
- # pathom (7)
- # polylith (1)
- # portal (14)
- # re-frame (7)
- # releases (1)
- # remote-jobs (1)
- # rewrite-clj (6)
- # shadow-cljs (101)
- # specter (1)
- # tools-deps (26)
- # vim (9)
- # xtdb (2)
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
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".
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.
and then tailwind handles building the correct css for each section behind the scenes
but i've not actually used it, that's just what i've gotten from reading the docs a while back
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"!
hah yeah, i definitely feel that
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"
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).
oh it says on the next line: > Dynamic styles are updated via CSS Variables (see http://caniuse.com/#feat=css-variables).
> 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.
i don't think it cascades at all..