clerk

Eric Dvorsak 2025-04-18T20:21:22.433299Z

Is there a way to makes change viewer.css without forking the repo? eg I really want to overwrite:

.max-w-prose { @apply max-w-[46rem] !important; }
.max-w-wide  { @apply max-w-5xl !important; }
to utilize the screen width more. I tried both :nextjournal.clerk/css-class and :nextjournal.clerk/width but it only applies to some viewers and not the whole page, and not the markdown in the comments for instance, so the whole page looks like the attached picture (note how for the table it's great but for eg long results it overflows and cannot be scrolled

mkvlr 2025-04-20T19:09:27.065029Z

@yenda1 you can provide your own viewer css like so

(swap! nextjournal.clerk.config/!resource->url assoc "/css/viewer.css" "")

mkvlr 2025-04-20T19:11:05.353399Z

but if you’re interested in customizing clerk’s default view, check out how https://github.com/nextjournal/clerk-slideshow/ does it

mkvlr 2025-04-20T19:17:21.184709Z

or actually, I should ask what you’re trying to do first

mkvlr 2025-04-20T19:17:27.188839Z

you want everything full-width?

mkvlr 2025-04-20T19:21:10.013179Z

;; # Controlling Width ↔️
(ns full-width
  {:nextjournal.clerk/width :full
   :nextjournal.clerk/page-size 50}
  (:require [nextjournal.clerk :as clerk]))

;; By default, most results are rendered at `:prose` width.
(range 100)

;; ## Words
(def letter->words
  (->> (slurp "/usr/share/dict/words")
       clojure.string/split-lines
       (group-by (comp keyword clojure.string/upper-case str first))
       (into (sorted-map))))

(clerk/table {::clerk/width :full} letter->words)

mkvlr 2025-04-20T19:21:28.988229Z

setting {:nextjournal.clerk/width :full} in the ns metadata makes all results full-width

mkvlr 2025-04-20T19:22:41.464399Z

if you want the prose viewer to be full-width and the code-viewer, you can also override those

mkvlr 2025-04-18T21:29:03.407879Z

you can override viewer.css without forking, I’ll try to send an example probably tomorrow

Eric Dvorsak 2025-04-18T22:11:30.677189Z

thanks!