-
Notifications
You must be signed in to change notification settings - Fork 7
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
docs(styled-system): color mode #33
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Looks good. requested a change about the color mode script
### Adding the `ColorModeScript` | ||
|
||
The color mode script needs to be added before the content inside the `body` tag | ||
for local storage syncing to work correctly. | ||
|
||
This script will be added automatically by Chakra UI Vue. | ||
|
||
> To use `ColorModeScript` on a site with strict `Content-Security-Policy`, you | ||
> can use the `nonce` prop that will be passed to the `<script>` tag. |
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.
Let's remove this section. The user doesn't need to know about it. 👍🏽
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.
Updated
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.
Looks good. requested a change about the color mode script
scenarios, you might need to make your component respond to color mode. | ||
|
||
> **Tip:** Chakra stores the color mode in `localStorage` or in `cookies` and appends a | ||
> className to the `body` to ensure the color mode is persistent. |
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.
> className to the `body` to ensure the color mode is persistent. | |
> class to the `body` to ensure the color mode is persistent. |
Maybe this is better since it's not React ?
Here's an example that changes the `background-color` and `color` using the | ||
`useColorModeValue` composable. | ||
|
||
```js |
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.
```js | |
```vue |
Or html works
`useColorMode` is a composable that gives you access to the current color mode, | ||
and a function to toggle the color mode. | ||
|
||
```js |
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.
```js | |
```vue |
@carwack Looks good, great work ! I just added a few comments, nothing important, just some nitpicks |
Docs for Color mode in Chakra UI Vue.
Color Mode components are not completely working so far, testing out here: https://codesandbox.io/p/sandbox/intelligent-carlos-oyji8q?file=%2Fsrc%2Fcomponents%2FHelloChakra.vue%3A22%2C21