Skip to content

Commit

Permalink
Auto-size row items but default to equal widths
Browse files Browse the repository at this point in the history
  • Loading branch information
philippamarkovics committed Jun 7, 2022
1 parent 03b68bb commit b75b3f2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions notebooks/viewers/grid.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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")))
Expand Down Expand Up @@ -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
;;
Expand Down
2 changes: 1 addition & 1 deletion resources/viewer-js-hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
PRHvRskwvvtt2Nh5jyPXLJqkcxJ
ibwzVnCiwbBpZifPB9T3bE5tbPe
3 changes: 1 addition & 2 deletions src/nextjournal/clerk/viewer.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit b75b3f2

Please sign in to comment.