garden

Accordions out of the box with Clojurescript and Closure

Accordions are actually available out-of-the-box in Clojurescript with the included Google closure.js that Clojurescript is built upon. This code shows the AnimatedZippy, which has a nice slide-out function; there’s also a plain Zippy. They are drop-in replacements for eachother. Rendering the Accordion (Zippy) (ns toryanderson.views.components.shared "Shared components that may be used on multiple views" (:require [reagent.core :as r] [goog.dom :as dom] [goog.string :as gstr]) (:import goog.ui.AnimatedZippy)) (defn accordion [{:keys [header-text content-body]}] (let [header-id (gstr/createUniqueString) content-id (gstr/createUniqueString)] (r/create-class {:display-name "zippy" :reagent-render (fn [id] [:div.

My Garden CSS has ascended

I’ve been continually seeking the answer to Garden CSS’s title question: “what’s possible when you trade a preprocessor for a programming language?” I have used Garden exclusively for years, happily wielding garden-gnome to implement hot-loading on my front-end for an excellent development experience. Writing CSS with Clojure data-structures is a hands-down win over raw css-writing, and Garden also gives useful shortcuts that some of the preprocessors also have like lighten, darken, & selectors, and more.