Skip to content

Commit 9e7fe85

Browse files
authored
Add instructions for previewing generated CSS to CONTRIBUTING
1 parent 039d9a5 commit 9e7fe85

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/CONTRIBUTING.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,34 @@ npm test
3131
```
3232

3333
Please ensure that the tests are passing when submitting a pull request. If you're adding new features to Tailwind, please include tests.
34+
35+
## Building the CSS and trying your changes manually
36+
37+
In addition to the automated tests, if you'd like to test the generated CSS manually with your own test HTML file, you can generate the default build by running:
38+
39+
```sh
40+
npm run prepare
41+
```
42+
43+
This will create new CSS files in the `/dist` folder which you can reference in your own test HTML file. We often test our own changes by creating an `index.html` file in the root of the Tailwind project itself that pulls in the `/dist/tailwind.css` stylesheet:
44+
45+
```html
46+
<!doctype html>
47+
<html lang="en">
48+
<head>
49+
<meta charset="utf-8">
50+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
51+
<link rel="stylesheet" href="/dist/tailwind.css">
52+
<title>Hello, world!</title>
53+
</head>
54+
<body>
55+
<h1 class="text-2xl font-bold text-center">Hello world!</h1>
56+
</body>
57+
</html>
58+
````
59+
60+
You can then use a tool like [live-server](https://www.npmjs.com/package/live-server) to preview it in the browser:
61+
62+
```sh
63+
live-server .
64+
```

0 commit comments

Comments
 (0)