docs(themes): add theme generator
Closes #3066
📝 Description
This PR introduces a theme generator to the NextUI documentation. The theme generator is accessible via a new navigation item, Themes, making it easier for users to create and customize themes.
⛳️ Current Behavior
Currently, the NextUI documentation does not include a theme generator, limiting users' ability to easily create and preview custom themes.
🚀 New Behavior
With this PR, a theme generator will be added to the NextUI documentation, allowing users to generate and customize themes directly within the platform.
💣 Breaking Change
No, this PR does not introduce any breaking changes.
📝 Additional Information
There is an issue with the default color in the white theme; it does not perfectly match the tints and shades of the zinc color used by NextUI's default palette. Although a suitable solution hasn't been found yet, this should not be a blocker, as users can manually adjust the colors. Efforts to resolve this issue will continue.
This version is more concise and polished, improving clarity and flow while retaining all important details.
Summary by CodeRabbit
-
New Features
- Added a
NavbarItemfor direct navigation to the themes section. - Introduced a
FontSizescomponent for configuring font size settings. - Added
FontSizeInputcomponents for various font size categories. - Launched a
FontSizeShowcasecomponent to display text elements with different font sizes. - Introduced a
CircularProgresscomponent to showcase variations of circular progress indicators. - Added a
ThemeBuildercomponent to manage theme configurations and loading states.
- Added a
-
Bug Fixes
- Resolved issues related to state management and color updates in theme components.
-
Documentation
- Updated documentation to reflect new components and usage instructions.
-
Chores
- Added new dependencies for color management and UI enhancements.
⚠️ No Changeset found
Latest commit: a46195435a91c1f8a1638fb5daf94237d6b0be71
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
@xylish7 is attempting to deploy a commit to the NextUI Inc Team on Vercel.
A member of the Team first needs to authorize it.
Walkthrough
The changes introduce a new navigation item in the Navbar component for accessing the "/themes" route, enhancing user navigation. Additionally, two new dependencies, react-colorful and values.js, are added to the project's package.json file. These updates primarily focus on improving the navigation experience without altering the existing logic or structure of the application significantly.
Changes
| File Path | Change Summary |
|---|---|
apps/docs/components/navbar.tsx |
Added NavbarItem for navigation to the "/themes" route. |
apps/docs/package.json |
Added dependencies: react-colorful and values.js. |
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
| Theme generator implementation (3066) | ✅ | |
| Documentation mention for theme builder | ❌ | No documentation updates were included in the changes. |
| User interface for theme customization | ❓ | It is unclear if the new link will be documented or integrated into the theme generator. |
Possibly related PRs
- #3737: This PR modifies the
Navbarcomponent in the samenavbar.tsxfile, indicating a direct connection in terms of changes made to the navigation structure. - #3815: This PR updates the
Navbarcomponent to replace theTwitterIconwithXIcon, reflecting modifications to the navigation links, similar to the addition of the "Themes" link in the main PR.
Suggested labels
📋 Scope : Docs
Suggested reviewers
- wingkwong
- jrgarciadev
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Generate unit testing code for this file.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and generate unit testing code.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
@wingkwong I fixed the ts error and also implemented the feedback from coderabbitai, but the new reviews from coderabbit ai feels a little bit overkill and don't think they improve the quality of code. I don't find that level of abstraction needed for this simple case.
Let me know if there is anything else I need to handle.
Thanks. We'll review gradually.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| nextui-docs-v2 | ❌ Failed (Inspect) | Oct 13, 2024 7:31am | ||
| nextui-storybook-v2 | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 13, 2024 7:31am |
Hmm...it's weird why it's complaining about brand color not being defined since...since the types seems to be correct. Will look into it.
I'm unable to see why there is a issue with that.
The Config interface looks like this
export interface Config {
light: ConfigColors;
dark: ConfigColors;
layout: ConfigLayout;
}
The ThemeType type loooks like this:
export type ThemeType = "light" | "dark";
And the issue is mentioned in brand-colors.tsx, where it says that config[theme] is undefined, which, based on the types definition of Config and ThemeType it can't be true.
Can it be a Typescript compiler issue or I'm missing something?
So the problem was related to SSR. The theme builder was rendered on server side and because of this some values were initialized with false. I've added a check to render the theme builder only on client side and while the js is loading, a loader is displayed.
The build succeeded. Let me know if there is anything else I need to fix. Thank you!
Hey @xylish7 thanks for this great contribution 🙏🏻 could you please fix the conflicts?
Sure! Will look into it today 👍🏻
@jrgarciadev I've fixed the merge conflicts. Only pnpm-lock.yaml was conflicting.
I also run the build and test command which successfully ran, but there was an error related to the usage of new Image which I haven't touched, so not sure if that was already present or it was because I regenerated the pnpm-lock.yaml file
handled in #4626
Thanks @xylish7 for the amazing work. I have created a new PR to handle this further.
Thanks for your further contributions and improvements. Can't wait to see it in prod!