You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+16-20
Original file line number
Diff line number
Diff line change
@@ -134,41 +134,37 @@ alias PetalComponents.Button
134
134
```
135
135
136
136
**Q: Does this increase my CSS filesize?**
137
-
A: Tailwind will scan any folders you specify and hoover up CSS classes from files to include in your final CSS file. You specify the folders in `tailwind.config.js`. By default, we instruct you to just scan the whole Petal Components library:
137
+
A: Tailwind will scan any folders you specify and hoover up CSS classes from files to include in your final CSS file. You specify the folders in `assets/app.css`. By default, we instruct you to just scan the whole Petal Components library:
138
138
139
-
```js
140
-
constcolors=require("tailwindcss/colors");
141
-
142
-
module.exports= {
143
-
purge: [
144
-
"../lib/*_web/**/*.*ex",
145
-
"./js/**/*.js",
139
+
```css
140
+
@import"tailwindcss";
146
141
147
-
// We need to include the Petal dependency so the classes get picked up by JIT.
You might be worried that if you don't use every component you'll have unused CSS classes. But we believe it's so small it won't matter. Our petal.build site's CSS file totals just 25kb.
155
149
156
150
If you really want to you can instruct Tailwind to just scan the components you use:
157
151
158
-
```
159
-
"../deps/petal_components/lib/button.ex",
160
-
"../deps/petal_components/lib/alert.ex",
152
+
```css
153
+
@source"../deps/petal_components/lib/button.ex",
154
+
@source "../deps/petal_components/lib/alert.ex",
161
155
```
162
156
163
157
**Q: Can I customize the components?**
164
158
A: Yes! You can customize the components by overriding the CSS classes. For example, if you want to change the color of the button you can do this:
Copy file name to clipboardexpand all lines: UPGRADE_GUIDE.md
+8-8
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ mix tailwind.install
38
38
39
39
`tailwind.config.js` is now considered legacy and is no longer automatically loaded. However, it is still supported and you can manually load it by adding the following to your `app.css`:
40
40
41
-
```CSS
41
+
```css
42
42
@config "../tailwind.config.js";
43
43
```
44
44
@@ -50,7 +50,7 @@ Here are some tips on how to integrate Petal Components if you are no longer usi
50
50
51
51
To reference Petal Components CSS and include it as a source for Tailwind utility classes, use the `@source` and `@import` directives:
52
52
53
-
```CSS
53
+
```css
54
54
@import"tailwindcss";
55
55
56
56
@source "../../deps/petal_components/**/*.*ex";
@@ -59,13 +59,13 @@ To reference Petal Components CSS and include it as a source for Tailwind utilit
59
59
60
60
The CSS file equivalent of `darkMode: 'class'` is:
61
61
62
-
```CSS
62
+
```css
63
63
@custom-variant dark (&:where(.dark, .dark *));
64
64
```
65
65
66
66
In Tailwind 4 buttons now use `cursor: default` instead of `cursor: pointer`. If you would like the old behaviour:
67
67
68
-
```CSS
68
+
```css
69
69
@layer base {
70
70
/* Use the pointer for buttons */
71
71
button:not(:disabled),
@@ -77,13 +77,13 @@ In Tailwind 4 buttons now use `cursor: default` instead of `cursor: pointer`. If
77
77
78
78
To configure Petal Component colours add an `@import`:
79
79
80
-
```CSS
80
+
```css
81
81
@import"./colors.css";
82
82
```
83
83
84
84
Then create the `colors.css` file:
85
85
86
-
```CSS
86
+
```css
87
87
@theme inline {
88
88
--color-primary-50: var(--color-blue-50);
89
89
--color-primary-100: var(--color-blue-100);
@@ -173,14 +173,14 @@ Then create the `colors.css` file:
0 commit comments