rizzo-css 0.0.60 → 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 (59) hide show
  1. package/README.md +1 -1
  2. package/bin/rizzo-css.js +135 -41
  3. package/package.json +1 -1
  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 +8 -0
  10. package/scaffold/vanilla/components/alert-dialog.html +8 -0
  11. package/scaffold/vanilla/components/alert.html +8 -0
  12. package/scaffold/vanilla/components/aspect-ratio.html +8 -0
  13. package/scaffold/vanilla/components/avatar.html +8 -0
  14. package/scaffold/vanilla/components/back-to-top.html +8 -0
  15. package/scaffold/vanilla/components/badge.html +8 -0
  16. package/scaffold/vanilla/components/breadcrumb.html +8 -0
  17. package/scaffold/vanilla/components/button-group.html +8 -0
  18. package/scaffold/vanilla/components/button.html +8 -0
  19. package/scaffold/vanilla/components/cards.html +8 -0
  20. package/scaffold/vanilla/components/collapsible.html +8 -0
  21. package/scaffold/vanilla/components/context-menu.html +8 -0
  22. package/scaffold/vanilla/components/copy-to-clipboard.html +8 -0
  23. package/scaffold/vanilla/components/dashboard.html +8 -0
  24. package/scaffold/vanilla/components/divider.html +8 -0
  25. package/scaffold/vanilla/components/docs-sidebar.html +8 -0
  26. package/scaffold/vanilla/components/dropdown.html +8 -0
  27. package/scaffold/vanilla/components/empty.html +8 -0
  28. package/scaffold/vanilla/components/font-switcher.html +8 -0
  29. package/scaffold/vanilla/components/footer.html +8 -0
  30. package/scaffold/vanilla/components/forms.html +8 -0
  31. package/scaffold/vanilla/components/hover-card.html +8 -0
  32. package/scaffold/vanilla/components/icons.html +8 -0
  33. package/scaffold/vanilla/components/index.html +8 -0
  34. package/scaffold/vanilla/components/kbd.html +8 -0
  35. package/scaffold/vanilla/components/label.html +8 -0
  36. package/scaffold/vanilla/components/modal.html +8 -0
  37. package/scaffold/vanilla/components/navbar.html +8 -0
  38. package/scaffold/vanilla/components/pagination.html +8 -0
  39. package/scaffold/vanilla/components/popover.html +8 -0
  40. package/scaffold/vanilla/components/progress-bar.html +8 -0
  41. package/scaffold/vanilla/components/resizable.html +8 -0
  42. package/scaffold/vanilla/components/scroll-area.html +8 -0
  43. package/scaffold/vanilla/components/search.html +8 -0
  44. package/scaffold/vanilla/components/separator.html +8 -0
  45. package/scaffold/vanilla/components/settings.html +8 -0
  46. package/scaffold/vanilla/components/sheet.html +8 -0
  47. package/scaffold/vanilla/components/skeleton.html +8 -0
  48. package/scaffold/vanilla/components/slider.html +8 -0
  49. package/scaffold/vanilla/components/sound-effects.html +8 -0
  50. package/scaffold/vanilla/components/spinner.html +8 -0
  51. package/scaffold/vanilla/components/switch.html +8 -0
  52. package/scaffold/vanilla/components/table.html +8 -0
  53. package/scaffold/vanilla/components/tabs.html +8 -0
  54. package/scaffold/vanilla/components/theme-switcher.html +8 -0
  55. package/scaffold/vanilla/components/toast.html +8 -0
  56. package/scaffold/vanilla/components/toggle-group.html +8 -0
  57. package/scaffold/vanilla/components/toggle.html +8 -0
  58. package/scaffold/vanilla/components/tooltip.html +8 -0
  59. package/scaffold/vanilla/index.html +8 -0
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.60 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
@@ -83,8 +83,9 @@ const FRAMEWORKS = ['vanilla', 'astro', 'svelte'];
83
83
  /** Supported package managers: detection, install/add commands, and --package-manager override. */
84
84
  const VALID_PACKAGE_MANAGERS = ['npm', 'pnpm', 'yarn', 'bun'];
85
85
 
86
- /** 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. */
87
87
  const TEMPLATES = [
88
+ { value: 'css-only', label: 'CSS only — CSS file, license, README (.gitignore). No web pages or components' },
88
89
  { value: 'landing', label: 'Landing — Marketing/hero page with features and CTAs' },
89
90
  { value: 'docs', label: 'Docs — Documentation site with sidebar and sample doc page' },
90
91
  { value: 'dashboard', label: 'Dashboard — App dashboard with sidebar, stat cards, and table' },
@@ -590,9 +591,9 @@ async function promptPackageManager(projectDir) {
590
591
  return selectMenu(options, '? Package manager (for install and run commands)');
591
592
  }
592
593
 
593
- /** 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. */
594
595
  async function promptTemplate() {
595
- return selectMenu(TEMPLATES, '? Which template? (all get full framework + Rizzo)');
596
+ return selectMenu(TEMPLATES, '? Which template?');
596
597
  }
597
598
 
598
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>. */
@@ -631,15 +632,17 @@ function question(prompt) {
631
632
  });
632
633
  }
633
634
 
634
- /** 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). */
635
636
  async function confirmRunInstall(pm) {
636
- 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) ');
637
639
  return answer === '' || /^y(es)?$/i.test(answer);
638
640
  }
639
641
 
640
642
  /** Prompt yes/no; default yes. Returns true to initialize git repo, false to skip. */
641
643
  async function confirmGitInit() {
642
- 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) ');
643
646
  return answer === '' || /^y(es)?$/i.test(answer);
644
647
  }
645
648
 
@@ -972,7 +975,7 @@ Available commands: init, add, theme, doctor, help
972
975
 
973
976
  Flags summary:
974
977
  init --yes --path <dir> --framework <fw> --template <t> --package-manager <pm> --install --no-install --no-git
975
- 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
976
979
  theme (no flags)
977
980
  doctor Check config, CSS file, and optional layout link
978
981
  help (no flags)
@@ -984,8 +987,8 @@ Usage (use your package manager):
984
987
  bunx rizzo-css <command> [options]
985
988
 
986
989
  Commands:
987
- 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.
988
- 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.
989
992
  theme List all available themes (use in init or set data-theme on <html>)
990
993
  help Show this help
991
994
 
@@ -993,15 +996,15 @@ Options (init):
993
996
  --yes Non-interactive: scaffold new in cwd with defaults (framework: astro, template: landing)
994
997
  --path <dir> Project directory (relative to cwd or absolute). Scaffold and run install there. With --yes; interactive: "Enter path" option.
995
998
  --framework <fw> vanilla | astro | svelte (with --yes; otherwise first prompt)
996
- --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.
997
1000
  --package-manager <pm> npm | pnpm | yarn | bun (with --yes, or skip PM prompt when interactive)
998
1001
  --install After scaffolding, run package manager install in project directory (no prompt)
999
- --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)")
1000
1003
  --no-git With --yes, skip initializing a git repository (default with --yes is to run git init)
1001
- (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.)
1002
1005
 
1003
- Options (add):
1004
- --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)
1005
1008
  --path <dir> Target directory for rizzo.min.css (overrides config and framework default)
1006
1009
  --framework <fw> vanilla | astro | svelte (overrides config and detection)
1007
1010
  --package-manager <pm> npm | pnpm | yarn | bun (override detection for install/print commands)
@@ -1255,7 +1258,7 @@ async function cmdAdd(argv) {
1255
1258
  const explicitFrameworkRaw = getFlagValue(argv, '--framework');
1256
1259
  const explicitFramework = explicitFrameworkRaw && FRAMEWORKS.includes(explicitFrameworkRaw.toLowerCase()) ? explicitFrameworkRaw.toLowerCase() : null;
1257
1260
  const templateRaw = getFlagValue(argv, '--template');
1258
- const validAddTemplates = ['landing', 'docs', 'dashboard', 'full']; // same four as create new
1261
+ const validAddTemplates = ['css-only', 'landing', 'docs', 'dashboard', 'full'];
1259
1262
  const template = templateRaw && validAddTemplates.includes(templateRaw.toLowerCase()) ? templateRaw.toLowerCase() : undefined;
1260
1263
  const installPackage = hasFlag(argv, '--install-package');
1261
1264
  const noInstall = hasFlag(argv, '--no-install');
@@ -1278,6 +1281,8 @@ async function cmdAdd(argv) {
1278
1281
  writeReadme,
1279
1282
  force,
1280
1283
  copyVanillaJs,
1284
+ installPackage: installPackage || undefined,
1285
+ noInstall: noInstall || undefined,
1281
1286
  };
1282
1287
  await runAddToExisting(explicitFramework, options);
1283
1288
  if (installPackage && !noInstall) {
@@ -1665,6 +1670,7 @@ async function runAddToExisting(frameworkOverride, options) {
1665
1670
  let framework = frameworkOverride || (config && config.framework);
1666
1671
  if (framework == null) {
1667
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');
1668
1674
  const frameworkOptions = [
1669
1675
  { value: 'vanilla', label: 'Vanilla JS (HTML + CSS)', color: C.vanilla },
1670
1676
  { value: 'astro', label: 'Astro', color: C.astro },
@@ -1677,16 +1683,18 @@ async function runAddToExisting(frameworkOverride, options) {
1677
1683
  framework = await selectMenu(frameworkOptions, frameworkPrompt);
1678
1684
  }
1679
1685
 
1680
- // 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.
1681
1687
  let selectedVariation = (options && options.template) || null;
1682
- if (!selectedVariation || !['landing', 'docs', 'dashboard', 'full'].includes(selectedVariation)) {
1688
+ if (!selectedVariation || !['css-only', 'landing', 'docs', 'dashboard', 'full'].includes(selectedVariation)) {
1683
1689
  selectedVariation = await promptTemplate();
1684
1690
  }
1685
1691
 
1686
1692
  const componentList = framework === 'svelte' ? SVELTE_COMPONENTS : framework === 'astro' ? ASTRO_COMPONENTS : framework === 'vanilla' ? Object.keys(VANILLA_COMPONENT_SLUGS) : [];
1687
1693
  const preselected = options.preselectedComponents && options.preselectedComponents.length > 0 ? options.preselectedComponents : null;
1688
1694
  let selectedComponents;
1689
- if (preselected && componentList.length > 0) {
1695
+ if (selectedVariation === 'css-only') {
1696
+ selectedComponents = [];
1697
+ } else if (preselected && componentList.length > 0) {
1690
1698
  const valid = preselected.filter((c) => componentList.includes(c));
1691
1699
  const invalid = preselected.filter((c) => !componentList.includes(c));
1692
1700
  if (invalid.length > 0) {
@@ -1772,7 +1780,7 @@ async function runAddToExisting(frameworkOverride, options) {
1772
1780
  const vanillaRepl = { '{{LINK_HREF}}': 'css/rizzo.min.css', '{{TITLE}}': 'App', '{{DATA_THEME}}': theme, '{{THEME_LIST_COMMENT}}': themeCommentAdd };
1773
1781
  const variantResult = copyVariantOverlayNoOverwrite(cwd, 'vanilla', selectedVariation, vanillaRepl);
1774
1782
  if (variantResult && variantResult.skipped) addSkippedFiles = variantResult.skipped;
1775
- } else if ((framework === 'astro' && existsSync(astroCoreDir)) || (framework === 'svelte' && existsSync(svelteCoreDir))) {
1783
+ } else if (selectedVariation !== 'css-only' && ((framework === 'astro' && existsSync(astroCoreDir)) || (framework === 'svelte' && existsSync(svelteCoreDir)))) {
1776
1784
  const themeComment = themeCommentAdd;
1777
1785
  const replacements = {
1778
1786
  '{{DATA_THEME}}': theme,
@@ -1832,11 +1840,11 @@ async function runAddToExisting(frameworkOverride, options) {
1832
1840
  mkdirSync(targetDir, { recursive: true });
1833
1841
  copyFileSync(cssSource, cssTarget);
1834
1842
  copyRizzoFonts(dirname(cssTarget));
1835
- if (framework === 'vanilla') copyRizzoSfx(cwd);
1843
+ if (framework === 'vanilla' && selectedVariation !== 'css-only') copyRizzoSfx(cwd);
1836
1844
  }
1837
1845
  }
1838
1846
 
1839
- copyRizzoIcons(cwd, framework);
1847
+ if (selectedVariation !== 'css-only') copyRizzoIcons(cwd, framework);
1840
1848
  if (framework === 'svelte' && selectedComponents.length > 0) {
1841
1849
  const expanded = expandWithDeps('svelte', selectedComponents);
1842
1850
  logAddedDeps(selectedComponents, expanded, 'svelte');
@@ -1912,10 +1920,11 @@ async function runAddToExisting(frameworkOverride, options) {
1912
1920
  }
1913
1921
  }
1914
1922
  console.log('\n✓ Rizzo CSS added to your existing project');
1915
- console.log(' - ' + cssTarget + ' (CSS, fonts' + (framework === 'vanilla' ? ', sfx' : '') + ')');
1916
- 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));
1917
1926
  if (selectedVariation && selectedVariation !== 'landing') {
1918
- 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).'));
1919
1928
  }
1920
1929
  if (!hadConfig) console.log(' - Wrote ' + RIZZO_CONFIG_FILE);
1921
1930
  console.log(' - Wrote ' + RIZZO_SETUP_FILE + ' (instructions + link + theme)');
@@ -1944,8 +1953,27 @@ async function runAddToExisting(frameworkOverride, options) {
1944
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.');
1945
1954
  }
1946
1955
  }
1947
- console.log('\nTo install the package: ' + pm.add('rizzo-css'));
1948
- 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');
1949
1977
  }
1950
1978
 
1951
1979
  async function cmdInit(argv) {
@@ -1973,11 +2001,14 @@ async function cmdInit(argv) {
1973
2001
  initMode = 'new';
1974
2002
  const templateArg = getFlagValue(argv, '--template');
1975
2003
  const defaultTemplate = 'landing';
1976
- const validTemplates = ['landing', 'docs', 'dashboard', 'full'];
2004
+ const validTemplates = ['css-only', 'landing', 'docs', 'dashboard', 'full'];
1977
2005
  const rawTemplate = (templateArg && validTemplates.includes(templateArg)) ? templateArg : defaultTemplate;
1978
2006
  selectedVariation = rawTemplate;
1979
- selectedTemplate = 'full'; // all four templates get full framework + Rizzo
1980
- 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') {
1981
2012
  fullAllComponents = true;
1982
2013
  if (framework === 'svelte') selectedComponents = [...SVELTE_COMPONENTS];
1983
2014
  else if (framework === 'astro') selectedComponents = [...ASTRO_COMPONENTS];
@@ -1992,6 +2023,7 @@ async function cmdInit(argv) {
1992
2023
  defaultLight = LIGHT_THEMES[0];
1993
2024
  } else {
1994
2025
  console.log(getBanner());
2026
+ console.log(' We\'ll ask a few questions to set up your project.\n');
1995
2027
  framework = await selectMenu(
1996
2028
  [
1997
2029
  { value: 'vanilla', label: 'Vanilla JS (HTML + CSS + same styles & components)', color: C.vanilla },
@@ -2014,6 +2046,7 @@ async function cmdInit(argv) {
2014
2046
  return;
2015
2047
  }
2016
2048
 
2049
+ console.log('\n Choose where to create the project.\n');
2017
2050
  const projectChoice = await selectMenu(
2018
2051
  [
2019
2052
  { value: 'cwd', label: 'Current directory' },
@@ -2031,14 +2064,18 @@ async function cmdInit(argv) {
2031
2064
  }
2032
2065
 
2033
2066
  // Create new: choose template (Landing | Docs | Dashboard | Full)
2067
+ console.log('\n Choose a starting template (layout + sample content).\n');
2034
2068
  selectedVariation = await promptTemplate();
2035
2069
  selectedTemplate = 'full'; // all templates get full framework + Rizzo
2036
2070
 
2037
- // Full template = site clone (no component picker); Landing/Docs/Dashboard = choose all or pick components
2038
- 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)) {
2039
2076
  fullAllComponents = true;
2040
2077
  selectedComponents = framework === 'svelte' ? [...SVELTE_COMPONENTS] : framework === 'astro' ? [...ASTRO_COMPONENTS] : Object.keys(VANILLA_COMPONENT_SLUGS);
2041
- } else if (selectedVariation !== 'full' || !hasFullVariant(framework)) {
2078
+ } else {
2042
2079
  const addChoice = await selectMenu(
2043
2080
  [
2044
2081
  { value: 'all', label: 'All components' },
@@ -2295,6 +2332,50 @@ async function cmdInit(argv) {
2295
2332
  copyRizzoIcons(projectDir, 'svelte');
2296
2333
  copySvelteComponents(projectDir, componentsToCopy);
2297
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
+ }
2298
2379
  } else if (useVanillaCore || useVanillaWithOverlay) {
2299
2380
  const cssDir = join(projectDir, pathsForScaffold.targetDir);
2300
2381
  cssTarget = join(cssDir, 'rizzo.min.css');
@@ -2447,13 +2528,17 @@ async function cmdInit(argv) {
2447
2528
  console.log(' - ' + cssTarget);
2448
2529
  if (indexPath) console.log(' - ' + indexPath);
2449
2530
  if (framework === 'vanilla') {
2450
- 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) {
2451
2534
  console.log(' - Vanilla JS (full): theme switcher, js/main.js, icons, component showcase, ' + SCAFFOLD_README_FILENAME + '.' + (useVanillaWithOverlay ? ' (' + selectedVariation + ' template)' : ''));
2452
2535
  } else if (selectedTemplate === 'landing') {
2453
2536
  console.log(' - ' + RIZZO_SETUP_FILE + ' has instructions and snippets.');
2454
2537
  } else {
2455
2538
  console.log(' - Vanilla JS (picked components): index.html + CSS. Add JS from docs or ' + RIZZO_SETUP_FILE + '.');
2456
2539
  }
2540
+ } else if (selectedVariation === 'css-only') {
2541
+ console.log(' - CSS only: stylesheet + base app, no components. Use Rizzo classes in your pages.');
2457
2542
  }
2458
2543
  if (existsSync(join(projectDir, RIZZO_SETUP_FILE))) {
2459
2544
  console.log(' - ' + RIZZO_SETUP_FILE + ' (instructions + snippets for anything we didn\'t overwrite)');
@@ -2461,7 +2546,9 @@ async function cmdInit(argv) {
2461
2546
  const pm = getPackageManagerCommands({ agent: selectedPm, command: selectedPm });
2462
2547
  const nextStep = pm.install + ' && ' + pm.run('dev');
2463
2548
  const runPrefix = projectDir !== cwd ? 'cd ' + pathRelative(cwd, projectDir) + ' && ' : '';
2464
- 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.');
2465
2552
 
2466
2553
  // Write rizzo-css.json only when one doesn't exist (don't overwrite existing config).
2467
2554
  const pathsForConfig = getFrameworkCssPaths(framework);
@@ -2484,20 +2571,26 @@ async function cmdInit(argv) {
2484
2571
  // Package manager install: only for Astro/Svelte (Vanilla has no package.json)
2485
2572
  if (runInstallAfterScaffold && !noInstall && hasPackageJson) {
2486
2573
  const dirLabel = projectDir !== cwd ? ' in ' + pathRelative(cwd, projectDir) : ' (current directory)';
2487
- console.log('\nRunning install' + dirLabel + ': ' + pm.install);
2574
+ console.log('\n Running' + dirLabel + ': ' + pm.install);
2488
2575
  const code = runInDir(projectDir, pm.install);
2489
2576
  if (code !== 0) {
2490
- 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.');
2491
2580
  }
2492
2581
  } else if (!yes && !noInstall && hasPackageJson) {
2493
2582
  const shouldRun = await confirmRunInstall(pm);
2494
2583
  if (shouldRun) {
2495
2584
  const dirLabel = projectDir !== cwd ? ' in ' + pathRelative(cwd, projectDir) : ' here';
2496
- console.log('\nRunning install' + dirLabel + ': ' + pm.install);
2585
+ console.log('\n Running' + dirLabel + ': ' + pm.install);
2497
2586
  const code = runInDir(projectDir, pm.install);
2498
2587
  if (code !== 0) {
2499
- 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.');
2500
2591
  }
2592
+ } else {
2593
+ console.log('\n Skipped. When ready, run: ' + runPrefix + pm.install);
2501
2594
  }
2502
2595
  }
2503
2596
 
@@ -2520,14 +2613,15 @@ async function cmdInit(argv) {
2520
2613
  console.log(' - Variation: ' + selectedVariation + ' (layout + starter content).');
2521
2614
  }
2522
2615
  if (hasPackageJson) {
2523
- console.log('\nNext: ' + runPrefix + nextStep);
2616
+ console.log('\n Next: run the dev server with:');
2617
+ console.log(' ' + runPrefix + nextStep);
2524
2618
  } else if (framework === 'vanilla') {
2525
2619
  const vanillaNext = projectDir !== cwd
2526
2620
  ? 'cd ' + pathRelative(cwd, projectDir) + ' then open index.html or serve the folder (e.g. npx serve .)'
2527
2621
  : 'open index.html or serve the folder (e.g. npx serve .)';
2528
- console.log('\nNext: ' + vanillaNext);
2622
+ console.log('\n Next: ' + vanillaNext);
2529
2623
  }
2530
- console.log('\nDocs: https://rizzo-css.vercel.app\n');
2624
+ console.log('\n Docs: https://rizzo-css.vercel.app\n');
2531
2625
  }
2532
2626
 
2533
2627
  function main() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rizzo-css",
3
- "version": "0.0.60",
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"
@@ -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.60`, 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