All Projects → rgm → tailwind-hiccup

rgm / tailwind-hiccup

Licence: EPL-2.0 license
tailwindcss + hiccup = 👍👍

Programming Languages

clojure
4091 projects
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to tailwind-hiccup

re-frame-semantic-ui-react-github-widget
Using semantic-ui-react with re-frame - sample project
Stars: ✭ 21 (-38.24%)
Mutual labels:  reagent, re-frame
roll
RPG dice roller with both Rust CLI and ClojureScript Web interfaces
Stars: ✭ 14 (-58.82%)
Mutual labels:  reagent, re-frame
Re Frame
A ClojureScript framework for building user interfaces, leveraging React
Stars: ✭ 4,980 (+14547.06%)
Mutual labels:  reagent, re-frame
re-frame-realword-example-app
Exemplary real world application built with Clojurescript and re-frame
Stars: ✭ 16 (-52.94%)
Mutual labels:  reagent, re-frame
Gorilla Notebook
A clojure/clojurescript notebook application/-library based on Gorilla-REPL
Stars: ✭ 73 (+114.71%)
Mutual labels:  reagent, re-frame
Re Frame 10x
A debugging dashboard for re-frame. X-ray vision as tooling.
Stars: ✭ 491 (+1344.12%)
Mutual labels:  reagent, re-frame
learn-re-frame-course-files
🎦 Learn re-frame course files for building Cheffy app
Stars: ✭ 51 (+50%)
Mutual labels:  reagent, re-frame
Conduit
Real world application built with ClojureScript + re-frame
Stars: ✭ 422 (+1141.18%)
Mutual labels:  reagent, re-frame
Re Pollsive
Re-pollsive is a clojurescript library that handles polling events for re-frame applications
Stars: ✭ 27 (-20.59%)
Mutual labels:  reagent, re-frame
Tincture
Frontend development toolkit for ClojureScript
Stars: ✭ 24 (-29.41%)
Mutual labels:  reagent, re-frame
breaking-point
BREAKING-POINT lets you quickly define and subscribe to screen (i.e. window) breakpoints in your re-frame application
Stars: ✭ 36 (+5.88%)
Mutual labels:  reagent, re-frame
rn-shadow-steroid
React Native with shadow-cljs on steroids
Stars: ✭ 57 (+67.65%)
Mutual labels:  reagent, re-frame
Re Frame Template
A Leiningen template for creating a re-frame application (client only)
Stars: ✭ 454 (+1235.29%)
Mutual labels:  reagent, re-frame
compound
A micro structure for reframe data
Stars: ✭ 116 (+241.18%)
Mutual labels:  reagent, re-frame
Reagent
The idea and some of the code for making components atom-like comes from pump. The reactive-atom idea (and some code) comes from reflex.
Stars: ✭ 4,344 (+12676.47%)
Mutual labels:  reagent, hiccup
Cljfx
Declarative, functional and extensible wrapper of JavaFX inspired by better parts of react and re-frame
Stars: ✭ 624 (+1735.29%)
Mutual labels:  reagent, re-frame
Lein template descjop
A Leiningen template(Clojure/ClojureScript Project) for Web based desktop application with Electron (atom-shell).
Stars: ✭ 394 (+1058.82%)
Mutual labels:  reagent, re-frame
Re Frisk
Take full control of re-frame app
Stars: ✭ 396 (+1064.71%)
Mutual labels:  reagent, re-frame
Re Com
A ClojureScript library of reusable components for Reagent
Stars: ✭ 690 (+1929.41%)
Mutual labels:  reagent, re-frame
Ventas
Clojure ecommerce platform
Stars: ✭ 114 (+235.29%)
Mutual labels:  reagent, re-frame

Clojars Project

tailwind-hiccup

tailwindcss + hiccup = 👍👍.

Rationale

By its nature, a functional/atomic/utility class approach to CSS like Tailwindcss turns out to be pretty pleasant to use with Hiccup-based ClojureScript front-ends like Reagent or Rum, or server-side Hiccup templates.

Styling becomes a matter of composing from a standard library of utility classes. Since they're just data, we can keep them in collections, give them names, conj them together, etc.

Better still on the front-end side: the dead-JavaScript-elimination available through advanced ClojureScript compilation sets up for impressive dead-CSS- elimination performance from PurgeCSS. Any Tailwind class name strings present in unused components will have been dropped from the JS bundle along with the component, so the Google Closure compiler is doing most of the work of figuring out which components could ever be used at runtime.

Getting started

Add tailwind-hiccup as a dependency, eg. for tools.deps projects

;; deps.edn
{:paths [,,,]
 :deps {,,, rgm/tailwind-hiccup {:mvn/version "0.2.0"} ,,,}

Setting up the css build can be a little complex. See the basic usage example.

API

Inspired by stylefy.core/use-style, this library provides a function tw that gives a easy-to-spot way to snap together collections of utility classes in Hiccup props:

(require '[tailwind-hiccup.core :refer [tw]]

(def color-transition [:transition-colors :ease-in-out])
(def short-duration [:duration-300])
(def hover-colors ["hover:text-white" "hover:bg-red-500"])

(defn MyButton
  [button-text]
  [:button.a-non-tw-class
   (tw [:mx-3 :my-4 :font-bold]
       hover-colors
       color-transition short-duration
       {:on-click #(js/alert "surprise!")})
   button-text])
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].