@@ -82,7 +82,9 @@ so it gets served as any other plain CSS file.
8282
8383If you prefer to use [Girouette](https://github.com/green-coder/girouette)
8484(Tailwind) utility classes (a.k.a. tokens), then you can do that as well, or you
85- can mix and match.
85+ can mix and match. Note that for compatibility reasons Ornament will continue to
86+ default to Tailwind v2 components, but you can opt-in to v3, see the section
87+ below.
8688
8789```clojure
8890(o/defstyled freebies-link :a
@@ -113,6 +115,32 @@ to explain Ornament's philosophy on how to deal with CSS, to give you accurate
113115expectations of how it will behave. This is especially relevant for
114116ClojureScript projects.
115117
118+ ## Choosing your Tailwind version
119+
120+ We rely on [Girouette](https://github.com/green-coder/girouette) to provide us
121+ with a re-implementation in Clojure of Tailwinds components, classes, and
122+ styles. At time of writing Girouette is compatible with either Tailwind 2.0.3,
123+ or 3.0.24.
124+
125+ To use Tailwind 3 tokens (classes), pass an extra `:tw-version 3` option to
126+ `set-tokens!`
127+
128+ ```clj
129+ (o/set-tokens! {:tw-version 3})
130+ ```
131+
132+ See " Customizing Girouette" below for more info on `set-tokens`, or check the
133+ docstring.
134+
135+ The `girouette.tw.preflight` namespace provides the Tailwind preflight (reset)
136+ stylesheet for either v2 or v3. If you are using `o/defined-styles` you can also
137+ opt to have it automatically prepended. This function also accepts a similar
138+ `:tw-version` argument (`2` or `3)
139+
140+ ```clj
141+ (o/defined-styles {:preflight? true :tw-version 3})
142+ ```
143+
116144## Choosing a Hiccup Implementation
117145
118146Representing HTML using nested Clojure vectors is an approach that was
@@ -754,7 +782,8 @@ style declarations.
754782- `:components`: sequence of Girouette components, each a map with `:id`
755783 (keyword ), `:rules` (string, instaparse, can be omitted), and `:garden` (map,
756784 or function taking instaparse results and returning Garden map)
757-
785+ - `:tw-version`: which Girouette defaults to use, either based on Tailwind
786+ v2, or v3. Valid values: `2 `, `3 `. Defaults to v2.
758787
759788```clojure
760789(o/set-tokens! {:colors {:primary " 001122" }
@@ -818,7 +847,7 @@ The end result is that we can do something like this:
818847
819848And get a bullet list which uses bear emojis for the bullets.
820849
821- `set-tokens` will add the new colors, fonts, and components to the defaults that
850+ `set-tokens! ` will add the new colors, fonts, and components to the defaults that
822851Girouette provides. You can change that by adding a `^:replace` tag (this uses
823852meta-merge). e.g. `{:colors ^:replace {...}}`)
824853
0 commit comments