This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-11
Channels
- # asami (19)
- # babashka (41)
- # beginners (115)
- # biff (7)
- # calva (78)
- # clj-kondo (29)
- # cljs-dev (9)
- # clojure (39)
- # clojure-europe (17)
- # clojure-gamedev (29)
- # clojure-nl (1)
- # clojure-norway (9)
- # clojure-spec (2)
- # clojure-uk (3)
- # clojurescript (7)
- # core-async (26)
- # cursive (16)
- # datomic (13)
- # emacs (1)
- # events (5)
- # fulcro (2)
- # funcool (4)
- # gratitude (1)
- # helix (1)
- # holy-lambda (1)
- # humbleui (1)
- # introduce-yourself (4)
- # java (1)
- # jobs (2)
- # jobs-discuss (9)
- # lsp (28)
- # matcher-combinators (2)
- # mathematics (1)
- # membrane (1)
- # nbb (12)
- # off-topic (10)
- # pathom (52)
- # polylith (38)
- # portal (32)
- # re-frame (4)
- # reagent (16)
- # reitit (2)
- # remote-jobs (1)
- # reveal (1)
- # rewrite-clj (10)
- # sci (67)
- # shadow-cljs (45)
- # squint (1)
- # tools-build (13)
- # tools-deps (16)
I've been working on better support for alignment and stretch/row/column layouts. One design challenge I'm running into is:
(defui top [{}]
(column
{:rows [(halign {:child-pct 1 :parent-pct 0
:body (stretch-button {:text "Right to left (1 0)"})})
(halign {:child-pct 0.5 :parent-pct 0
:body (stretch-button {:text "Center to left (0.5 0)"})})
(halign {:child-pct 0.6 :parent-pct 0.2
:body (stretch-button {:text "Arbitrary (0.6 0.2)"})})]}))
The stretch-button
s are in the lexical scope of top
, but their container size is based on the column
component. It's fine that stretch-button
doesn't have an intrinsic size (that's the point after all), but we still want to make sure we can turn it into an immutable view that does have a definite size. The problem is very tractable, but still needs a bit more hammock time to find a good balance between easy of use and simplicity of implementation.