Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

docs(styled-system): color mode #33

wants to merge 6 commits into from

Conversation

carwack
Copy link
Collaborator

@carwack carwack commented May 19, 2023

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

@vercel
Copy link

vercel bot commented May 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
vue-docs-next ✅ Ready (Inspect) Visit Preview Jun 10, 2023 3:13pm

@carwack carwack self-assigned this May 19, 2023
Copy link
Collaborator

@codebender828 codebender828 left a 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

Comment on lines 139 to 147
### 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.
Copy link
Collaborator

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. 👍🏽

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated

Copy link
Collaborator

@codebender828 codebender828 left a 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

codebender828

This comment was marked as duplicate.

codebender828

This comment was marked as duplicate.

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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
> 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
```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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
```js
```vue

@Shyrro
Copy link
Contributor

Shyrro commented May 31, 2023

@carwack Looks good, great work ! I just added a few comments, nothing important, just some nitpicks

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