mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
chore(docs): formatting + supplement tw upgrade (#5492)
* chore(docs): formatting * chore(docs): formatting * fix(docs): remove extra semicolon * chore(docs): supplement TW4 upgrade content * chore(docs): remove duplicate content * chore(docs): add missing semicolons
This commit is contained in:
parent
5f2bec5b65
commit
29b415d65a
@ -197,7 +197,7 @@ and add the following code to your main css file:
|
|||||||
@plugin './hero.ts';
|
@plugin './hero.ts';
|
||||||
/* Note: You may need to change the path to fit your project structure */
|
/* Note: You may need to change the path to fit your project structure */
|
||||||
@source '../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}';
|
@source '../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}';
|
||||||
@custom-variant dark (&:is(.dark *))
|
@custom-variant dark (&:is(.dark *));
|
||||||
```
|
```
|
||||||
|
|
||||||
### Setup Provider
|
### Setup Provider
|
||||||
@ -437,7 +437,7 @@ and add the following code to your main css file:
|
|||||||
@plugin './hero.ts';
|
@plugin './hero.ts';
|
||||||
/* Note: You may need to change the path to fit your project structure */
|
/* Note: You may need to change the path to fit your project structure */
|
||||||
@source '../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}';
|
@source '../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}';
|
||||||
@custom-variant dark (&:is(.dark *))
|
@custom-variant dark (&:is(.dark *));
|
||||||
```
|
```
|
||||||
|
|
||||||
### Setup Provider
|
### Setup Provider
|
||||||
|
|||||||
@ -170,7 +170,7 @@ and add the following code to your main css file:
|
|||||||
@plugin './hero.ts';
|
@plugin './hero.ts';
|
||||||
/* Note: You may need to change the path to fit your project structure */
|
/* Note: You may need to change the path to fit your project structure */
|
||||||
@source '../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}';
|
@source '../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}';
|
||||||
@custom-variant dark (&:is(.dark *))
|
@custom-variant dark (&:is(.dark *));
|
||||||
```
|
```
|
||||||
|
|
||||||
### Provider Setup
|
### Provider Setup
|
||||||
|
|||||||
@ -184,7 +184,7 @@ and add the following code to your main css file:
|
|||||||
@plugin './hero.ts';
|
@plugin './hero.ts';
|
||||||
/* Note: You may need to change the path to fit your project structure */
|
/* Note: You may need to change the path to fit your project structure */
|
||||||
@source '../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}';
|
@source '../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}';
|
||||||
@custom-variant dark (&:is(.dark *))
|
@custom-variant dark (&:is(.dark *));
|
||||||
```
|
```
|
||||||
|
|
||||||
### Provider Setup
|
### Provider Setup
|
||||||
|
|||||||
@ -176,9 +176,9 @@ and add the following code to your main css file:
|
|||||||
```css
|
```css
|
||||||
@import "tailwindcss";
|
@import "tailwindcss";
|
||||||
@plugin './hero.ts';
|
@plugin './hero.ts';
|
||||||
// Note: You may need to change the path to fit your project structure
|
/* Note: You may need to change the path to fit your project structure */
|
||||||
@source '../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}';
|
@source '../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}';
|
||||||
@custom-variant dark (&:is(.dark *))
|
@custom-variant dark (&:is(.dark *));
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Provider Setup
|
#### Provider Setup
|
||||||
|
|||||||
@ -34,25 +34,27 @@ TailwindCSS v4 is now available since 2.8.0! This guide will help you migrate yo
|
|||||||
|
|
||||||
Since Tailwind v4 favors a CSS-first approach, `tailwind.config.js` will not be required.
|
Since Tailwind v4 favors a CSS-first approach, `tailwind.config.js` will not be required.
|
||||||
|
|
||||||
Create `hero.ts` file
|
Create `hero.ts` file to export `heroui` plugin.
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
// hero.ts
|
// hero.ts
|
||||||
import { heroui } from "@heroui/react";
|
import { heroui } from "@heroui/react";
|
||||||
|
// or import from theme package if you are using individual packages.
|
||||||
|
// import { heroui } from "@heroui/theme";
|
||||||
export default heroui();
|
export default heroui();
|
||||||
```
|
```
|
||||||
|
|
||||||
Update your main css file
|
Update your main css file as below
|
||||||
|
|
||||||
```diff-js
|
```diff-css
|
||||||
// your main css file
|
/* your main css file */
|
||||||
- @tailwind base;
|
- @tailwind base;
|
||||||
- @tailwind components;
|
- @tailwind components;
|
||||||
- @tailwind utilities;
|
- @tailwind utilities;
|
||||||
|
|
||||||
+ @import "tailwindcss";
|
+ @import "tailwindcss";
|
||||||
+ @plugin './hero.ts';
|
+ @plugin './hero.ts';
|
||||||
// Note: You may need to change the path to fit your project structure
|
/* Note: You may need to change the path to fit your project structure */
|
||||||
+ @source '../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}';
|
+ @source '../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}';
|
||||||
+ @custom-variant dark (&:is(.dark *));
|
+ @custom-variant dark (&:is(.dark *));
|
||||||
```
|
```
|
||||||
@ -61,19 +63,22 @@ Update your main css file
|
|||||||
|
|
||||||
In Tailwind v4, `tailwind.config.js` is still supported for backward compatibility. If you still need to use it, you can load it explicity as below.
|
In Tailwind v4, `tailwind.config.js` is still supported for backward compatibility. If you still need to use it, you can load it explicity as below.
|
||||||
|
|
||||||
```diff-js
|
```diff-css
|
||||||
// your main css file
|
/* your main css file */
|
||||||
- @tailwind base;
|
- @tailwind base;
|
||||||
- @tailwind components;
|
- @tailwind components;
|
||||||
- @tailwind utilities;
|
- @tailwind utilities;
|
||||||
|
|
||||||
+ @import "tailwindcss";
|
+ @import "tailwindcss";
|
||||||
// Note: You may need to change the path to fit your project structure
|
/* Note: You may need to change the path to fit your project structure */
|
||||||
+ @config "../../tailwind.config.js";
|
+ @config "../../tailwind.config.js";
|
||||||
```
|
```
|
||||||
|
|
||||||
### Update PostCSS Configuration
|
### Update PostCSS Configuration
|
||||||
|
|
||||||
|
- `tailwindcss` was a PostCSS plugin in v3 and now it is in `@tailwindcss/postcss` package.
|
||||||
|
- `autoprefixer` is no longer required as prefixing is handled automatically.
|
||||||
|
|
||||||
```diff-js
|
```diff-js
|
||||||
// postcss.config.js
|
// postcss.config.js
|
||||||
- export default {
|
- export default {
|
||||||
|
|||||||
@ -108,7 +108,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
"h2 small": {
|
"h2 small": {
|
||||||
fontSize: 'var(--text-lg);',
|
fontSize: 'var(--text-lg);',
|
||||||
lineHeight: 'var(--text-lg--line-height););',
|
lineHeight: 'var(--text-lg--line-height);',
|
||||||
},
|
},
|
||||||
"h3 small": {
|
"h3 small": {
|
||||||
fontSize: 'var(--text-base); ',
|
fontSize: 'var(--text-base); ',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user