Skip to content

docs(ui): add design system guidelines#2252

Open
cylewaitforit wants to merge 3 commits intonpmx-dev:mainfrom
cylewaitforit:sb-design-guidelines
Open

docs(ui): add design system guidelines#2252
cylewaitforit wants to merge 3 commits intonpmx-dev:mainfrom
cylewaitforit:sb-design-guidelines

Conversation

@cylewaitforit
Copy link
Contributor

@cylewaitforit cylewaitforit commented Mar 23, 2026

🔗 Linked issue

🧭 Context

Codifies design system guidelines from @alexdln into the storybook docs.

📚 Description

Adds storybook doc pages for:

  • Design System Guidelines
  • Colors
  • Typography

Moves theme from uno.config.ts into uno.theme.ts in order for it to be consumed in the storybook docs.

@vercel
Copy link

vercel bot commented Mar 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Mar 24, 2026 0:18am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Mar 24, 2026 0:18am
npmx-lunaria Ignored Ignored Mar 24, 2026 0:18am

Request Review

@codecov
Copy link

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Co-authored-by: Alex Savelyev <91429106+alexdln@users.noreply.github.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: af8c2ce8-5ab3-4f41-9442-f9204dd4e579

📥 Commits

Reviewing files that changed from the base of the PR and between 94f190e and c36f762.

📒 Files selected for processing (1)
  • app/design-system-guidelines.mdx
✅ Files skipped from review due to trivial changes (1)
  • app/design-system-guidelines.mdx

📝 Walkthrough

Walkthrough

Extracted the Unocss theme from uno.config.ts into a new uno.theme.ts export and wired it into uno.config.ts. Updated Storybook’s story discovery in .storybook/main.ts to include MDX documentation alongside JS/TS stories. Added three Storybook MDX pages under app/: colors.mdx, design-system-guidelines.mdx, and typography.mdx documenting colour tokens, design guidelines, and typography scales respectively. No exported/public JS/TS APIs or type signatures were changed.

Possibly related PRs

Suggested reviewers

  • alexdln
  • ghostdevv
  • danielroe
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description is directly related to the changeset, explaining the addition of design system guidelines to Storybook documentation and the refactoring of theme configuration.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
app/design-system-guidelines.mdx (1)

19-19: Minor: Missing period at end of sentence.

📝 Suggested fix
-Text and input fields should not exceed **768px** in width
+Text and input fields should not exceed **768px** in width.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 903b1231-571d-4bfb-bcbc-c29d267176b3

📥 Commits

Reviewing files that changed from the base of the PR and between 1fd2d53 and 0bd8a72.

📒 Files selected for processing (6)
  • .storybook/main.ts
  • app/colors.mdx
  • app/design-system-guidelines.mdx
  • app/typography.mdx
  • uno.config.ts
  • uno.theme.ts

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/typography.mdx (1)

37-56: Deduplicate the repeated typography scale array.

The fontSizes list is duplicated in both large Typeset blocks, which makes future token updates easy to miss in one place.

♻️ Suggested refactor
 export const wind4FontSizes = {
   'xs': '0.75rem',
   'sm': '0.875rem',
   'base': '1rem',
   'lg': '1.125rem',
   'xl': '1.25rem',
   '2xl': '1.5rem',
   '3xl': '1.875rem',
   '4xl': '2.25rem',
   '5xl': '3rem',
 }
+
+export const fullTypographyScale = [
+  wind4FontSizes['5xl'], // 48px
+  wind4FontSizes['4xl'], // 36px
+  wind4FontSizes['3xl'], // 30px
+  wind4FontSizes['2xl'], // 24px
+  wind4FontSizes['xl'], // 20px
+  wind4FontSizes['lg'], // 18px
+  wind4FontSizes['base'], // 16px
+  wind4FontSizes['sm'], // 14px
+  wind4FontSizes['xs'], // 12px
+  theme.text['2xs'].fontSize, // 11px
+  theme.text['3xs'].fontSize, // 10px
+  theme.text['4xs'].fontSize, // 9px
+  theme.text['5xs'].fontSize, // 8px
+]
@@
 <Typeset
   fontFamily={theme.font.sans}
-  fontSizes={[
-    wind4FontSizes['5xl'], // 48px
-    wind4FontSizes['4xl'], // 36px
-    wind4FontSizes['3xl'], // 30px
-    wind4FontSizes['2xl'], // 24px
-    wind4FontSizes['xl'], // 20px
-    wind4FontSizes['lg'], // 18px
-    wind4FontSizes['base'], // 16px
-    wind4FontSizes['sm'], // 14px
-    wind4FontSizes['xs'], // 12px
-    theme.text['2xs'].fontSize, // 11px
-    theme.text['3xs'].fontSize, // 10px
-    theme.text['4xs'].fontSize, // 9px
-    theme.text['5xs'].fontSize, // 8px
-  ]}
+  fontSizes={fullTypographyScale}
   fontWeight={400}
   sampleText="The quick brown fox jumps over the lazy dog"
 />
@@
 <Typeset
   fontFamily={theme.font.mono}
-  fontSizes={[
-    wind4FontSizes['5xl'], // 48px
-    wind4FontSizes['4xl'], // 36px
-    wind4FontSizes['3xl'], // 30px
-    wind4FontSizes['2xl'], // 24px
-    wind4FontSizes['xl'], // 20px
-    wind4FontSizes['lg'], // 18px
-    wind4FontSizes['base'], // 16px
-    wind4FontSizes['sm'], // 14px
-    wind4FontSizes['xs'], // 12px
-    theme.text['2xs'].fontSize, // 11px
-    theme.text['3xs'].fontSize, // 10px
-    theme.text['4xs'].fontSize, // 9px
-    theme.text['5xs'].fontSize, // 8px
-  ]}
+  fontSizes={fullTypographyScale}
   fontWeight={400}
   sampleText="const greeting = 'Hello, World!';"
 />

Also applies to: 71-90


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 899474df-53e9-4d95-9dea-6f0b170fcd24

📥 Commits

Reviewing files that changed from the base of the PR and between 0bd8a72 and 94f190e.

📒 Files selected for processing (1)
  • app/typography.mdx


## Line Height

Base line height is set to **1.6** for optimal readability. This provides comfortable spacing for multi-line text blocks while maintaining density for UI components.
Copy link
Contributor

@coderabbitai coderabbitai bot Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use the standard hyphenated term “line-height”.

At Line 154, “Base line height” reads better as “Base line-height” in typography docs.

📝 Suggested wording tweak
-Base line height is set to **1.6** for optimal readability. This provides comfortable spacing for multi-line text blocks while maintaining density for UI components.
+Base line-height is set to **1.6** for optimal readability. This provides comfortable spacing for multi-line text blocks while maintaining density for UI components.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Base line height is set to **1.6** for optimal readability. This provides comfortable spacing for multi-line text blocks while maintaining density for UI components.
Base line-height is set to **1.6** for optimal readability. This provides comfortable spacing for multi-line text blocks while maintaining density for UI components.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no preference on this. If others feel this is a good suggestion we can change to the hyphenated "line-height" here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cylewaitforit, totally fair! The main rationale is just that line-height mirrors the CSS property name, which can make the docs feel more consistent with technical references. That said, "line height" (unhyphenated) is equally valid prose — it's a genuinely minor point. Happy to leave it as-is if there's no strong preference from the team. 🐇


🧠 Learnings used
Learnt from: cylewaitforit
Repo: npmx-dev/npmx.dev PR: 1964
File: .storybook/preview-head.html:1-6
Timestamp: 2026-03-06T17:45:06.525Z
Learning: In the npmx.dev project, the `.storybook/preview-head.html` file sets `background-color` on `.docs-story` via the `--bg` CSS custom property to fix the Autodocs canvas background. This is an intentional workaround for a known Storybook bug (storybookjs/storybook#30928) where `addon-themes` and `parameters.docs.theme` do not apply to the individual story canvas iframes in the Autodocs tab. Removing this file causes the autodocs pages to not display correctly.

@alexdln
Copy link
Member

alexdln commented Mar 24, 2026

Can we use a separate directory for these stories? I have a feeling that this will conflict with the blog-like pages now or in the future

@cylewaitforit
Copy link
Contributor Author

cylewaitforit commented Mar 24, 2026

Can we use a separate directory for these stories? I have a feeling that this will conflict with the blog-like pages now or in the future

@alexdln

Yep! I thought having it colocated would make it easier to find and I didn’t think nuxt would ever read the files since they are .mdx but can definitely move them.

Could move them into the .storybook/ directory where we have the welcome or were you thinking something like app/design-system/** or had any other name preference?

Storybook will also use the directory in the auto-naming for the sidebar. However if the preference is to keep them at the top of the sidebar with welcome, we can always override it in the main.ts or in the files themselves in the meta section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants