|
103 | 103 | - `:fonts`: map from keyword to font stack (comman separated string) |
104 | 104 | - `:components`: sequence of Girouette components, each a map with |
105 | 105 | `:id` (keyword), `:rules` (string, instaparse, can be omitted), and |
106 | | - `:garden` (map, or function taking instaparse results and returning Garden |
107 | | - map) |
| 106 | + `:garden` (map, vector, or function; see below for details) |
108 | 107 | - `:tw-version`: which Girouette defaults to use, either based on Tailwind |
109 | 108 | v2, or v3. Valid values: 2, 3. |
110 | 109 |
|
111 | 110 | If `:rules` is omitted we assume this is a static token, and we'll |
112 | 111 | generate a rule of the form `token-id = <'token-id'>`. |
113 | 112 |
|
114 | 113 | `:garden` can be a function, in which case it receives a map with a |
115 | | - `:compoent-data` key containing the instaparse parse tree. Literal maps or |
| 114 | + `:component-data` key containing the instaparse parse tree. Literal maps or |
116 | 115 | vectors are wrapped in a function, in case the returned Garden is fixed. The |
117 | 116 | resulting Garden styles are processed again as in `defstyled`, so you can use |
118 | 117 | other Girouette or other tokens in there as well. Use `[:&]` for returning |
119 | | - multiple tokens/maps/stylesUse `[:&]` for returning multiple |
120 | | - tokens/maps/styles. |
| 118 | + multiple tokens/maps/styles. |
121 | 119 |
|
122 | 120 | By default these are added to the Girouette defaults, which are in terms |
123 | | - based on the Tailwind defaults. We still default to v2 (to avoid breaking |
124 | | - changes), but you can opt-in to Tailwind v3 by adding `:tw-version 3`. Use |
125 | | - meta-merge annotations (e.g. `{:colors ^:replace {...}}`) to change that |
126 | | - behaviour." |
| 121 | + based on the Tailwind defaults. Use meta-merge annotations (e.g. `{:colors |
| 122 | + ^:replace {...}}`) to change that behaviour. We still default to v2 (to |
| 123 | + avoid breaking changes), but you can opt-in to Tailwind v3 by adding |
| 124 | + `:tw-version 3`." |
127 | 125 | [{:keys [components colors fonts tw-version] |
128 | | - :or {tw-version 2}}] |
| 126 | + :or {tw-version 2} |
| 127 | + :as configuration}] |
129 | 128 | (let [{:keys [components colors fonts]} |
130 | 129 | (meta-merge/meta-merge |
131 | 130 | (case tw-version |
|
0 commit comments