From b75b3f23081d499a764f258ad40e45e965ac83f2 Mon Sep 17 00:00:00 2001 From: Philippa Markovics Date: Tue, 7 Jun 2022 10:16:26 +0200 Subject: [PATCH] Auto-size row items but default to equal widths --- notebooks/viewers/grid.clj | 5 ++--- resources/viewer-js-hash | 2 +- src/nextjournal/clerk/viewer.cljc | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/notebooks/viewers/grid.clj b/notebooks/viewers/grid.clj index 0da292308..b3c39f7eb 100644 --- a/notebooks/viewers/grid.clj +++ b/notebooks/viewers/grid.clj @@ -11,7 +11,7 @@ ;; will assign them on the row or col that contains your items. You can use ;; this to size your containers accordingly. -#(v/row +(v/row (ImageIO/read (URL. "https://etc.usf.edu/clippix/pix/allure-of-an-antique-empire_medium.jpg")) (ImageIO/read (URL. "https://etc.usf.edu/clippix/pix/allegorical-symbol-for-the-emperos-victories-and-conquests_medium.jpg")) (ImageIO/read (URL. "https://etc.usf.edu/clippix/pix/emperor-hadrian-getting-ready-for-a-day-of-hunting_medium.jpg"))) @@ -54,8 +54,7 @@ (ImageIO/read (URL. "https://etc.usf.edu/clippix/pix/emperor-hadrian-getting-ready-for-a-day-of-hunting_medium.jpg")) (ImageIO/read (URL. "https://etc.usf.edu/clippix/pix/fregio-ingressus_medium.jpg"))) (v/col - (ImageIO/read (URL. "https://etc.usf.edu/clippix/pix/fregio-profectio_medium.jpg")) - (ImageIO/read (URL. "https://etc.usf.edu/clippix/pix/fourth-fregio-of-trajan_medium.jpg")))) + (ImageIO/read (URL. "https://etc.usf.edu/clippix/pix/fregio-profectio_medium.jpg")))) ;; ## Alternative notations ;; diff --git a/resources/viewer-js-hash b/resources/viewer-js-hash index 8ee2ab0ce..97dfaaa09 100644 --- a/resources/viewer-js-hash +++ b/resources/viewer-js-hash @@ -1 +1 @@ -PRHvRskwvvtt2Nh5jyPXLJqkcxJ \ No newline at end of file +ibwzVnCiwbBpZifPB9T3bE5tbPe \ No newline at end of file diff --git a/src/nextjournal/clerk/viewer.cljc b/src/nextjournal/clerk/viewer.cljc index 27cce772b..fce88ef7a 100644 --- a/src/nextjournal/clerk/viewer.cljc +++ b/src/nextjournal/clerk/viewer.cljc @@ -568,8 +568,7 @@ (v/html (into [:div {:class "md:flex md:flex-row md:gap-4 not-prose" :style opts}] (map (fn [item] - [:div.flex.items-center.justify-center - {:class (str "md:w-[" (* 100 (float (/ 1 item-count))) "%]")} + [:div.flex.items-center.justify-center.flex-auto (v/inspect opts item)])) items))))} {:name :col :render-fn '(fn [items opts] (v/html (into [:div {:class "md:flex md:flex-col md:gap-4 clerk-grid not-prose"