rizzo-css 0.0.59 → 0.0.61

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 (60) hide show
  1. package/README.md +1 -1
  2. package/bin/rizzo-css.js +141 -42
  3. package/package.json +1 -2
  4. package/scaffold/astro/BackToTop.astro +1 -0
  5. package/scaffold/astro/Settings.astro +1 -0
  6. package/scaffold/astro/Tabs.astro +1 -0
  7. package/scaffold/astro/ThemeSwitcher.astro +4 -0
  8. package/scaffold/vanilla/README-RIZZO.md +1 -1
  9. package/scaffold/vanilla/components/accordion.html +14 -0
  10. package/scaffold/vanilla/components/alert-dialog.html +14 -0
  11. package/scaffold/vanilla/components/alert.html +14 -0
  12. package/scaffold/vanilla/components/aspect-ratio.html +14 -0
  13. package/scaffold/vanilla/components/avatar.html +14 -0
  14. package/scaffold/vanilla/components/back-to-top.html +14 -0
  15. package/scaffold/vanilla/components/badge.html +14 -0
  16. package/scaffold/vanilla/components/breadcrumb.html +14 -0
  17. package/scaffold/vanilla/components/button-group.html +14 -0
  18. package/scaffold/vanilla/components/button.html +14 -0
  19. package/scaffold/vanilla/components/cards.html +14 -0
  20. package/scaffold/vanilla/components/collapsible.html +14 -0
  21. package/scaffold/vanilla/components/context-menu.html +14 -0
  22. package/scaffold/vanilla/components/copy-to-clipboard.html +14 -0
  23. package/scaffold/vanilla/components/dashboard.html +14 -0
  24. package/scaffold/vanilla/components/divider.html +14 -0
  25. package/scaffold/vanilla/components/docs-sidebar.html +14 -0
  26. package/scaffold/vanilla/components/dropdown.html +14 -0
  27. package/scaffold/vanilla/components/empty.html +14 -0
  28. package/scaffold/vanilla/components/font-switcher.html +14 -0
  29. package/scaffold/vanilla/components/footer.html +14 -0
  30. package/scaffold/vanilla/components/forms.html +14 -0
  31. package/scaffold/vanilla/components/hover-card.html +14 -0
  32. package/scaffold/vanilla/components/icons.html +14 -0
  33. package/scaffold/vanilla/components/index.html +14 -0
  34. package/scaffold/vanilla/components/kbd.html +14 -0
  35. package/scaffold/vanilla/components/label.html +14 -0
  36. package/scaffold/vanilla/components/modal.html +14 -0
  37. package/scaffold/vanilla/components/navbar.html +14 -0
  38. package/scaffold/vanilla/components/pagination.html +14 -0
  39. package/scaffold/vanilla/components/popover.html +14 -0
  40. package/scaffold/vanilla/components/progress-bar.html +14 -0
  41. package/scaffold/vanilla/components/resizable.html +14 -0
  42. package/scaffold/vanilla/components/scroll-area.html +14 -0
  43. package/scaffold/vanilla/components/search.html +14 -0
  44. package/scaffold/vanilla/components/separator.html +14 -0
  45. package/scaffold/vanilla/components/settings.html +14 -0
  46. package/scaffold/vanilla/components/sheet.html +14 -0
  47. package/scaffold/vanilla/components/skeleton.html +14 -0
  48. package/scaffold/vanilla/components/slider.html +14 -0
  49. package/scaffold/vanilla/components/sound-effects.html +14 -0
  50. package/scaffold/vanilla/components/spinner.html +14 -0
  51. package/scaffold/vanilla/components/switch.html +14 -0
  52. package/scaffold/vanilla/components/table.html +14 -0
  53. package/scaffold/vanilla/components/tabs.html +14 -0
  54. package/scaffold/vanilla/components/theme-switcher.html +14 -0
  55. package/scaffold/vanilla/components/toast.html +14 -0
  56. package/scaffold/vanilla/components/toggle-group.html +14 -0
  57. package/scaffold/vanilla/components/toggle.html +14 -0
  58. package/scaffold/vanilla/components/tooltip.html +14 -0
  59. package/scaffold/vanilla/index.html +14 -0
  60. package/scaffold/starter/index.html +0 -13
package/README.md CHANGED
@@ -68,7 +68,7 @@ import 'rizzo-css';
68
68
  **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:
69
69
 
70
70
  ```html
71
- <!-- unpkg (pin version: replace @latest with @0.0.59 or any version) -->
71
+ <!-- unpkg (pin version: replace @latest with @0.0.61 or any version) -->
72
72
  <link rel="stylesheet" href="https://unpkg.com/rizzo-css@latest/dist/rizzo.min.css" />
73
73
 
74
74
  <!-- or jsDelivr -->
package/bin/rizzo-css.js CHANGED
@@ -40,11 +40,16 @@ const ANSI_RESET = '\x1b[0m';
40
40
  /** Evenly spread column bounds (6 chars per color for first 6, rest for 7th). */
41
41
  const BANNER_BOUNDS = [0, 6, 12, 18, 24, 30, 36];
42
42
 
43
- /** Returns banner with "RIZZOCSS" block art in rainbow theme colors. No ANSI if stdout is not TTY or FORCE_COLOR=0. */
43
+ /** Cat lines (0–4) use red; RIZZOCSS block (5–9) uses rainbow. No ANSI if stdout is not TTY or FORCE_COLOR=0. */
44
44
  function getBanner() {
45
45
  const useColor = (process.stdout.isTTY || process.env.FORCE_COLOR === '1') && process.env.FORCE_COLOR !== '0';
46
46
  if (!useColor) return CLI_BANNER + '\n';
47
47
  const lines = CLI_BANNER.split('\n');
48
+ const CAT_END = 4;
49
+ const red = BANNER_RAINBOW[0];
50
+ for (let i = 0; i <= CAT_END && i < lines.length; i++) {
51
+ lines[i] = ansiFg(red.r, red.g, red.b) + lines[i] + ANSI_RESET;
52
+ }
48
53
  const RIZZOCSS_START = 5;
49
54
  const RIZZOCSS_END = 9;
50
55
  for (let i = RIZZOCSS_START; i <= RIZZOCSS_END; i++) {
@@ -78,8 +83,9 @@ const FRAMEWORKS = ['vanilla', 'astro', 'svelte'];
78
83
  /** Supported package managers: detection, install/add commands, and --package-manager override. */
79
84
  const VALID_PACKAGE_MANAGERS = ['npm', 'pnpm', 'yarn', 'bun'];
80
85
 
81
- /** Template options for create new and add to existing. All get full framework + Rizzo; template chooses starter content. */
86
+ /** Template options for create new and add to existing. CSS only = no components; others get full framework + Rizzo. */
82
87
  const TEMPLATES = [
88
+ { value: 'css-only', label: 'CSS only — CSS file, license, README (.gitignore). No web pages or components' },
83
89
  { value: 'landing', label: 'Landing — Marketing/hero page with features and CTAs' },
84
90
  { value: 'docs', label: 'Docs — Documentation site with sidebar and sample doc page' },
85
91
  { value: 'dashboard', label: 'Dashboard — App dashboard with sidebar, stat cards, and table' },
@@ -585,9 +591,9 @@ async function promptPackageManager(projectDir) {
585
591
  return selectMenu(options, '? Package manager (for install and run commands)');
586
592
  }
587
593
 
588
- /** Prompt user to select template (Landing, Docs, Dashboard, Full) for create new or add to existing. Returns 'landing' | 'docs' | 'dashboard' | 'full'. */
594
+ /** Prompt user to select template (CSS only, Landing, Docs, Dashboard, Full) for create new or add to existing. */
589
595
  async function promptTemplate() {
590
- return selectMenu(TEMPLATES, '? Which template? (all get full framework + Rizzo)');
596
+ return selectMenu(TEMPLATES, '? Which template?');
591
597
  }
592
598
 
593
599
  /** Path to variant overlay (docs, dashboard, or full). Landing uses base as-is so no overlay. Framework scaffolds live under scaffold/<framework>/variants/<variation>. */
@@ -626,15 +632,17 @@ function question(prompt) {
626
632
  });
627
633
  }
628
634
 
629
- /** Prompt yes/no; default yes. Returns true to run, false to skip. */
635
+ /** Prompt yes/no; default yes. For init: install project dependencies (uses selected pm: npm, pnpm, yarn, bun). */
630
636
  async function confirmRunInstall(pm) {
631
- const answer = await question('\nRun ' + pm.install + ' now? (Y/n) ');
637
+ console.log('\n Install project dependencies so you can run the dev server.');
638
+ const answer = await question(' Run ' + pm.install + '? (Y/n) ');
632
639
  return answer === '' || /^y(es)?$/i.test(answer);
633
640
  }
634
641
 
635
642
  /** Prompt yes/no; default yes. Returns true to initialize git repo, false to skip. */
636
643
  async function confirmGitInit() {
637
- const answer = await question('\nInitialize a git repository? (Y/n) ');
644
+ console.log('\n Optional: initialize a git repository in the project.');
645
+ const answer = await question(' Initialize git? (Y/n) ');
638
646
  return answer === '' || /^y(es)?$/i.test(answer);
639
647
  }
640
648
 
@@ -967,7 +975,7 @@ Available commands: init, add, theme, doctor, help
967
975
 
968
976
  Flags summary:
969
977
  init --yes --path <dir> --framework <fw> --template <t> --package-manager <pm> --install --no-install --no-git
970
- add --path <dir> --framework <fw> --template landing|docs|dashboard|full --no-snippet --readme --force --vanilla-js
978
+ add --path <dir> --framework <fw> --template css-only|landing|docs|dashboard|full --no-snippet --readme --force --vanilla-js
971
979
  theme (no flags)
972
980
  doctor Check config, CSS file, and optional layout link
973
981
  help (no flags)
@@ -979,8 +987,8 @@ Usage (use your package manager):
979
987
  bunx rizzo-css <command> [options]
980
988
 
981
989
  Commands:
982
- init New or existing. Create new → template (Landing | Docs | Dashboard | Full); all get full framework + Rizzo. Then component picker (all 56 or pick; Full = site clone skips picker). We never overwrite; skipped content in RIZZO-SETUP.md.
983
- add Add to existing: same template as create new (Landing | Docs | Dashboard | Full). Never overwrites existing or config files. Framework detected or from rizzo-css.json.
990
+ init New or existing. Create new → template (CSS only | Landing | Docs | Dashboard | Full). CSS only = no components; others get full framework + Rizzo and component picker (all or pick; Full = site clone skips picker). We never overwrite; skipped content in RIZZO-SETUP.md.
991
+ add For existing projects only. Add Rizzo CSS (and optionally components): choose template (CSS only | Landing | Docs | Dashboard | Full), then select which components to add (or CSS only for stylesheet only). Never overwrites existing or config files. Framework detected or from rizzo-css.json.
984
992
  theme List all available themes (use in init or set data-theme on <html>)
985
993
  help Show this help
986
994
 
@@ -988,15 +996,15 @@ Options (init):
988
996
  --yes Non-interactive: scaffold new in cwd with defaults (framework: astro, template: landing)
989
997
  --path <dir> Project directory (relative to cwd or absolute). Scaffold and run install there. With --yes; interactive: "Enter path" option.
990
998
  --framework <fw> vanilla | astro | svelte (with --yes; otherwise first prompt)
991
- --template <t> create new: landing | docs | dashboard | full (default: landing). add: same four options.
999
+ --template <t> create new: css-only | landing | docs | dashboard | full (default: landing). add: same options.
992
1000
  --package-manager <pm> npm | pnpm | yarn | bun (with --yes, or skip PM prompt when interactive)
993
1001
  --install After scaffolding, run package manager install in project directory (no prompt)
994
- --no-install Do not run install and do not prompt
1002
+ --no-install Do not run install; do not prompt (skip "Run <pm> install? (Y/n)")
995
1003
  --no-git With --yes, skip initializing a git repository (default with --yes is to run git init)
996
- (Git: only init offers or runs git init. Interactive init: "Initialize a git repository? (Y/n)" for all frameworks. With --yes, git init runs unless --no-git. Add (CSS + components) does not prompt for git. Astro/Svelte then get "Run install now? (Y/n)"; Vanilla has no package manager. rizzo-css.json is written only when the project does not already have one.)
1004
+ (Git: only init offers or runs git init. Interactive init: "Initialize git? (Y/n)". With --yes, git init runs unless --no-git. Add does not prompt for git. Init (create new): "Run <pm> install? (Y/n)" uses the package manager you selected (npm, pnpm, yarn, bun). Add: "Run <pm> add rizzo-css? (Y/n)" same. Vanilla has no package manager. rizzo-css.json is written only when the project does not already have one.)
997
1005
 
998
- Options (add):
999
- --template <t> landing | docs | dashboard | full (same as init; Full = site clone)
1006
+ Options (add) — run from your existing project root; you will choose a template then select components (or CSS only):
1007
+ --template <t> css-only | landing | docs | dashboard | full (CSS only = stylesheet only; others = component picker)
1000
1008
  --path <dir> Target directory for rizzo.min.css (overrides config and framework default)
1001
1009
  --framework <fw> vanilla | astro | svelte (overrides config and detection)
1002
1010
  --package-manager <pm> npm | pnpm | yarn | bun (override detection for install/print commands)
@@ -1250,7 +1258,7 @@ async function cmdAdd(argv) {
1250
1258
  const explicitFrameworkRaw = getFlagValue(argv, '--framework');
1251
1259
  const explicitFramework = explicitFrameworkRaw && FRAMEWORKS.includes(explicitFrameworkRaw.toLowerCase()) ? explicitFrameworkRaw.toLowerCase() : null;
1252
1260
  const templateRaw = getFlagValue(argv, '--template');
1253
- const validAddTemplates = ['landing', 'docs', 'dashboard', 'full']; // same four as create new
1261
+ const validAddTemplates = ['css-only', 'landing', 'docs', 'dashboard', 'full'];
1254
1262
  const template = templateRaw && validAddTemplates.includes(templateRaw.toLowerCase()) ? templateRaw.toLowerCase() : undefined;
1255
1263
  const installPackage = hasFlag(argv, '--install-package');
1256
1264
  const noInstall = hasFlag(argv, '--no-install');
@@ -1273,6 +1281,8 @@ async function cmdAdd(argv) {
1273
1281
  writeReadme,
1274
1282
  force,
1275
1283
  copyVanillaJs,
1284
+ installPackage: installPackage || undefined,
1285
+ noInstall: noInstall || undefined,
1276
1286
  };
1277
1287
  await runAddToExisting(explicitFramework, options);
1278
1288
  if (installPackage && !noInstall) {
@@ -1660,6 +1670,7 @@ async function runAddToExisting(frameworkOverride, options) {
1660
1670
  let framework = frameworkOverride || (config && config.framework);
1661
1671
  if (framework == null) {
1662
1672
  const detected = detectFramework(cwd);
1673
+ console.log('\n Add Rizzo CSS to your existing project. Choose a template, then select which components to add (or CSS only for the stylesheet). Existing files are never overwritten.\n');
1663
1674
  const frameworkOptions = [
1664
1675
  { value: 'vanilla', label: 'Vanilla JS (HTML + CSS)', color: C.vanilla },
1665
1676
  { value: 'astro', label: 'Astro', color: C.astro },
@@ -1672,16 +1683,18 @@ async function runAddToExisting(frameworkOverride, options) {
1672
1683
  framework = await selectMenu(frameworkOptions, frameworkPrompt);
1673
1684
  }
1674
1685
 
1675
- // Same choice as create new: template (Landing | Docs | Dashboard | Full). --template accepts landing|docs|dashboard|full.
1686
+ // Same choice as create new: template (CSS only | Landing | Docs | Dashboard | Full). --template accepts css-only|landing|docs|dashboard|full.
1676
1687
  let selectedVariation = (options && options.template) || null;
1677
- if (!selectedVariation || !['landing', 'docs', 'dashboard', 'full'].includes(selectedVariation)) {
1688
+ if (!selectedVariation || !['css-only', 'landing', 'docs', 'dashboard', 'full'].includes(selectedVariation)) {
1678
1689
  selectedVariation = await promptTemplate();
1679
1690
  }
1680
1691
 
1681
1692
  const componentList = framework === 'svelte' ? SVELTE_COMPONENTS : framework === 'astro' ? ASTRO_COMPONENTS : framework === 'vanilla' ? Object.keys(VANILLA_COMPONENT_SLUGS) : [];
1682
1693
  const preselected = options.preselectedComponents && options.preselectedComponents.length > 0 ? options.preselectedComponents : null;
1683
1694
  let selectedComponents;
1684
- if (preselected && componentList.length > 0) {
1695
+ if (selectedVariation === 'css-only') {
1696
+ selectedComponents = [];
1697
+ } else if (preselected && componentList.length > 0) {
1685
1698
  const valid = preselected.filter((c) => componentList.includes(c));
1686
1699
  const invalid = preselected.filter((c) => !componentList.includes(c));
1687
1700
  if (invalid.length > 0) {
@@ -1767,7 +1780,7 @@ async function runAddToExisting(frameworkOverride, options) {
1767
1780
  const vanillaRepl = { '{{LINK_HREF}}': 'css/rizzo.min.css', '{{TITLE}}': 'App', '{{DATA_THEME}}': theme, '{{THEME_LIST_COMMENT}}': themeCommentAdd };
1768
1781
  const variantResult = copyVariantOverlayNoOverwrite(cwd, 'vanilla', selectedVariation, vanillaRepl);
1769
1782
  if (variantResult && variantResult.skipped) addSkippedFiles = variantResult.skipped;
1770
- } else if ((framework === 'astro' && existsSync(astroCoreDir)) || (framework === 'svelte' && existsSync(svelteCoreDir))) {
1783
+ } else if (selectedVariation !== 'css-only' && ((framework === 'astro' && existsSync(astroCoreDir)) || (framework === 'svelte' && existsSync(svelteCoreDir)))) {
1771
1784
  const themeComment = themeCommentAdd;
1772
1785
  const replacements = {
1773
1786
  '{{DATA_THEME}}': theme,
@@ -1827,11 +1840,11 @@ async function runAddToExisting(frameworkOverride, options) {
1827
1840
  mkdirSync(targetDir, { recursive: true });
1828
1841
  copyFileSync(cssSource, cssTarget);
1829
1842
  copyRizzoFonts(dirname(cssTarget));
1830
- if (framework === 'vanilla') copyRizzoSfx(cwd);
1843
+ if (framework === 'vanilla' && selectedVariation !== 'css-only') copyRizzoSfx(cwd);
1831
1844
  }
1832
1845
  }
1833
1846
 
1834
- copyRizzoIcons(cwd, framework);
1847
+ if (selectedVariation !== 'css-only') copyRizzoIcons(cwd, framework);
1835
1848
  if (framework === 'svelte' && selectedComponents.length > 0) {
1836
1849
  const expanded = expandWithDeps('svelte', selectedComponents);
1837
1850
  logAddedDeps(selectedComponents, expanded, 'svelte');
@@ -1907,10 +1920,11 @@ async function runAddToExisting(frameworkOverride, options) {
1907
1920
  }
1908
1921
  }
1909
1922
  console.log('\n✓ Rizzo CSS added to your existing project');
1910
- console.log(' - ' + cssTarget + ' (CSS, fonts' + (framework === 'vanilla' ? ', sfx' : '') + ')');
1911
- console.log(' - Icons and ' + RIZZO_SETUP_FILE);
1923
+ const cssOnlyAdd = selectedVariation === 'css-only';
1924
+ console.log(' - ' + cssTarget + ' (CSS, fonts' + (framework === 'vanilla' && !cssOnlyAdd ? ', sfx' : '') + ')');
1925
+ console.log(' - ' + (cssOnlyAdd ? RIZZO_SETUP_FILE : 'Icons and ' + RIZZO_SETUP_FILE));
1912
1926
  if (selectedVariation && selectedVariation !== 'landing') {
1913
- console.log(' - Variation: ' + selectedVariation + ' (layout + starter content; existing files not overwritten).');
1927
+ console.log(' - Variation: ' + selectedVariation + (cssOnlyAdd ? ' (CSS only, no components).' : ' (layout + starter content; existing files not overwritten).'));
1914
1928
  }
1915
1929
  if (!hadConfig) console.log(' - Wrote ' + RIZZO_CONFIG_FILE);
1916
1930
  console.log(' - Wrote ' + RIZZO_SETUP_FILE + ' (instructions + link + theme)');
@@ -1939,8 +1953,27 @@ async function runAddToExisting(frameworkOverride, options) {
1939
1953
  console.log(' For interactive components (modal, dropdown, tabs, toast, search, navbar, copy-to-clipboard, theme switcher), add js/main.js — run again with --vanilla-js or copy from a Full scaffold.');
1940
1954
  }
1941
1955
  }
1942
- console.log('\nTo install the package: ' + pm.add('rizzo-css'));
1943
- console.log('\nNext: add the link above, then run your dev server. Docs: https://rizzo-css.vercel.app\n');
1956
+ const addCmd = pm.add('rizzo-css');
1957
+ console.log('\n To add the rizzo-css package to this project (optional): ' + addCmd);
1958
+ const shouldPromptAdd = (framework === 'astro' || framework === 'svelte') && options.noInstall !== true && options.installPackage !== true && process.stdin.isTTY;
1959
+ if (shouldPromptAdd) {
1960
+ console.log('\n Add rizzo-css to your package.json so you can import components from the package.');
1961
+ const answer = await question(' Run ' + addCmd + '? (Y/n) ');
1962
+ const runAdd = answer === '' || /^y(es)?$/i.test(answer);
1963
+ if (runAdd) {
1964
+ console.log('\n Running: ' + addCmd);
1965
+ const code = runInDir(cwd, addCmd);
1966
+ if (code !== 0) {
1967
+ console.error(' Add failed (exit ' + code + '). Run manually: ' + addCmd);
1968
+ } else {
1969
+ console.log(' ✓ rizzo-css added to dependencies.');
1970
+ }
1971
+ } else {
1972
+ console.log('\n Skipped. When ready, run: ' + addCmd);
1973
+ }
1974
+ }
1975
+ console.log('\n Next: add the link above to your layout, then run your dev server.');
1976
+ console.log(' Docs: https://rizzo-css.vercel.app\n');
1944
1977
  }
1945
1978
 
1946
1979
  async function cmdInit(argv) {
@@ -1968,11 +2001,14 @@ async function cmdInit(argv) {
1968
2001
  initMode = 'new';
1969
2002
  const templateArg = getFlagValue(argv, '--template');
1970
2003
  const defaultTemplate = 'landing';
1971
- const validTemplates = ['landing', 'docs', 'dashboard', 'full'];
2004
+ const validTemplates = ['css-only', 'landing', 'docs', 'dashboard', 'full'];
1972
2005
  const rawTemplate = (templateArg && validTemplates.includes(templateArg)) ? templateArg : defaultTemplate;
1973
2006
  selectedVariation = rawTemplate;
1974
- selectedTemplate = 'full'; // all four templates get full framework + Rizzo
1975
- if (selectedTemplate === 'full') {
2007
+ selectedTemplate = 'full'; // all templates get full framework + Rizzo (css-only gets no components)
2008
+ if (selectedVariation === 'css-only') {
2009
+ fullAllComponents = false;
2010
+ selectedComponents = [];
2011
+ } else if (selectedTemplate === 'full') {
1976
2012
  fullAllComponents = true;
1977
2013
  if (framework === 'svelte') selectedComponents = [...SVELTE_COMPONENTS];
1978
2014
  else if (framework === 'astro') selectedComponents = [...ASTRO_COMPONENTS];
@@ -1987,6 +2023,7 @@ async function cmdInit(argv) {
1987
2023
  defaultLight = LIGHT_THEMES[0];
1988
2024
  } else {
1989
2025
  console.log(getBanner());
2026
+ console.log(' We\'ll ask a few questions to set up your project.\n');
1990
2027
  framework = await selectMenu(
1991
2028
  [
1992
2029
  { value: 'vanilla', label: 'Vanilla JS (HTML + CSS + same styles & components)', color: C.vanilla },
@@ -2009,6 +2046,7 @@ async function cmdInit(argv) {
2009
2046
  return;
2010
2047
  }
2011
2048
 
2049
+ console.log('\n Choose where to create the project.\n');
2012
2050
  const projectChoice = await selectMenu(
2013
2051
  [
2014
2052
  { value: 'cwd', label: 'Current directory' },
@@ -2026,14 +2064,18 @@ async function cmdInit(argv) {
2026
2064
  }
2027
2065
 
2028
2066
  // Create new: choose template (Landing | Docs | Dashboard | Full)
2067
+ console.log('\n Choose a starting template (layout + sample content).\n');
2029
2068
  selectedVariation = await promptTemplate();
2030
2069
  selectedTemplate = 'full'; // all templates get full framework + Rizzo
2031
2070
 
2032
- // Full template = site clone (no component picker); Landing/Docs/Dashboard = choose all or pick components
2033
- if (selectedVariation === 'full' && hasFullVariant(framework)) {
2071
+ // CSS only = no component picker; Full (site clone) = all components; Landing/Docs/Dashboard = choose all or pick
2072
+ if (selectedVariation === 'css-only') {
2073
+ selectedComponents = [];
2074
+ fullAllComponents = false;
2075
+ } else if (selectedVariation === 'full' && hasFullVariant(framework)) {
2034
2076
  fullAllComponents = true;
2035
2077
  selectedComponents = framework === 'svelte' ? [...SVELTE_COMPONENTS] : framework === 'astro' ? [...ASTRO_COMPONENTS] : Object.keys(VANILLA_COMPONENT_SLUGS);
2036
- } else if (selectedVariation !== 'full' || !hasFullVariant(framework)) {
2078
+ } else {
2037
2079
  const addChoice = await selectMenu(
2038
2080
  [
2039
2081
  { value: 'all', label: 'All components' },
@@ -2290,6 +2332,50 @@ async function cmdInit(argv) {
2290
2332
  copyRizzoIcons(projectDir, 'svelte');
2291
2333
  copySvelteComponents(projectDir, componentsToCopy);
2292
2334
  }
2335
+ } else if (selectedVariation === 'css-only') {
2336
+ // CSS only: no components, no web pages — just CSS, fonts, license, README, .gitignore (and framework base for Astro/Svelte)
2337
+ mkdirSync(projectDir, { recursive: true });
2338
+ if (framework === 'vanilla') {
2339
+ const cssDir = join(projectDir, pathsForScaffold.targetDir);
2340
+ cssTarget = join(cssDir, 'rizzo.min.css');
2341
+ mkdirSync(cssDir, { recursive: true });
2342
+ copyFileSync(cssSource, cssTarget);
2343
+ copyRizzoFonts(dirname(cssTarget));
2344
+ writeFileSync(join(projectDir, RIZZO_SETUP_FILE), buildRizzoSetupMd(framework, { linkHref: 'css/rizzo.min.css', theme, defaultDark, defaultLight }), 'utf8');
2345
+ copyPackageLicense(projectDir);
2346
+ copyVanillaGitignore(projectDir);
2347
+ } else if (framework === 'astro' && existsSync(astroCoreDir)) {
2348
+ const { skipped } = copyDirRecursiveWithReplacementsNoOverwrite(astroCoreDir, projectDir, replacements, projectDir);
2349
+ copyRizzoCssAndFontsForAstro(projectDir, cssSource);
2350
+ if (skipped.length > 0) {
2351
+ writeFileSync(join(projectDir, RIZZO_SETUP_FILE), buildRizzoSetupMd('astro', { linkHref: '/css/rizzo.min.css', theme, defaultDark, defaultLight, skippedFiles: skipped }), 'utf8');
2352
+ }
2353
+ cssTarget = join(projectDir, 'public', 'css', 'rizzo.min.css');
2354
+ copyPackageLicense(projectDir);
2355
+ copyAstroGitignore(projectDir);
2356
+ } else if (framework === 'svelte' && existsSync(svelteCoreDir)) {
2357
+ const { skipped } = copyDirRecursiveWithReplacementsNoOverwrite(svelteCoreDir, projectDir, replacements, projectDir);
2358
+ copyRizzoCssAndFontsForSvelte(projectDir, cssSource);
2359
+ if (skipped.length > 0) {
2360
+ writeFileSync(join(projectDir, RIZZO_SETUP_FILE), buildRizzoSetupMd('svelte', { linkHref: '/css/rizzo.min.css', theme, defaultDark, defaultLight, skippedFiles: skipped }), 'utf8');
2361
+ }
2362
+ cssTarget = join(projectDir, 'static', 'css', 'rizzo.min.css');
2363
+ copyPackageLicense(projectDir);
2364
+ copySvelteGitignore(projectDir);
2365
+ } else {
2366
+ // fallback: same as vanilla (no index.html)
2367
+ const cssDir = join(projectDir, pathsForScaffold.targetDir);
2368
+ cssTarget = join(cssDir, 'rizzo.min.css');
2369
+ mkdirSync(cssDir, { recursive: true });
2370
+ copyFileSync(cssSource, cssTarget);
2371
+ copyRizzoFonts(dirname(cssTarget));
2372
+ writeFileSync(join(projectDir, RIZZO_SETUP_FILE), buildRizzoSetupMd(framework, { linkHref: 'css/rizzo.min.css', theme, defaultDark, defaultLight }), 'utf8');
2373
+ copyPackageLicense(projectDir);
2374
+ copyVanillaGitignore(projectDir);
2375
+ }
2376
+ if (cssTarget && existsSync(cssTarget) && statSync(cssTarget).size < 5000) {
2377
+ console.warn('\nWarning: rizzo.min.css is very small. From repo root run: pnpm build:css');
2378
+ }
2293
2379
  } else if (useVanillaCore || useVanillaWithOverlay) {
2294
2380
  const cssDir = join(projectDir, pathsForScaffold.targetDir);
2295
2381
  cssTarget = join(cssDir, 'rizzo.min.css');
@@ -2442,13 +2528,17 @@ async function cmdInit(argv) {
2442
2528
  console.log(' - ' + cssTarget);
2443
2529
  if (indexPath) console.log(' - ' + indexPath);
2444
2530
  if (framework === 'vanilla') {
2445
- if (useVanillaCore || useVanillaWithOverlay) {
2531
+ if (selectedVariation === 'css-only') {
2532
+ console.log(' - CSS only: stylesheet + ' + RIZZO_SETUP_FILE + ', license, .gitignore. No web pages or components.');
2533
+ } else if (useVanillaCore || useVanillaWithOverlay) {
2446
2534
  console.log(' - Vanilla JS (full): theme switcher, js/main.js, icons, component showcase, ' + SCAFFOLD_README_FILENAME + '.' + (useVanillaWithOverlay ? ' (' + selectedVariation + ' template)' : ''));
2447
2535
  } else if (selectedTemplate === 'landing') {
2448
2536
  console.log(' - ' + RIZZO_SETUP_FILE + ' has instructions and snippets.');
2449
2537
  } else {
2450
2538
  console.log(' - Vanilla JS (picked components): index.html + CSS. Add JS from docs or ' + RIZZO_SETUP_FILE + '.');
2451
2539
  }
2540
+ } else if (selectedVariation === 'css-only') {
2541
+ console.log(' - CSS only: stylesheet + base app, no components. Use Rizzo classes in your pages.');
2452
2542
  }
2453
2543
  if (existsSync(join(projectDir, RIZZO_SETUP_FILE))) {
2454
2544
  console.log(' - ' + RIZZO_SETUP_FILE + ' (instructions + snippets for anything we didn\'t overwrite)');
@@ -2456,7 +2546,9 @@ async function cmdInit(argv) {
2456
2546
  const pm = getPackageManagerCommands({ agent: selectedPm, command: selectedPm });
2457
2547
  const nextStep = pm.install + ' && ' + pm.run('dev');
2458
2548
  const runPrefix = projectDir !== cwd ? 'cd ' + pathRelative(cwd, projectDir) + ' && ' : '';
2459
- const hasPackageJson = useHandpickAstro || useHandpickSvelte || useAstroBase || useSvelteBase;
2549
+ const hasPackageJson = useHandpickAstro || useHandpickSvelte || useAstroBase || useSvelteBase || (selectedVariation === 'css-only' && (framework === 'astro' || framework === 'svelte'));
2550
+
2551
+ console.log('\n Scaffold complete. Summary above.');
2460
2552
 
2461
2553
  // Write rizzo-css.json only when one doesn't exist (don't overwrite existing config).
2462
2554
  const pathsForConfig = getFrameworkCssPaths(framework);
@@ -2479,20 +2571,26 @@ async function cmdInit(argv) {
2479
2571
  // Package manager install: only for Astro/Svelte (Vanilla has no package.json)
2480
2572
  if (runInstallAfterScaffold && !noInstall && hasPackageJson) {
2481
2573
  const dirLabel = projectDir !== cwd ? ' in ' + pathRelative(cwd, projectDir) : ' (current directory)';
2482
- console.log('\nRunning install' + dirLabel + ': ' + pm.install);
2574
+ console.log('\n Running' + dirLabel + ': ' + pm.install);
2483
2575
  const code = runInDir(projectDir, pm.install);
2484
2576
  if (code !== 0) {
2485
- console.error('\nInstall failed (exit ' + code + '). Run manually: ' + runPrefix + pm.install);
2577
+ console.error('\n Install failed (exit ' + code + '). Run manually: ' + runPrefix + pm.install);
2578
+ } else {
2579
+ console.log(' ✓ Dependencies installed.');
2486
2580
  }
2487
2581
  } else if (!yes && !noInstall && hasPackageJson) {
2488
2582
  const shouldRun = await confirmRunInstall(pm);
2489
2583
  if (shouldRun) {
2490
2584
  const dirLabel = projectDir !== cwd ? ' in ' + pathRelative(cwd, projectDir) : ' here';
2491
- console.log('\nRunning install' + dirLabel + ': ' + pm.install);
2585
+ console.log('\n Running' + dirLabel + ': ' + pm.install);
2492
2586
  const code = runInDir(projectDir, pm.install);
2493
2587
  if (code !== 0) {
2494
- console.error('\nInstall failed (exit ' + code + '). Run manually: ' + runPrefix + pm.install);
2588
+ console.error('\n Install failed (exit ' + code + '). Run manually: ' + runPrefix + pm.install);
2589
+ } else {
2590
+ console.log(' ✓ Dependencies installed.');
2495
2591
  }
2592
+ } else {
2593
+ console.log('\n Skipped. When ready, run: ' + runPrefix + pm.install);
2496
2594
  }
2497
2595
  }
2498
2596
 
@@ -2515,14 +2613,15 @@ async function cmdInit(argv) {
2515
2613
  console.log(' - Variation: ' + selectedVariation + ' (layout + starter content).');
2516
2614
  }
2517
2615
  if (hasPackageJson) {
2518
- console.log('\nNext: ' + runPrefix + nextStep);
2616
+ console.log('\n Next: run the dev server with:');
2617
+ console.log(' ' + runPrefix + nextStep);
2519
2618
  } else if (framework === 'vanilla') {
2520
2619
  const vanillaNext = projectDir !== cwd
2521
2620
  ? 'cd ' + pathRelative(cwd, projectDir) + ' then open index.html or serve the folder (e.g. npx serve .)'
2522
2621
  : 'open index.html or serve the folder (e.g. npx serve .)';
2523
- console.log('\nNext: ' + vanillaNext);
2622
+ console.log('\n Next: ' + vanillaNext);
2524
2623
  }
2525
- console.log('\nDocs: https://rizzo-css.vercel.app\n');
2624
+ console.log('\n Docs: https://rizzo-css.vercel.app\n');
2526
2625
  }
2527
2626
 
2528
2627
  function main() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rizzo-css",
3
- "version": "0.0.59",
3
+ "version": "0.0.61",
4
4
  "engines": { "node": ">=18" },
5
5
  "scripts": {
6
6
  "prepublishOnly": "cd ../.. && pnpm run lint:css:fix && pnpm run build:css && node scripts/copy-scaffold.js && node scripts/prepare-vanilla-scaffold.js"
@@ -32,7 +32,6 @@
32
32
  "scaffold/shared",
33
33
  "scaffold/svelte",
34
34
  "scaffold/utils",
35
- "scaffold/starter",
36
35
  "scaffold/vanilla"
37
36
  ],
38
37
  "keywords": [
@@ -18,6 +18,7 @@ const wrapperClass = ['back-to-top', className].filter(Boolean).join(' ').trim()
18
18
  type="button"
19
19
  class="back-to-top__btn"
20
20
  aria-label={label}
21
+ title={label}
21
22
  data-back-to-top-btn
22
23
  >
23
24
  <span class="back-to-top__icon" aria-hidden="true">
@@ -21,6 +21,7 @@ const { open = false } = Astro.props;
21
21
  class="settings__close"
22
22
  type="button"
23
23
  aria-label="Close settings"
24
+ title="Close settings"
24
25
  data-settings-close
25
26
  >
26
27
  <Close width={20} height={20} />
@@ -52,6 +52,7 @@ const classes = `tabs ${variantClass} ${className}`.trim();
52
52
  aria-controls={panelId}
53
53
  data-tab-id={tab.id}
54
54
  data-tab-index={index}
55
+ title={tab.label}
55
56
  >
56
57
  {tab.iconComponent ? <tab.iconComponent width={20} height={20} class="tabs__tab-icon" /> : tab.icon ? <img src={tab.icon} alt="" class="tabs__tab-icon" width="20" height="20" loading="lazy" aria-hidden="true" /> : null}
57
58
  {tab.label}
@@ -85,6 +85,7 @@ const InitialIcon = initialTheme ? initialTheme.icon : null;
85
85
  aria-haspopup="true"
86
86
  aria-controls={menuId}
87
87
  aria-label="Select theme"
88
+ title="Select theme"
88
89
  id={triggerId}
89
90
  >
90
91
  <span class="theme-switcher__label-wrapper" data-theme-label-wrapper>
@@ -115,6 +116,7 @@ const InitialIcon = initialTheme ? initialTheme.icon : null;
115
116
  data-theme-type="system"
116
117
  data-theme-bg="oklch(55% 0.02 270deg)"
117
118
  data-theme-accent=""
119
+ title="Use system light/dark preference"
118
120
  >
119
121
  <Gear width={16} height={16} class="theme-switcher__option-icon" />
120
122
  <span class="sr-only">Preference: </span>
@@ -136,6 +138,7 @@ const InitialIcon = initialTheme ? initialTheme.icon : null;
136
138
  data-theme-bg={theme.bg}
137
139
  data-theme-accent={theme.accent}
138
140
  data-theme-label={theme.label}
141
+ title={`Dark theme: ${theme.label}`}
139
142
  >
140
143
  <IconComponent width={16} height={16} class="theme-switcher__option-icon" />
141
144
  <span class="sr-only">Dark theme: </span>
@@ -160,6 +163,7 @@ const InitialIcon = initialTheme ? initialTheme.icon : null;
160
163
  data-theme-bg={theme.bg}
161
164
  data-theme-accent={theme.accent}
162
165
  data-theme-label={theme.label}
166
+ title={`Light theme: ${theme.label}`}
163
167
  >
164
168
  <IconComponent width={16} height={16} class="theme-switcher__option-icon" />
165
169
  <span class="sr-only">Light theme: </span>
@@ -28,7 +28,7 @@ If you prefer to load CSS from a CDN instead of the local file, replace the `<li
28
28
  - `<link rel="stylesheet" href="https://unpkg.com/rizzo-css@latest/dist/rizzo.min.css" />`
29
29
  - Or jsDelivr: `https://cdn.jsdelivr.net/npm/rizzo-css@latest/dist/rizzo.min.css`
30
30
 
31
- (Replace `@latest` with a specific version, e.g. `@0.0.59`, in production.)
31
+ (Replace `@latest` with a specific version, e.g. `@0.0.61`, in production.)
32
32
 
33
33
  The CLI replaces placeholders in `index.html` (e.g. `{{DATA_THEME}}`, `{{TITLE}}`) when you run `rizzo-css init`. The theme selected during init is used on first load when you have no saved preference in the browser.
34
34