-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
docs: add /apply-theme route with customizing theme feature #4292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/chakra-ui/chakra-ui/2e2RPcapcXZDHfHY32EBVBLy3zCD [Deployment for d419af3 failed] |
This pull request introduces 4 alerts when merging 24331ed into a08da46 - view on LGTM.com new alerts:
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit d419af3:
|
website/pages/apply-theme.tsx
Outdated
import PageContainer from "components/page-container" | ||
import Sidebar from "components/sidebar/sidebar" | ||
import { getRoutes } from "layouts/mdx" | ||
import _ from "lodash" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use import { last } from 'lodash'
or import last from 'lodash.last'
as you'd otherwise import the entirety of lodash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ljosberinn Got it and I will update it. Forgot that we don't have babel-plugin-lodash
setup here.
I noticed that there are some other places of website
that import _ from "lodash"
directly so I assume it's okay do to so. I could fix those places in another PR for sure :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched to import last from 'lodash/last'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, I've created a PR to take care of existing imports: #4318
@@ -0,0 +1,229 @@ | |||
import { useRouter } from "next/router" | |||
import _ from "lodash" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here :)
Thank you, this is a great idea! |
Hi @tomchentw! I'd like to echo @ljosberinn here and say that this is a really cool idea. I'd like to take responsibility for thoroughly reviewing this and helping shape this into a solid feature for the site. Busy this morning but I will have time either later today or tomorrow to dig in. Thanks for working on this! |
This pull request introduces 4 alerts when merging 3aa8527 into a08da46 - view on LGTM.com new alerts:
|
3aa8527
to
959bc54
Compare
This pull request introduces 4 alerts when merging 959bc54 into 7d9cb19 - view on LGTM.com new alerts:
|
959bc54
to
d419af3
Compare
This pull request introduces 4 alerts when merging d419af3 into ae27d4f - view on LGTM.com new alerts:
|
This is an awesome idea. I think it makes sense to have it be a separate app or playground so that users can play with it in isolation. I don't think it's something we want to add to the docs directly. Please consider setting this up in a different URL and we can link to it in the docs. Thanks for taking the time to work on this. |
📝 Description
This PR adds the
/apply-theme
route to the official v1 docs site. It allows user to try customizing theme directly on the v1 docs site.🚀 New behavior
This is fairly useful for the users to experiment with Chakra-UI. It also provides a way for organization users to create a public Gist that hosts their design system, saving their needs to create a forked Chakra-UI documentation site.
To get started, the user has two different ways to interact with this route:
Furthermore, it features storing the Gist Id or the code string in the
localStorage
, giving the flexibility of visiting the docs site.Last, when importing the Gist ID, it stores the Gist ID to the query param so that you could share the URL to someone else directly:
💣 Is this a breaking change (Yes/No):
No
📝 Additional Information