Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit bcd4c0c

Browse files
committed
docs(features): fix pr comments
1 parent 434dc2a commit bcd4c0c

File tree

5 files changed

+33
-33
lines changed

5 files changed

+33
-33
lines changed

docs/pages/features/chakra-factory.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Chakra Factory
22

3-
Chakra factory serves as an **object of chakra enabled JSX elements**, and also
3+
Chakra factory serves as an **object of chakra enabled HTML elements**, and also
44
**a function that can be used to enable custom component** to receive chakra's
55
style props.
66

@@ -14,7 +14,7 @@ Create base HTML elements with theme-aware style props using `chakra.<element>`
1414
notation. For example, if you want a plain HTML button with the ability to pass
1515
chakra styles, you can write `<chakra.button />`.
1616
17-
```jsx
17+
```vue
1818
<chakra.button
1919
px="3"
2020
py="2"
@@ -31,16 +31,16 @@ syntax is available for common HTML elements. See the reference for the full
3131
[list of elements](https://github.com/chakra-ui/chakra-ui/blob/main/packages/system/src/system.utils.ts#L9)
3232
supported.
3333
34-
```jsx
34+
```vue
3535
<chakra.h1 fontSize="lg"> Heading </chakra.h1>
3636
```
3737
3838
## Chakra factory function
3939
40-
This is a function that converts **non-chakra components** or **jsx element** to
40+
This is a function that converts **non-chakra components** or **HTML element** to
4141
chakra-enabled components so you can pass style props to them.
4242
43-
Consider a package called `my-awesome-components`, let's use the chakra factory
43+
Consider a component called `my-awesome-component`, let's use the chakra factory
4444
function to make it possible to pass style props.
4545
4646
The function will infer the prop types from the wrapped component and also add
@@ -67,7 +67,7 @@ chakra style props.
6767
In some instances, you might need to attach specific styles to the component
6868
wrapped in the chakra factory
6969
70-
```jsx
70+
```vue
7171
const ChakraAwesomeComponent = chakra(awesomeComponent, {
7272
baseStyle: {
7373
bg: "papayawhip",
@@ -76,9 +76,9 @@ const ChakraAwesomeComponent = chakra(awesomeComponent, {
7676
})
7777
```
7878
79-
You can also use the chakra factory on jsx-elements as well.
79+
You can also use the chakra factory on HTML elements as well.
8080
81-
```jsx
81+
```vue
8282
const Card = chakra("div", {
8383
baseStyle: {
8484
shadow: "lg",
@@ -95,7 +95,7 @@ with theme-aware style props using `chakra.<element>` notation.
9595
In your `main.ts` file make sure to import the chakra object from the '@chakra-ui/vue-next' package.
9696
Use a forEach() function to loop over all the dom elements and push them through the factory function (chakra()).
9797
98-
```jsx
98+
```vue
9999
import { createApp } from 'vue'
100100
import App from './App.vue'
101101
import ChakraUIVuePlugin, { chakra } from '@chakra-ui/vue-next'

docs/pages/features/css-variables.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ default theme) to CSS variables internally so you don't have to.
2828

2929
Given a theme object that looks like this:
3030

31-
```jsx live=false
31+
```js
3232
const theme = {
3333
fontSizes: {
3434
lg: '18px',
@@ -61,7 +61,7 @@ CSS variables that look like:
6161
When using Chakra's components, we manage the conversion of theme tokens to
6262
their respective CSS variable.
6363

64-
```jsx live=false
64+
```vue
6565
// You type this
6666
<c-box color="gray.100" />
6767
@@ -78,7 +78,7 @@ their respective CSS variable.
7878
In certain scenarios, you might need to style components that are not managed by
7979
Chakra. In this case, you can use the raw CSS variable values.
8080

81-
```jsx live=false
81+
```vue
8282
// let's say you have an embedded form
8383
<FormiumForm />
8484
```
@@ -94,7 +94,7 @@ You can write custom CSS to style the components
9494

9595
or wrap the component in `<c-box/>` and style it with convenience.
9696

97-
```jsx live=false
97+
```vue
9898
<c-box :sx="{ '.formium': { bg: 'gray.50', color: 'gray.700' } }">
9999
<FormiumForm />
100100
</c-box>
@@ -108,7 +108,7 @@ When using the `sx` prop or components created with the `chakra` factory,
108108
you can create variables that reference theme tokens. This makes it possible to change property values
109109
based on breakpoint, or light/dark mode with ease.
110110

111-
```jsx live=false
111+
```vue
112112
<c-box
113113
:sx="{
114114
// "colors.gray.100" is shorthand for `var(--chakra-colors-gray.100)`

docs/pages/features/gradient.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Let's create a basic gradient from `green.200` to `pink.500`
5050

5151
You can use both theme-aware color tokens or raw CSS color values.
5252

53-
```jsx
53+
```vue
5454
<c-box w="100%" h="200px" bgGradient="linear(to-l, #7928CA, #FF0080)" />
5555
```
5656

@@ -59,7 +59,7 @@ You can use both theme-aware color tokens or raw CSS color values.
5959
By adding more color-stop points on the gradient line, you can create a highly
6060
customized transition between multiple colors.
6161

62-
```jsx
62+
```vue
6363
<c-box
6464
w="100%"
6565
h="200px"
@@ -70,7 +70,7 @@ customized transition between multiple colors.
7070
Following the CSS gradient specification, you can also define the distribution
7171
of the color stops
7272

73-
```jsx
73+
```vue
7474
<c-box
7575
w="100%"
7676
h="200px"
@@ -83,7 +83,7 @@ of the color stops
8383
To add a text gradient, pass the `bgGradient` following the API and `bgClip`
8484
prop to `text`.
8585

86-
```jsx
86+
```vue
8787
<c-text
8888
bgGradient="linear(to-l, #7928CA, #FF0080)"
8989
bgClip="text"
@@ -99,7 +99,7 @@ prop to `text`.
9999
You can control the responsiveness of gradients by specifying the gradients at
100100
the different breakpoints.
101101

102-
```jsx
102+
```vue
103103
<c-box
104104
w="100%"
105105
h="200px"
@@ -118,7 +118,7 @@ You can change the gradient of an element based on common CSS pseudo attributes
118118

119119
For example, on hover, add the gradient you wish to have.
120120

121-
```jsx
121+
```vue
122122
<c-box
123123
as="button"
124124
p="4"

docs/pages/features/responsive-styles.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ is the recommended method.
3131

3232
Let's say you have a `Box` with the following properties:
3333

34-
```jsx live=false
34+
```vue
3535
<c-box bg="red.200" w="400px">
3636
This is a box
3737
</c-box>
@@ -40,7 +40,7 @@ Let's say you have a `Box` with the following properties:
4040
To make the `width` or `w` responsive using the array syntax, here's what you
4141
need to do:
4242

43-
```jsx live=false
43+
```vue
4444
<c-box bg="red.200" :w=[300, 400, 500]>
4545
This is a box
4646
</c-box>
@@ -82,14 +82,14 @@ undefined alias key will define the base, non-responsive value.
8282

8383
Let's say you have a `Text` that looks like this:
8484

85-
```jsx live=false
85+
```vue
8686
<c-text fontSize="40px">This is a text</c-text>
8787
```
8888

8989
To make the `fontSize` responsive using the object syntax, here's what you need
9090
to do:
9191

92-
```jsx live=false
92+
```vue
9393
<c-text :fontSize={ base: "24px", md: "40px", lg: "56px" }>
9494
This is responsive text
9595
</c-text>
@@ -109,8 +109,8 @@ Here's how to interpret this syntax:
109109
This works for every style prop in the theme specification, which means you can
110110
change the style of most properties at a given breakpoint.
111111

112-
```jsx live=false
113-
<>
112+
```vue
113+
<template>
114114
<c-box
115115
:height={
116116
base: "100%", // 0-48em
@@ -133,15 +133,15 @@ change the style of most properties at a given breakpoint.
133133
<c-box bg="papayawhip" :p=[2, 4, 6, 8]>
134134
Padding
135135
</c-box>
136-
</>
136+
</template>
137137
```
138138

139139
## Under the hood
140140

141141
This shortcut is an alternative to writing media queries out by hand. Given the
142142
following:
143143

144-
```jsx live=false
144+
```vue
145145
<c-box :width=[1, 1 / 2, 1 / 4] />
146146
or
147147
<c-box :width="['100%', 0.5, 0.25]" />
@@ -199,7 +199,7 @@ To define custom breakpoints, install `@chakra-ui/theme-tools`, and use the
199199
> Note: Ensure the css unit of your breakpoints are the same. Use all `px` or
200200
> all `em`, don't mix them.
201201
202-
```jsx live=false
202+
```vue
203203
// 1. Import the utilities
204204
import { extendTheme } from "@chakra-ui/vue-next"
205205
import { createBreakpoints } from "@chakra-ui/theme-tools"

docs/pages/features/text-and-layer-styles.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Text and Layer Styles
22

3-
In most projects you might find yourself repeating specific text properties
3+
In most projects, you might find yourself repeating specific text properties
44
(font size, font weight, line height) or layer properties (bg, color, shadow).
55
This can be painful as your project grows in size.
66

@@ -11,7 +11,7 @@ consistent.
1111

1212
Layer Styles allow you to save a combination of styling attributes to re-use in
1313
other components. Once created, pass the `layerStyle` prop to any component and
14-
chakra will resolve the styles accordingly.
14+
Chakra will resolve the styles accordingly.
1515

1616
Properties defined in a layer style
1717

@@ -21,7 +21,7 @@ Properties defined in a layer style
2121
- Box shadow
2222
- Opacity
2323

24-
```jsx live=false
24+
```vue
2525
// 1. Import `extendTheme`
2626
import { extendTheme } from '@chakra-ui/vue-next'
2727
@@ -79,7 +79,7 @@ Properties defined in a text style
7979
- Text decoration (strikethrough and underline)
8080
- Text transform (uppercase, lowercase, and capitalization)
8181

82-
```jsx live=false
82+
```vue
8383
// 1. Import `extendTheme`
8484
import { extendTheme } from '@chakra-ui/vue-next'
8585

0 commit comments

Comments
 (0)