File tree 2 files changed +87
-0
lines changed
2 files changed +87
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Tailwind CSS Debug Screens 📱
2
+
3
+ A Tailwind CSS component that shows the currently active screen (responsive breakpoint).
4
+
5
+ [ Demo] ( https://joren.co/tailwindcss-debug-screens-demo/ )
6
+
7
+ <img src =" screenshot.png " width =" 534 " >
8
+
9
+ ## Install
10
+
11
+ Requires ** Tailwind v1.0** or higher.
12
+
13
+ 1 . Install the plugin:
14
+
15
+ ``` bash
16
+ npm install tailwindcss-debug-screens --save-dev
17
+ ```
18
+
19
+ 2 . Add it to your ` tailwind.config.js ` file:
20
+
21
+ ``` js
22
+ // tailwind.config.js
23
+ module .exports = {
24
+ // ...
25
+ plugins: [
26
+ require (' tailwindcss-debug-screens' ),
27
+ ]
28
+ }
29
+ ```
30
+
31
+ ## Usage
32
+
33
+ Add the class ` debug-screens ` to your ` <body> ` tag.
34
+
35
+ ``` html
36
+ <body class =" debug-screens" >
37
+ ```
38
+
39
+ Make sure the class is only present during development. Here's an example of how you could do that in Craft CMS:
40
+
41
+ ``` twig
42
+ <body class="{{ devMode ? 'debug-screens' : '' }}">
43
+ ```
44
+
45
+ ### Custimization
46
+
47
+ You can customize the position and styles in the ` theme.debugScreens ` section of your ` tailwind.config.js ` file.
48
+
49
+ #### Position
50
+
51
+ The first item of the position configuration array can be ` top ` or ` bottom ` , the second item can be ` left ` or ` right ` .
52
+
53
+ ``` js
54
+ // tailwind.config.js
55
+ module .exports = {
56
+ theme: {
57
+ debugScreens: {
58
+ position: [' bottom' , ' left' ],
59
+ },
60
+ },
61
+ plugins: [
62
+ require (' tailwindcss-debug-screens' ),
63
+ ],
64
+ }
65
+ ```
66
+
67
+ #### Styles
68
+
69
+ Take a look at the [ index.js] ( index.js ) file to see all the default styles.
70
+
71
+ ``` js
72
+ // tailwind.config.js
73
+ module .exports = {
74
+ theme: {
75
+ debugScreens: {
76
+ style: {
77
+ backgroundColor: ' #C0FFEE' ,
78
+ color: ' black' ,
79
+ // ...
80
+ },
81
+ },
82
+ },
83
+ plugins: [
84
+ require (' tailwindcss-debug-screens' ),
85
+ ],
86
+ }
87
+ ```
You can’t perform that action at this time.
0 commit comments