rizzo-css 0.0.12 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/.env.example +12 -0
  2. package/LICENSE +21 -0
  3. package/README.md +17 -3
  4. package/bin/rizzo-css.js +166 -85
  5. package/package.json +5 -3
  6. package/scaffold/astro/ThemeSwitcher.astro +504 -0
  7. package/scaffold/astro/themes.ts +54 -0
  8. package/scaffold/astro-app/README.md +13 -2
  9. package/scaffold/astro-app/src/components/Accordion.astro +178 -0
  10. package/scaffold/astro-app/src/components/Alert.astro +131 -0
  11. package/scaffold/astro-app/src/components/Avatar.astro +59 -0
  12. package/scaffold/astro-app/src/components/Badge.astro +24 -0
  13. package/scaffold/astro-app/src/components/Breadcrumb.astro +61 -0
  14. package/scaffold/astro-app/src/components/Button.astro +3 -0
  15. package/scaffold/astro-app/src/components/Card.astro +18 -0
  16. package/scaffold/astro-app/src/components/Checkbox.astro +38 -0
  17. package/scaffold/astro-app/src/components/CodeBlock.astro +393 -0
  18. package/scaffold/astro-app/src/components/CopyToClipboard.astro +219 -0
  19. package/scaffold/astro-app/src/components/Divider.astro +37 -0
  20. package/scaffold/astro-app/src/components/Dropdown.astro +807 -0
  21. package/scaffold/astro-app/src/components/FormGroup.astro +59 -0
  22. package/scaffold/astro-app/src/components/FrameworkSwitcher.astro +72 -0
  23. package/scaffold/astro-app/src/components/Input.astro +59 -0
  24. package/scaffold/astro-app/src/components/Modal.astro +212 -0
  25. package/scaffold/astro-app/src/components/Navbar.astro +701 -0
  26. package/scaffold/astro-app/src/components/Pagination.astro +240 -0
  27. package/scaffold/astro-app/src/components/ProgressBar.astro +65 -0
  28. package/scaffold/astro-app/src/components/Radio.astro +38 -0
  29. package/scaffold/astro-app/src/components/Search.astro +1259 -0
  30. package/scaffold/astro-app/src/components/Select.astro +49 -0
  31. package/scaffold/astro-app/src/components/Settings.astro +382 -0
  32. package/scaffold/astro-app/src/components/Spinner.astro +30 -0
  33. package/scaffold/astro-app/src/components/Table.astro +181 -0
  34. package/scaffold/astro-app/src/components/Tabs.astro +223 -0
  35. package/scaffold/astro-app/src/components/Textarea.astro +58 -0
  36. package/scaffold/astro-app/src/components/ThemeSwitcher.astro +504 -0
  37. package/scaffold/astro-app/src/components/Toast.astro +30 -0
  38. package/scaffold/astro-app/src/components/Tooltip.astro +32 -0
  39. package/scaffold/astro-app/src/components/icons/Brush.astro +10 -0
  40. package/scaffold/astro-app/src/components/icons/Cake.astro +11 -0
  41. package/scaffold/astro-app/src/components/icons/Check.astro +29 -0
  42. package/scaffold/astro-app/src/components/icons/Cherry.astro +11 -0
  43. package/scaffold/astro-app/src/components/icons/ChevronDown.astro +29 -0
  44. package/scaffold/astro-app/src/components/icons/Circle.astro +29 -0
  45. package/scaffold/astro-app/src/components/icons/Close.astro +30 -0
  46. package/scaffold/astro-app/src/components/icons/Cmd.astro +26 -0
  47. package/scaffold/astro-app/src/components/icons/Copy.astro +30 -0
  48. package/scaffold/astro-app/src/components/icons/Eye.astro +30 -0
  49. package/scaffold/astro-app/src/components/icons/Filter.astro +29 -0
  50. package/scaffold/astro-app/src/components/icons/Flame.astro +28 -0
  51. package/scaffold/astro-app/src/components/icons/Flower.astro +11 -0
  52. package/scaffold/astro-app/src/components/icons/Gear.astro +30 -0
  53. package/scaffold/astro-app/src/components/icons/Heart.astro +28 -0
  54. package/scaffold/astro-app/src/components/icons/IceCream.astro +31 -0
  55. package/scaffold/astro-app/src/components/icons/Leaf.astro +29 -0
  56. package/scaffold/astro-app/src/components/icons/Lemon.astro +11 -0
  57. package/scaffold/astro-app/src/components/icons/Moon.astro +29 -0
  58. package/scaffold/astro-app/src/components/icons/Owl.astro +34 -0
  59. package/scaffold/astro-app/src/components/icons/Palette.astro +33 -0
  60. package/scaffold/astro-app/src/components/icons/Rainbow.astro +31 -0
  61. package/scaffold/astro-app/src/components/icons/Search.astro +30 -0
  62. package/scaffold/astro-app/src/components/icons/Shield.astro +28 -0
  63. package/scaffold/astro-app/src/components/icons/Snowflake.astro +34 -0
  64. package/scaffold/astro-app/src/components/icons/Sort.astro +30 -0
  65. package/scaffold/astro-app/src/components/icons/Sun.astro +29 -0
  66. package/scaffold/astro-app/src/components/icons/Sunset.astro +10 -0
  67. package/scaffold/astro-app/src/components/icons/Zap.astro +9 -0
  68. package/scaffold/astro-app/src/components/icons/devicons/Astro.astro +53 -0
  69. package/scaffold/astro-app/src/components/icons/devicons/Bash.astro +34 -0
  70. package/scaffold/astro-app/src/components/icons/devicons/Css3.astro +29 -0
  71. package/scaffold/astro-app/src/components/icons/devicons/Git.astro +24 -0
  72. package/scaffold/astro-app/src/components/icons/devicons/Html5.astro +27 -0
  73. package/scaffold/astro-app/src/components/icons/devicons/Javascript.astro +25 -0
  74. package/scaffold/astro-app/src/components/icons/devicons/Nodejs.astro +47 -0
  75. package/scaffold/astro-app/src/components/icons/devicons/Plaintext.astro +33 -0
  76. package/scaffold/astro-app/src/components/icons/devicons/React.astro +27 -0
  77. package/scaffold/astro-app/src/components/icons/devicons/Svelte.astro +25 -0
  78. package/scaffold/astro-app/src/components/icons/devicons/Vue.astro +26 -0
  79. package/scaffold/astro-app/src/config/frameworks.ts +26 -0
  80. package/scaffold/astro-app/src/config/themes.ts +54 -0
  81. package/scaffold/astro-app/src/layouts/DocsLayout.astro +204 -0
  82. package/scaffold/astro-app/src/layouts/Layout.astro +11 -2
  83. package/scaffold/astro-app/src/pages/components/accordion.astro +172 -0
  84. package/scaffold/astro-app/src/pages/components/alert.astro +250 -0
  85. package/scaffold/astro-app/src/pages/components/avatar.astro +102 -0
  86. package/scaffold/astro-app/src/pages/components/badge.astro +119 -0
  87. package/scaffold/astro-app/src/pages/components/breadcrumb.astro +124 -0
  88. package/scaffold/astro-app/src/pages/components/button.astro +74 -0
  89. package/scaffold/astro-app/src/pages/components/cards.astro +247 -0
  90. package/scaffold/astro-app/src/pages/components/copy-to-clipboard.astro +49 -0
  91. package/scaffold/astro-app/src/pages/components/divider.astro +74 -0
  92. package/scaffold/astro-app/src/pages/components/dropdown.astro +394 -0
  93. package/scaffold/astro-app/src/pages/components/forms.astro +367 -0
  94. package/scaffold/astro-app/src/pages/components/icons.astro +246 -0
  95. package/scaffold/astro-app/src/pages/components/modal.astro +152 -0
  96. package/scaffold/astro-app/src/pages/components/navbar.astro +80 -0
  97. package/scaffold/astro-app/src/pages/components/pagination.astro +126 -0
  98. package/scaffold/astro-app/src/pages/components/progress-bar.astro +94 -0
  99. package/scaffold/astro-app/src/pages/components/search.astro +155 -0
  100. package/scaffold/astro-app/src/pages/components/settings.astro +78 -0
  101. package/scaffold/astro-app/src/pages/components/spinner.astro +81 -0
  102. package/scaffold/astro-app/src/pages/components/table.astro +144 -0
  103. package/scaffold/astro-app/src/pages/components/tabs.astro +220 -0
  104. package/scaffold/astro-app/src/pages/components/theme-switcher.astro +67 -0
  105. package/scaffold/astro-app/src/pages/components/toast.astro +157 -0
  106. package/scaffold/astro-app/src/pages/components/tooltip.astro +209 -0
  107. package/scaffold/astro-app/src/pages/components.astro +290 -0
  108. package/scaffold/astro-app/src/pages/docs/accessibility.astro +9 -0
  109. package/scaffold/astro-app/src/pages/docs/colors.astro +9 -0
  110. package/scaffold/astro-app/src/pages/docs/design-system.astro +9 -0
  111. package/scaffold/astro-app/src/pages/docs/getting-started.astro +9 -0
  112. package/scaffold/astro-app/src/pages/docs/index.astro +15 -0
  113. package/scaffold/astro-app/src/pages/docs/themes/[theme].astro +14 -0
  114. package/scaffold/astro-app/src/pages/docs/theming.astro +10 -0
  115. package/scaffold/astro-app/src/pages/index.astro +5 -11
  116. package/scaffold/svelte/ThemeSwitcher.svelte +315 -0
  117. package/scaffold/svelte/theme.ts +65 -0
  118. package/scaffold/svelte/themes.ts +54 -0
  119. package/scaffold/svelte-app/README.md +9 -2
  120. package/scaffold/svelte-app/src/app.html +1 -1
  121. package/scaffold/svelte-app/src/lib/rizzo/Accordion.svelte +128 -0
  122. package/scaffold/svelte-app/src/lib/rizzo/Alert.svelte +85 -0
  123. package/scaffold/svelte-app/src/lib/rizzo/Avatar.svelte +39 -0
  124. package/scaffold/svelte-app/src/lib/rizzo/Badge.svelte +31 -0
  125. package/scaffold/svelte-app/src/lib/rizzo/Breadcrumb.svelte +49 -0
  126. package/scaffold/svelte-app/src/lib/rizzo/Button.svelte +27 -0
  127. package/scaffold/svelte-app/src/lib/rizzo/Card.svelte +17 -0
  128. package/scaffold/svelte-app/src/lib/rizzo/Checkbox.svelte +37 -0
  129. package/scaffold/svelte-app/src/lib/rizzo/CopyToClipboard.svelte +79 -0
  130. package/scaffold/svelte-app/src/lib/rizzo/Divider.svelte +28 -0
  131. package/scaffold/svelte-app/src/lib/rizzo/Dropdown.svelte +254 -0
  132. package/scaffold/svelte-app/src/lib/rizzo/FormGroup.svelte +51 -0
  133. package/scaffold/svelte-app/src/lib/rizzo/Input.svelte +59 -0
  134. package/scaffold/svelte-app/src/lib/rizzo/Modal.svelte +157 -0
  135. package/scaffold/svelte-app/src/lib/rizzo/Pagination.svelte +93 -0
  136. package/scaffold/svelte-app/src/lib/rizzo/ProgressBar.svelte +58 -0
  137. package/scaffold/svelte-app/src/lib/rizzo/Radio.svelte +38 -0
  138. package/scaffold/svelte-app/src/lib/rizzo/Select.svelte +51 -0
  139. package/scaffold/svelte-app/src/lib/rizzo/Spinner.svelte +14 -0
  140. package/scaffold/svelte-app/src/lib/rizzo/Table.svelte +158 -0
  141. package/scaffold/svelte-app/src/lib/rizzo/Tabs.svelte +117 -0
  142. package/scaffold/svelte-app/src/lib/rizzo/Textarea.svelte +59 -0
  143. package/scaffold/svelte-app/src/lib/rizzo/ThemeSwitcher.svelte +315 -0
  144. package/scaffold/svelte-app/src/lib/rizzo/Toast.svelte +33 -0
  145. package/scaffold/svelte-app/src/lib/rizzo/Tooltip.svelte +19 -0
  146. package/scaffold/svelte-app/src/lib/rizzo/icons/Check.svelte +29 -0
  147. package/scaffold/svelte-app/src/lib/rizzo/icons/ChevronDown.svelte +29 -0
  148. package/scaffold/svelte-app/src/lib/rizzo/icons/Circle.svelte +29 -0
  149. package/scaffold/svelte-app/src/lib/rizzo/icons/Close.svelte +30 -0
  150. package/scaffold/svelte-app/src/lib/rizzo/icons/Cmd.svelte +27 -0
  151. package/scaffold/svelte-app/src/lib/rizzo/icons/Copy.svelte +30 -0
  152. package/scaffold/svelte-app/src/lib/rizzo/icons/Eye.svelte +30 -0
  153. package/scaffold/svelte-app/src/lib/rizzo/icons/Filter.svelte +29 -0
  154. package/scaffold/svelte-app/src/lib/rizzo/icons/Gear.svelte +30 -0
  155. package/scaffold/svelte-app/src/lib/rizzo/icons/IceCream.svelte +31 -0
  156. package/scaffold/svelte-app/src/lib/rizzo/icons/Moon.svelte +29 -0
  157. package/scaffold/svelte-app/src/lib/rizzo/icons/Owl.svelte +34 -0
  158. package/scaffold/svelte-app/src/lib/rizzo/icons/Palette.svelte +33 -0
  159. package/scaffold/svelte-app/src/lib/rizzo/icons/Rainbow.svelte +31 -0
  160. package/scaffold/svelte-app/src/lib/rizzo/icons/Search.svelte +30 -0
  161. package/scaffold/svelte-app/src/lib/rizzo/icons/Snowflake.svelte +34 -0
  162. package/scaffold/svelte-app/src/lib/rizzo/icons/Sort.svelte +30 -0
  163. package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/Astro.svelte +45 -0
  164. package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/Bash.svelte +28 -0
  165. package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/Css3.svelte +23 -0
  166. package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/Git.svelte +18 -0
  167. package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/Html5.svelte +21 -0
  168. package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/Javascript.svelte +19 -0
  169. package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/Nodejs.svelte +44 -0
  170. package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/Plaintext.svelte +24 -0
  171. package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/React.svelte +21 -0
  172. package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/SvelteIcon.svelte +19 -0
  173. package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/Vue.svelte +20 -0
  174. package/scaffold/svelte-app/src/lib/rizzo/index.ts +33 -0
  175. package/scaffold/svelte-app/src/lib/rizzo-docs/CodeBlock.svelte +239 -0
  176. package/scaffold/svelte-app/src/lib/rizzo-docs/SvelteDocPage.svelte +99 -0
  177. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/AccordionDoc.svelte +53 -0
  178. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/AlertDoc.svelte +114 -0
  179. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/AvatarDoc.svelte +92 -0
  180. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/BadgeDoc.svelte +60 -0
  181. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/BreadcrumbDoc.svelte +55 -0
  182. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/ButtonDoc.svelte +55 -0
  183. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/CardsDoc.svelte +173 -0
  184. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/ComingSoon.svelte +12 -0
  185. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/ComponentsOverview.svelte +92 -0
  186. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/CopyToClipboardDoc.svelte +26 -0
  187. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/DividerDoc.svelte +105 -0
  188. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/DropdownDoc.svelte +161 -0
  189. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/FormsDoc.svelte +375 -0
  190. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/IconsDoc.svelte +246 -0
  191. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/Index.svelte +8 -0
  192. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/ModalDoc.svelte +50 -0
  193. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/NavbarDoc.svelte +79 -0
  194. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/PaginationDoc.svelte +44 -0
  195. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/ProgressBarDoc.svelte +95 -0
  196. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/SearchDoc.svelte +147 -0
  197. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/SettingsDoc.svelte +158 -0
  198. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/SpinnerDoc.svelte +41 -0
  199. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/TableDoc.svelte +116 -0
  200. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/TabsDoc.svelte +152 -0
  201. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/ThemeSwitcherDoc.svelte +181 -0
  202. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/Theming.svelte +6 -0
  203. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/ToastDoc.svelte +136 -0
  204. package/scaffold/svelte-app/src/lib/rizzo-docs/pages/TooltipDoc.svelte +57 -0
  205. package/scaffold/svelte-app/src/routes/+page.svelte +2 -2
  206. package/scaffold/svelte-app/src/routes/components/+page.svelte +4 -0
  207. package/scaffold/svelte-app/src/routes/components/[slug]/+page.svelte +7 -0
  208. package/scaffold/vanilla/README.md +11 -4
  209. package/scaffold/vanilla/components/accordion.html +193 -0
  210. package/scaffold/vanilla/components/alert.html +193 -0
  211. package/scaffold/vanilla/components/avatar.html +193 -0
  212. package/scaffold/vanilla/components/badge.html +193 -0
  213. package/scaffold/vanilla/components/breadcrumb.html +193 -0
  214. package/scaffold/vanilla/components/button.html +193 -0
  215. package/scaffold/vanilla/components/cards.html +193 -0
  216. package/scaffold/vanilla/components/copy-to-clipboard.html +193 -0
  217. package/scaffold/vanilla/components/divider.html +193 -0
  218. package/scaffold/vanilla/components/dropdown.html +193 -0
  219. package/scaffold/vanilla/components/forms.html +193 -0
  220. package/scaffold/vanilla/components/icons.html +193 -0
  221. package/scaffold/vanilla/components/index.html +218 -0
  222. package/scaffold/vanilla/components/modal.html +193 -0
  223. package/scaffold/vanilla/components/navbar.html +193 -0
  224. package/scaffold/vanilla/components/pagination.html +193 -0
  225. package/scaffold/vanilla/components/progress-bar.html +193 -0
  226. package/scaffold/vanilla/components/search.html +193 -0
  227. package/scaffold/vanilla/components/settings.html +193 -0
  228. package/scaffold/vanilla/components/spinner.html +193 -0
  229. package/scaffold/vanilla/components/table.html +193 -0
  230. package/scaffold/vanilla/components/tabs.html +193 -0
  231. package/scaffold/vanilla/components/theme-switcher.html +193 -0
  232. package/scaffold/vanilla/components/toast.html +193 -0
  233. package/scaffold/vanilla/components/tooltip.html +193 -0
  234. package/scaffold/vanilla/index.html +22 -6
  235. package/scaffold/vanilla/js/main.js +4 -3
package/.env.example ADDED
@@ -0,0 +1,12 @@
1
+ # Optional: used only if you add search (e.g. Algolia) to a scaffold-based project
2
+ # Copy to .env in your project and replace with your own values
3
+
4
+ # Public (client-side) — safe to expose in the browser
5
+ PUBLIC_ALGOLIA_APP_ID=your-algolia-app-id
6
+ PUBLIC_ALGOLIA_SEARCH_KEY=your-search-only-api-key
7
+ PUBLIC_ALGOLIA_INDEX_NAME=your-index-name
8
+
9
+ # Private (server-side only) — do not commit or expose
10
+ ALGOLIA_APP_ID=your-algolia-app-id
11
+ ALGOLIA_ADMIN_KEY=your-admin-api-key
12
+ ALGOLIA_INDEX_NAME=your-index-name
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 mingleusa
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -12,7 +12,7 @@ pnpm add rizzo-css
12
12
  yarn add rizzo-css
13
13
  ```
14
14
 
15
- **Quick start (no install):** `npx rizzo-css init` — first choose **add to existing project** or **create new**. Existing: framework (auto-detect), themes, optional components. New: scaffold (Vanilla example, default Astro app, or default Svelte app; CLI colors: Vanilla = yellow, Astro = orange, Svelte = orange-red). All get the **same CSS and component styles**. To use the **official Svelte or Astro scaffold** plus Rizzo CSS, create the app with their CLI first, then run `npx rizzo-css add`:
15
+ **Quick start (no install):** `npx rizzo-css init` — choose **framework** (Vanilla, Astro, or Svelte), then **add to existing** or **create new**. For Astro/Svelte: **What to include?** CSS only, Recommended set, All (25 components), or Pick. Add to existing: you must add the stylesheet `<link>` yourself (CLI prints the exact tag). New: full scaffold. All get the **same CSS and component styles**. To use the **official Svelte or Astro scaffold** plus Rizzo CSS, create the app with their CLI first, then run `npx rizzo-css add`:
16
16
 
17
17
  ```bash
18
18
  npm create svelte@latest my-app && cd my-app && npx rizzo-css add
@@ -31,7 +31,17 @@ You install **the same package** for every framework: `npm install rizzo-css`. N
31
31
  | **Astro** | `npm install rizzo-css` | `import 'rizzo-css'` in layout or link from `public/` | Copy components from `node_modules/rizzo-css/scaffold/astro/` or use `npx rizzo-css add` with components |
32
32
  | **Svelte** | `npm install rizzo-css` | `import 'rizzo-css'` in root layout or link from `static/` | Copy components from `node_modules/rizzo-css/scaffold/svelte/` or use `npx rizzo-css add` with components |
33
33
 
34
- Scaffolds (full starter apps) are in the package: `scaffold/vanilla/`, `scaffold/astro-app/`, `scaffold/svelte-app/`. Use `npx rizzo-css init` and choose “Create new” to generate a project from one of them; each scaffold folder has a README with setup and commands.
34
+ **CSS paths (CLI and scaffolds):**
35
+
36
+ | Framework | Where the CLI copies CSS | `<link href="...">` in your HTML/layout |
37
+ |-----------|-------------------------|----------------------------------------|
38
+ | **Vanilla** | `css/rizzo.min.css` (project root) | `css/rizzo.min.css` (relative) |
39
+ | **Astro** | `public/css/rizzo.min.css` | `/css/rizzo.min.css` (Astro serves `public/` at `/`) |
40
+ | **Svelte** | `static/css/rizzo.min.css` | `/css/rizzo.min.css` (SvelteKit serves `static/` at `/`) |
41
+
42
+ With `npx rizzo-css add --path <dir>`, the CLI still suggests the correct href for your framework (e.g. Astro/Svelte get a leading `/` path).
43
+
44
+ Scaffolds (full starter apps) are in the package: `scaffold/vanilla/`, `scaffold/astro-app/`, `scaffold/svelte-app/`. Use `npx rizzo-css init` and choose **Create new project** to get the full clone (navbar/chrome + component showcase) for the chosen framework; the stylesheet link is already in the layout. **Add to existing** only adds the CSS and optional components (no full scaffold); **you must add the stylesheet `<link>` to your layout yourself** — the CLI prints the exact tag for your framework (e.g. Svelte/Astro: `/css/rizzo.min.css`; Vanilla: `css/rizzo.min.css`). Each scaffold folder has a README with setup and instructions for editing the cloned site.
35
45
 
36
46
  ## Use
37
47
 
@@ -46,7 +56,7 @@ import 'rizzo-css';
46
56
  **Without a bundler (plain HTML):** Use a CDN. Both unpkg and jsDelivr resolve the package root to the built CSS (via the `unpkg` / `jsdelivr` fields in this package). For reliability or to pin a version, use the explicit path:
47
57
 
48
58
  ```html
49
- <!-- unpkg (pin version: replace @latest with @0.0.12 or any version) -->
59
+ <!-- unpkg (pin version: replace @latest with @0.0.14 or any version) -->
50
60
  <link rel="stylesheet" href="https://unpkg.com/rizzo-css@latest/dist/rizzo.min.css" />
51
61
 
52
62
  <!-- or jsDelivr -->
@@ -71,6 +81,10 @@ Theme IDs and full docs: [Theming](https://rizzo-css.vercel.app/docs/theming).
71
81
 
72
82
  Full documentation: **[rizzo-css.vercel.app](https://rizzo-css.vercel.app)** — Getting Started, Components, Themes, and usage for Vanilla, Astro, and Svelte.
73
83
 
84
+ ## Package contents
85
+
86
+ In addition to `dist/`, `bin/`, and `scaffold/`, the package includes **LICENSE** (MIT) and **.env.example** (optional; for projects that add search, e.g. Algolia — copy to `.env` and set your own values).
87
+
74
88
  ## License
75
89
 
76
90
  MIT
package/bin/rizzo-css.js CHANGED
@@ -6,15 +6,18 @@ const readline = require('readline');
6
6
 
7
7
  const COMMANDS = ['init', 'add', 'theme', 'help'];
8
8
  const FRAMEWORKS = ['vanilla', 'astro', 'svelte'];
9
- const THEMES = [
9
+ // Dark and light themes (order matches scaffold optgroups and config/themes.ts)
10
+ const DARK_THEMES = [
10
11
  'github-dark-classic',
11
- 'github-light',
12
12
  'shades-of-purple',
13
13
  'sandstorm-classic',
14
14
  'rocky-blood-orange',
15
15
  'minimal-dark-neon-yellow',
16
16
  'hack-the-box',
17
17
  'pink-cat-boo',
18
+ ];
19
+ const LIGHT_THEMES = [
20
+ 'github-light',
18
21
  'red-velvet-cupcake',
19
22
  'orangy-one-light',
20
23
  'sunflower',
@@ -22,18 +25,24 @@ const THEMES = [
22
25
  'cute-pink',
23
26
  'semi-light-purple',
24
27
  ];
28
+ const THEMES = [...DARK_THEMES, ...LIGHT_THEMES];
25
29
  // Components available for scaffold (must match scaffold/svelte and scaffold/astro)
26
30
  const SVELTE_COMPONENTS = [
27
31
  'Button', 'Badge', 'Card', 'Divider', 'Spinner', 'ProgressBar', 'Avatar', 'Alert',
28
32
  'Breadcrumb', 'FormGroup', 'Input', 'Checkbox', 'Textarea', 'Select', 'Radio',
29
33
  'CopyToClipboard', 'Tooltip', 'Pagination', 'Tabs', 'Accordion', 'Dropdown',
30
- 'Modal', 'Toast', 'Table',
34
+ 'Modal', 'Toast', 'Table', 'ThemeSwitcher',
31
35
  ];
32
36
  const ASTRO_COMPONENTS = [
33
37
  'Button', 'Badge', 'Card', 'Divider', 'Spinner', 'ProgressBar', 'Avatar', 'Alert',
34
38
  'Breadcrumb', 'FormGroup', 'Input', 'Checkbox', 'Textarea', 'Select', 'Radio',
35
39
  'CopyToClipboard', 'Tooltip', 'Pagination', 'Tabs', 'Accordion', 'Dropdown',
36
- 'Modal', 'Toast', 'Table',
40
+ 'Modal', 'Toast', 'Table', 'ThemeSwitcher',
41
+ ];
42
+
43
+ // Recommended subset for "Recommended set" option (keeps CLI simple; power users can pick)
44
+ const RECOMMENDED_COMPONENTS = [
45
+ 'Button', 'Badge', 'Card', 'Modal', 'Tabs', 'ThemeSwitcher', 'FormGroup', 'Alert', 'Toast', 'Dropdown',
37
46
  ];
38
47
 
39
48
  // ANSI colors for CLI (framework logo colors)
@@ -336,7 +345,7 @@ Usage:
336
345
  npx rizzo-css <command> [options]
337
346
 
338
347
  Commands:
339
- init Add Rizzo to existing project or scaffold new one (first menu: existing vs new)
348
+ init Add Rizzo to existing project or scaffold new one (first: framework, then existing vs new)
340
349
  add Copy Rizzo CSS into the current project (auto-detects Svelte/Astro)
341
350
  theme List all available themes (use in init or set data-theme on <html>)
342
351
  help Show this help
@@ -360,11 +369,60 @@ Docs: https://rizzo-css.vercel.app
360
369
  }
361
370
 
362
371
  function cmdTheme() {
363
- process.stdout.write('\nAvailable themes (set data-theme on <html>):\n\n');
364
- THEMES.forEach((t) => process.stdout.write(' ' + t + '\n'));
372
+ process.stdout.write('\nDark themes (set data-theme on <html>):\n');
373
+ DARK_THEMES.forEach((t) => process.stdout.write(' ' + t + '\n'));
374
+ process.stdout.write('\nLight themes:\n');
375
+ LIGHT_THEMES.forEach((t) => process.stdout.write(' ' + t + '\n'));
365
376
  process.stdout.write('\nExample: <html lang="en" data-theme="github-dark-classic">\n\n');
366
377
  }
367
378
 
379
+ /** Prompt for default dark theme, default light theme, and initial theme. Returns { theme, defaultDark, defaultLight }. */
380
+ async function promptThemes() {
381
+ const defaultDark = await selectMenu(
382
+ DARK_THEMES.map((t) => ({ value: t, label: t })),
383
+ '? Default dark theme (used when system preference is dark)'
384
+ );
385
+ const defaultLight = await selectMenu(
386
+ LIGHT_THEMES.map((t) => ({ value: t, label: t })),
387
+ '? Default light theme (used when system preference is light)'
388
+ );
389
+ const initialChoice = await selectMenu(
390
+ [
391
+ { value: 'system', label: 'System (follow OS light/dark)' },
392
+ { value: defaultDark, label: defaultDark + ' (dark)' },
393
+ { value: defaultLight, label: defaultLight + ' (light)' },
394
+ ],
395
+ '? Initial theme on first load'
396
+ );
397
+ const theme = initialChoice;
398
+ return { theme, defaultDark: DARK_THEMES.includes(defaultDark) ? defaultDark : DARK_THEMES[0], defaultLight: LIGHT_THEMES.includes(defaultLight) ? defaultLight : LIGHT_THEMES[0] };
399
+ }
400
+
401
+ /** Ask what to include: CSS only, recommended set, all components, or pick. Returns array of component names. Only call when componentList.length > 0. */
402
+ async function promptComponentChoice(componentList, framework) {
403
+ const recommended = RECOMMENDED_COMPONENTS.filter((c) => componentList.includes(c));
404
+ const choice = await selectMenu(
405
+ [
406
+ { value: 'none', label: 'CSS only — no components' },
407
+ { value: 'recommended', label: 'Recommended set (' + recommended.length + ' components: Button, Badge, Card, Modal, Tabs, ThemeSwitcher, FormGroup, Alert, Toast, Dropdown)' },
408
+ { value: 'all', label: 'All components (' + componentList.length + ')' },
409
+ { value: 'pick', label: 'Pick components (choose each one)' },
410
+ ],
411
+ '? What to include?'
412
+ );
413
+ if (choice === 'none') return [];
414
+ if (choice === 'recommended') return recommended;
415
+ if (choice === 'all') return [...componentList];
416
+ return multiSelectMenu(
417
+ [
418
+ { value: SENTINEL_ALL, label: 'Select all components' },
419
+ { value: SENTINEL_NONE, label: 'Select no components' },
420
+ ...componentList.map((c) => ({ value: c, label: c })),
421
+ ],
422
+ '? Components — Space to toggle, Enter to confirm'
423
+ );
424
+ }
425
+
368
426
  /** Detect framework from cwd: "svelte" | "astro" | null. */
369
427
  function detectFramework(cwd) {
370
428
  if (existsSync(join(cwd, 'svelte.config.js')) || existsSync(join(cwd, 'svelte.config.ts'))) return 'svelte';
@@ -386,6 +444,24 @@ function getFrameworkCssPaths(framework) {
386
444
  return { targetDir: 'css', linkHref: 'css/rizzo.min.css' };
387
445
  }
388
446
 
447
+ /**
448
+ * Browser-visible href for the CSS file. Astro serves public/ at /, SvelteKit serves static/ at /.
449
+ * Use this when a custom --path is provided so we tell the user the correct <link href="...">.
450
+ */
451
+ function getLinkHrefForTargetDir(framework, targetDir) {
452
+ const file = 'rizzo.min.css';
453
+ if (framework === 'astro' && targetDir) {
454
+ const path = targetDir.replace(/^public\/?/, '').replace(/\/+$/, '') || 'css';
455
+ return '/' + (path ? path + '/' : '') + file;
456
+ }
457
+ if (framework === 'svelte' && targetDir) {
458
+ const path = targetDir.replace(/^static\/?/, '').replace(/\/+$/, '') || 'css';
459
+ return '/' + (path ? path + '/' : '') + file;
460
+ }
461
+ const base = targetDir ? targetDir.replace(/\/+$/, '') : 'css';
462
+ return base ? base + '/' + file : file;
463
+ }
464
+
389
465
  function cmdAdd(argv) {
390
466
  const pathIdx = argv.indexOf('--path');
391
467
  const customPath = pathIdx !== -1 && argv[pathIdx + 1] ? argv[pathIdx + 1] : null;
@@ -407,7 +483,7 @@ function cmdAdd(argv) {
407
483
 
408
484
  mkdirSync(join(cwd, targetDir), { recursive: true });
409
485
  copyFileSync(cssSource, targetFile);
410
- const linkHref = customPath ? customPath + '/rizzo.min.css' : paths.linkHref;
486
+ const linkHref = customPath ? getLinkHrefForTargetDir(framework, targetDir) : paths.linkHref;
411
487
  console.log('\n✓ Rizzo CSS copied to ' + targetFile);
412
488
  if (framework === 'svelte') {
413
489
  console.log('\nDetected Svelte/SvelteKit. Add to your root layout (e.g. src/app.html):\n');
@@ -541,6 +617,12 @@ function copySvelteComponents(projectDir, selectedNames) {
541
617
  if (existsSync(iconsSrc)) {
542
618
  copyDirRecursive(iconsSrc, join(targetDir, 'icons'));
543
619
  }
620
+ if (toCopy.includes('ThemeSwitcher')) {
621
+ const themesSrc = join(scaffoldDir, 'themes.ts');
622
+ const themeSrc = join(scaffoldDir, 'theme.ts');
623
+ if (existsSync(themesSrc)) copyFileSync(themesSrc, join(targetDir, 'themes.ts'));
624
+ if (existsSync(themeSrc)) copyFileSync(themeSrc, join(targetDir, 'theme.ts'));
625
+ }
544
626
  if (exports.length > 0) {
545
627
  const indexContent = `/** Rizzo CSS Svelte components — selected via npx rizzo-css init */\n${exports.join('\n')}\n`;
546
628
  writeFileSync(join(targetDir, 'index.ts'), indexContent, 'utf8');
@@ -576,54 +658,65 @@ function copyAstroComponents(projectDir, selectedNames) {
576
658
  if (existsSync(iconsSrc)) {
577
659
  copyDirRecursive(iconsSrc, join(targetDir, 'icons'));
578
660
  }
661
+ if (toCopy.includes('ThemeSwitcher')) {
662
+ const themesSrc = join(scaffoldDir, 'themes.ts');
663
+ if (existsSync(themesSrc)) {
664
+ copyFileSync(themesSrc, join(targetDir, 'themes.ts'));
665
+ }
666
+ }
579
667
  if (count > 0) {
580
668
  console.log('\n ✓ ' + count + ' Astro components + icons copied to ' + targetDir);
581
669
  console.log(' Import in your pages: import Button from \'../components/rizzo/Button.astro\';\n');
582
670
  }
583
671
  }
584
672
 
585
- /** Add Rizzo CSS (and optional components) to an existing project in cwd. */
586
- async function runAddToExisting() {
673
+ /** Add Rizzo CSS (and optional components) to an existing project in cwd. frameworkOverride: when set (from init), skip framework prompt. */
674
+ async function runAddToExisting(frameworkOverride) {
587
675
  const cwd = process.cwd();
588
- const detected = detectFramework(cwd);
589
- const frameworkOptions = [
590
- { value: 'vanilla', label: 'Vanilla JS (HTML + CSS)', color: C.vanilla },
591
- { value: 'astro', label: 'Astro', color: C.astro },
592
- { value: 'svelte', label: 'Svelte', color: C.svelte },
593
- ];
594
- let frameworkPrompt = '? Framework';
595
- if (detected) {
596
- frameworkPrompt += ' (detected: ' + detected + ' — pick to confirm or choose another)';
597
- }
598
- const framework = await selectMenu(frameworkOptions, frameworkPrompt);
599
-
600
- const defaultTheme = await selectMenu(
601
- THEMES.map((t) => ({ value: t, label: t })),
602
- '? Default theme (all 14 themes are included in the CSS; this sets the initial data-theme)'
603
- );
604
- const theme = THEMES.includes(defaultTheme) ? defaultTheme : THEMES[0];
676
+ let framework = frameworkOverride;
677
+ if (framework == null) {
678
+ const detected = detectFramework(cwd);
679
+ const frameworkOptions = [
680
+ { value: 'vanilla', label: 'Vanilla JS (HTML + CSS)', color: C.vanilla },
681
+ { value: 'astro', label: 'Astro', color: C.astro },
682
+ { value: 'svelte', label: 'Svelte', color: C.svelte },
683
+ ];
684
+ let frameworkPrompt = '? Framework';
685
+ if (detected) {
686
+ frameworkPrompt += ' (detected: ' + detected + ' — pick to confirm or choose another)';
687
+ }
688
+ framework = await selectMenu(frameworkOptions, frameworkPrompt);
689
+ }
605
690
 
606
- let selectedComponents = [];
607
691
  const componentList = framework === 'svelte' ? SVELTE_COMPONENTS : framework === 'astro' ? ASTRO_COMPONENTS : [];
608
- if (componentList.length > 0) {
609
- const includeLabel = framework === 'svelte' ? 'Svelte' : 'Astro';
610
- const includeChoice = await selectMenu(
692
+ const selectedComponents = componentList.length > 0
693
+ ? await promptComponentChoice(componentList, framework)
694
+ : [];
695
+
696
+ let theme, defaultDark, defaultLight;
697
+ const wantsThemeSwitcher = selectedComponents.includes('ThemeSwitcher');
698
+ if (wantsThemeSwitcher) {
699
+ const setDefaults = await selectMenu(
611
700
  [
612
- { value: 'none', label: 'None' },
613
- { value: 'pick', label: 'Yes, pick ' + includeLabel + ' components' },
701
+ { value: true, label: 'Yes — choose default dark, default light, and initial theme' },
702
+ { value: false, label: 'No use defaults (github-dark-classic / github-light)' },
614
703
  ],
615
- '? Include ' + includeLabel + ' components?'
704
+ '? Set default themes for ThemeSwitcher? (same as create-new flow)'
616
705
  );
617
- if (includeChoice === 'pick') {
618
- selectedComponents = await multiSelectMenu(
619
- [
620
- { value: SENTINEL_ALL, label: 'Select all components' },
621
- { value: SENTINEL_NONE, label: 'Select no components' },
622
- ...componentList.map((c) => ({ value: c, label: c })),
623
- ],
624
- '? Components — pick individuals (Space to toggle) or choose Select all/none below. Enter=confirm'
625
- );
706
+ if (setDefaults) {
707
+ const out = await promptThemes();
708
+ theme = out.theme;
709
+ defaultDark = out.defaultDark;
710
+ defaultLight = out.defaultLight;
711
+ } else {
712
+ theme = DARK_THEMES[0];
713
+ defaultDark = DARK_THEMES[0];
714
+ defaultLight = LIGHT_THEMES[0];
626
715
  }
716
+ } else {
717
+ theme = DARK_THEMES[0];
718
+ defaultDark = DARK_THEMES[0];
719
+ defaultLight = LIGHT_THEMES[0];
627
720
  }
628
721
 
629
722
  const cssSource = getCssPath();
@@ -648,39 +741,52 @@ async function runAddToExisting() {
648
741
  const linkHref = paths.linkHref;
649
742
  console.log('\n✓ Rizzo CSS added to your existing project');
650
743
  console.log(' - ' + cssTarget);
744
+ console.log('\nYou must add the stylesheet link yourself — it is not added automatically.');
651
745
  if (framework === 'svelte') {
652
- console.log('\nAdd to your root layout (e.g. src/app.html):');
746
+ console.log('\nIn your root layout (e.g. src/app.html), add:');
653
747
  console.log(' <link rel="stylesheet" href="' + linkHref + '" />');
654
748
  console.log('\nSet a theme on <html>: data-theme="' + theme + '" (see: npx rizzo-css theme)');
749
+ console.log(' For theme "system": default dark ' + defaultDark + ', default light ' + defaultLight);
655
750
  if (selectedComponents.length > 0) {
656
751
  console.log(' Components are in src/lib/rizzo — import from \'$lib/rizzo\'.');
657
752
  }
658
753
  } else if (framework === 'astro') {
659
- console.log('\nAdd to your layout (e.g. src/layouts/Layout.astro):');
754
+ console.log('\nIn your layout (e.g. src/layouts/Layout.astro), add:');
660
755
  console.log(' <link rel="stylesheet" href="' + linkHref + '" />');
661
756
  console.log('\nSet a theme on <html>: data-theme="' + theme + '" (see: npx rizzo-css theme)');
757
+ console.log(' For theme "system": default dark ' + defaultDark + ', default light ' + defaultLight);
662
758
  if (selectedComponents.length > 0) {
663
759
  console.log(' Components are in src/components/rizzo — import from there.');
664
760
  }
665
761
  } else {
666
- console.log('\nAdd to your HTML or layout:');
762
+ console.log('\nIn your HTML or layout, add:');
667
763
  console.log(' <link rel="stylesheet" href="' + linkHref + '" />');
668
764
  console.log('\nSet a theme on <html>: data-theme="' + theme + '" (see: npx rizzo-css theme)');
765
+ console.log(' For theme "system": default dark ' + defaultDark + ', default light ' + defaultLight);
669
766
  }
670
767
  console.log('\nDocs: https://rizzo-css.vercel.app\n');
671
768
  }
672
769
 
673
770
  async function cmdInit() {
771
+ const framework = await selectMenu(
772
+ [
773
+ { value: 'vanilla', label: 'Vanilla JS (HTML + CSS + same styles & components)', color: C.vanilla },
774
+ { value: 'astro', label: 'Astro', color: C.astro },
775
+ { value: 'svelte', label: 'Svelte', color: C.svelte },
776
+ ],
777
+ '? Framework — all get the same CSS and component styles'
778
+ );
779
+
674
780
  const initMode = await selectMenu(
675
781
  [
676
782
  { value: 'existing', label: 'Add to existing project (current directory)' },
677
783
  { value: 'new', label: 'Create new project (scaffold)' },
678
784
  ],
679
- '? Are you using an existing project or creating a new one?'
785
+ '? Add to existing project or create a new one?'
680
786
  );
681
787
 
682
788
  if (initMode === 'existing') {
683
- await runAddToExisting();
789
+ await runAddToExisting(framework);
684
790
  return;
685
791
  }
686
792
 
@@ -693,43 +799,12 @@ async function cmdInit() {
693
799
  );
694
800
  const name = projectChoice === 'name' ? await question('Project name (folder name): ') : '';
695
801
 
696
- const framework = await selectMenu(
697
- [
698
- { value: 'vanilla', label: 'Vanilla JS (HTML + CSS + same styles & components)', color: C.vanilla },
699
- { value: 'astro', label: 'Astro', color: C.astro },
700
- { value: 'svelte', label: 'Svelte', color: C.svelte },
701
- ],
702
- '? Framework (arrows, Enter to select) — all get the same CSS and component styles'
703
- );
704
-
705
- const defaultTheme = await selectMenu(
706
- THEMES.map((t) => ({ value: t, label: t })),
707
- '? Default theme (all 14 themes are included in the CSS; this sets the initial data-theme)'
708
- );
709
- const theme = THEMES.includes(defaultTheme) ? defaultTheme : THEMES[0];
802
+ const { theme, defaultDark, defaultLight } = await promptThemes();
710
803
 
711
- let selectedComponents = [];
712
804
  const componentList = framework === 'svelte' ? SVELTE_COMPONENTS : framework === 'astro' ? ASTRO_COMPONENTS : [];
713
- if (componentList.length > 0) {
714
- const includeLabel = framework === 'svelte' ? 'Svelte' : 'Astro';
715
- const includeChoice = await selectMenu(
716
- [
717
- { value: 'none', label: 'None' },
718
- { value: 'pick', label: 'Yes, pick ' + includeLabel + ' components' },
719
- ],
720
- '? Include ' + includeLabel + ' components?'
721
- );
722
- if (includeChoice === 'pick') {
723
- selectedComponents = await multiSelectMenu(
724
- [
725
- { value: SENTINEL_ALL, label: 'Select all components' },
726
- { value: SENTINEL_NONE, label: 'Select no components' },
727
- ...componentList.map((c) => ({ value: c, label: c })),
728
- ],
729
- '? Components — pick individuals (Space to toggle) or choose Select all/none below. Enter=confirm'
730
- );
731
- }
732
- }
805
+ const selectedComponents = componentList.length > 0
806
+ ? await promptComponentChoice(componentList, framework)
807
+ : [];
733
808
 
734
809
  const projectDir = name ? join(process.cwd(), name) : process.cwd();
735
810
  const cssSource = getCssPath();
@@ -739,12 +814,14 @@ async function cmdInit() {
739
814
  process.exit(1);
740
815
  }
741
816
 
742
- const themeComment = '\n <!-- Default theme: ' + theme + ' (all 14 themes included in CSS) -->';
817
+ const themeComment = '\n <!-- Initial: ' + theme + '; dark: ' + defaultDark + '; light: ' + defaultLight + ' (all 14 themes in CSS) -->';
743
818
  const projectNamePkg = name
744
819
  ? name.replace(/\s+/g, '-').toLowerCase()
745
820
  : (framework === 'astro' ? 'my-astro-app' : framework === 'svelte' ? 'my-svelte-app' : 'my-app');
746
821
  const replacements = {
747
822
  '{{DATA_THEME}}': theme,
823
+ '{{DEFAULT_DARK}}': defaultDark,
824
+ '{{DEFAULT_LIGHT}}': defaultLight,
748
825
  '{{THEME_LIST_COMMENT}}': themeComment,
749
826
  '{{TITLE}}': name || 'App',
750
827
  '{{PROJECT_NAME}}': projectNamePkg,
@@ -798,6 +875,8 @@ async function cmdInit() {
798
875
  let indexHtml = readFileSync(vanillaScaffoldPath, 'utf8');
799
876
  indexHtml = indexHtml
800
877
  .replace(/\{\{DATA_THEME\}\}/g, theme)
878
+ .replace(/\{\{DEFAULT_DARK\}\}/g, defaultDark)
879
+ .replace(/\{\{DEFAULT_LIGHT\}\}/g, defaultLight)
801
880
  .replace(/\{\{THEME_LIST_COMMENT\}\}/g, themeComment)
802
881
  .replace(/\{\{TITLE\}\}/g, name || 'App')
803
882
  .replace(/\{\{LINK_HREF\}\}/g, linkHref);
@@ -828,7 +907,9 @@ async function cmdInit() {
828
907
  const vanillaJs = join(getPackageRoot(), 'scaffold', 'vanilla', 'js', 'main.js');
829
908
  if (existsSync(vanillaJs)) {
830
909
  mkdirSync(join(projectDir, 'js'), { recursive: true });
831
- copyFileSync(vanillaJs, join(projectDir, 'js', 'main.js'));
910
+ let mainJs = readFileSync(vanillaJs, 'utf8');
911
+ mainJs = mainJs.replace(/\{\{DEFAULT_DARK\}\}/g, defaultDark).replace(/\{\{DEFAULT_LIGHT\}\}/g, defaultLight);
912
+ writeFileSync(join(projectDir, 'js', 'main.js'), mainJs, 'utf8');
832
913
  }
833
914
  }
834
915
  if (framework === 'svelte' && selectedComponents.length > 0) {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "rizzo-css",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "scripts": {
5
- "prepublishOnly": "cd ../.. && pnpm build:css && node scripts/copy-scaffold.js"
5
+ "prepublishOnly": "cd ../.. && pnpm run lint:css:fix && pnpm run build:css && node scripts/copy-scaffold.js && node scripts/prepare-astro-scaffold.js && node scripts/prepare-vanilla-scaffold.js && node scripts/prepare-svelte-scaffold.js"
6
6
  },
7
7
  "description": "A modern CSS design system with semantic theming, 14 themes, and accessible components (BEM). Use with Astro, Svelte, or any framework.",
8
8
  "style": "dist/rizzo.min.css",
@@ -22,6 +22,8 @@
22
22
  "files": [
23
23
  "dist",
24
24
  "README.md",
25
+ "LICENSE",
26
+ ".env.example",
25
27
  "bin",
26
28
  "scaffold"
27
29
  ],
@@ -41,4 +43,4 @@
41
43
  "homepage": "https://rizzo-css.vercel.app",
42
44
  "license": "MIT",
43
45
  "author": "mingleusa"
44
- }
46
+ }