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