File tree Expand file tree Collapse file tree 1 file changed +28
-15
lines changed Expand file tree Collapse file tree 1 file changed +28
-15
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,17 @@ npm install tailwindcss-rfs
15
15
```
16
16
17
17
## Usage
18
- 1 . Add ` tailwindcss-rfs ` to the plugins array of your Tailwind config
19
- 2 . Add the ` rfs ` variant to the desired core plugins
18
+ Add ` tailwindcss-rfs ` to the plugins array of your Tailwind config:
19
+
20
+ ``` js
21
+ module .exports = {
22
+ plugins: [
23
+ require (' tailwindcss-rfs' )
24
+ ],
25
+ }
26
+ ```
27
+
28
+ If you are running a Tailwind CSS version ` lower than v3.0 ` , you also have to add the ` rfs ` variant to the desired core plugins:
20
29
21
30
``` js
22
31
// tailwind.config.js
@@ -36,22 +45,18 @@ module.exports = {
36
45
}
37
46
```
38
47
39
- ## Example Output
40
- ``` css
41
- /* Original */
42
-
43
- .text-6xl {
44
- font-size : 3.75rem ;
45
- line-height : 1 ;
46
- }
47
-
48
- .p-24 {
49
- padding : 6rem ;
50
- }
48
+ Simply apply the ` rfs ` variant to any sizing utility. This will pass utility's value to the ` rfs() ` function and output the processed value.
51
49
50
+ ** Template:**
51
+ ``` html
52
+ <div class =" rfs:p-24" >
53
+ <p class =" rfs:text-6xl" >This text resizes magically!</p >
54
+ </div >
55
+ ```
52
56
53
- /* RFS Variant */
57
+ ** Output: **
54
58
59
+ ``` css
55
60
.rfs\: text-6xl {
56
61
font-size : calc (1.5rem + 3vw );
57
62
line-height : 1 ;
@@ -61,3 +66,11 @@ module.exports = {
61
66
padding : calc (1.725rem + 5.7vw );
62
67
}
63
68
```
69
+
70
+ If you are on Tailwind CSS ` 3.0+ ` you may also stack the ` rfs ` variant with other variants like ` hover ` :
71
+
72
+ ``` html
73
+ <div class =" rfs:p-24 hover:rfs:p-20" >
74
+ <p class =" rfs:text-6xl hover:rfs:text-5xl" >This text resizes magically!</p >
75
+ </div >
76
+ ```
You can’t perform that action at this time.
0 commit comments