Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit 078a4a8

Browse files
committed
Add purgecss info
1 parent bc4b9a3 commit 078a4a8

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

docs/advanced-usage/_index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: Advanced Usage
3+
sort: 5
4+
---

docs/advanced-usage/purge-css.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: Purge CSS
3+
sort: 1
4+
---
5+
6+
## Production Use
7+
8+
Purge CSS is useful for trimming out unused styles from your stylesheets to reduce your overall build size. To ensure
9+
the class styles from this package don't get purged from your production build, you should add the following to your
10+
purge css content configuration:
11+
12+
> {note} The following code snippet is for a TailwindCSS build configuration using a `tailwind.config.js` file in the build.
13+
14+
```js
15+
module.exports = {
16+
// ...
17+
purge: {
18+
content: [
19+
// Typical laravel app purge css content
20+
'./app/**/*.php',
21+
'./resources/**/*.php',
22+
'./resources/**/*.js',
23+
24+
// Make sure you add these lines
25+
'./vendor/rawilk/laravel-form-components/src/**/*.php',
26+
'./vendor/rawilk/laravel-form-components/resources/**/*.php',
27+
],
28+
},
29+
};
30+
```
31+
32+
If some styles are still being purged, it may be useful to wrap the import statement of the package's stylesheet
33+
in a `/* purgecss start ignore */`:
34+
35+
```css
36+
/* purgecss start ignore */
37+
@import "../../vendor/rawilk/laravel-form-components/resources/sass/form-components";
38+
/* purgecss end ignore */
39+
```
40+
41+
> {tip} Please refer to [styling](/docs/laravel-form-components/v3/installation#styling) for more information.

0 commit comments

Comments
 (0)