Skip to content

Commit c542d14

Browse files
committed
docs(examples): add react example
1 parent 2ea9eca commit c542d14

19 files changed

+96194
-2
lines changed

examples/with-react/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*

examples/with-react/README.md

Lines changed: 89 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,90 @@
1-
# React example
1+
# White React
22

3-
Soon
3+
This example uses React (created with `create-react-app`), and has the ability to toggle between themes, apart from showing a page with a nested section with dark theme. It shows you can use not only entire themed pages, but also themed sections, inside other themed sections!
4+
5+
Another feature of this example is that it detects automatically the user's preferred theme.
6+
7+
### Test it
8+
9+
Clone the repo:
10+
11+
```sh
12+
git clone https://github.com/estevanmaito/tailwindcss-multi-theme.git
13+
```
14+
15+
Enter the project folder and execute it:
16+
17+
```sh
18+
cd tailwindcss-multi-theme/examples/with-react
19+
npm install
20+
npm start
21+
```
22+
23+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
24+
25+
## Available Scripts
26+
27+
In the project directory, you can run:
28+
29+
### `npm start`
30+
31+
Runs the app in the development mode.<br />
32+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
33+
34+
The page will reload if you make edits.<br />
35+
You will also see any lint errors in the console.
36+
37+
### `npm test`
38+
39+
Launches the test runner in the interactive watch mode.<br />
40+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
41+
42+
### `npm run build`
43+
44+
Builds the app for production to the `build` folder.<br />
45+
It correctly bundles React in production mode and optimizes the build for the best performance.
46+
47+
The build is minified and the filenames include the hashes.<br />
48+
Your app is ready to be deployed!
49+
50+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
51+
52+
### `npm run eject`
53+
54+
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
55+
56+
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
57+
58+
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
59+
60+
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
61+
62+
## Learn More
63+
64+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
65+
66+
To learn React, check out the [React documentation](https://reactjs.org/).
67+
68+
### Code Splitting
69+
70+
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
71+
72+
### Analyzing the Bundle Size
73+
74+
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
75+
76+
### Making a Progressive Web App
77+
78+
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
79+
80+
### Advanced Configuration
81+
82+
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
83+
84+
### Deployment
85+
86+
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
87+
88+
### `npm run build` fails to minify
89+
90+
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

0 commit comments

Comments
 (0)