lambdaisland

2020-12-03T16:32:15.022Z

Some regex fun: https://twitter.com/chrishouser/status/1334358203245752322 Can we name the captured expression in Regal?

plexus 2020-12-03T16:38:14.022800Z

No, not supported because JS doesn't support it. It's a proposal though so once ClojureScript uses a new enough variant of Ecmascript we can consider it 🙂

2020-12-03T16:43:01.025Z

I started a small library similar to tailwindcss, but designed in a Clojure way, taking advantage of the macro system to read the name of the classes and generate them as you go. I thought about using Regal for it, but was blocked by that specific missing feature. So I using Minimallist for now.

2020-12-03T16:44:38.026500Z

That’s a kind-of-new way to generate css … grammar-based generation instead of config-based like tailwind where there is a garbage collector for all the generated and unused classes which are removed for production builds.

plexus 2020-12-03T16:45:22.027400Z

interesting, we may actually release a library in the near future for doing css-in-js style stuff, but on the backend, on top of garden

👀 1
2020-12-03T16:45:57.028300Z

Ideally, I wish that the user of my library to be able to write down their own syntax in a easy way. I am still thinking about how to make it easy to describe.

plexus 2020-12-03T16:47:02.030200Z

basically you define styled component like this

(o/defstyled description :div
  {:max-width "29rem !important"
   :min-width "20rem"
   :justify-self "center"
   :align-self "center"
   :grid-area "2 / 2 / 3"})
then use it in your hiccup
[description ...]
;; or
[:p {:class [description]} ...]
and it ends up as a generated class in a css file on production

plexus 2020-12-03T16:47:27.030700Z

has been working really well for us on the lambda island redesign

2020-12-03T16:50:28.032300Z

I am thinking more like having classes describing elementary things like .mr-109px which mean marge on the right with 109 pixels.

2020-12-03T16:50:57.032900Z

where the user can describe a grammar for the possible class names, in a convenient way

2020-12-03T16:51:44.033700Z

… and most importantly, how to map their parsed parts to names, bidirectionally.

2020-12-03T16:53:00.034100Z

I will give it some time and think.

borkdude 2020-12-03T17:09:50.034900Z

> No, not supported because JS doesn't support it. You could also consider exposing platform-specific features and not the lowest common denominator, as long as it's documented.

plexus 2020-12-03T18:02:51.036500Z

that would go against one of the core design principles of Regal. We're also just not adding syntax right now until all parts (especially the generator generators) have stabilized.