Skip to content

Commit 9b2f6ea

Browse files
committed
Add ability to ignore specific screens
1 parent a8a342b commit 9b2f6ea

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

README.md

+19
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,22 @@ module.exports = {
8585
],
8686
}
8787
```
88+
89+
#### Ignoring Screens
90+
91+
In some cases, like a custom screen media query, it can be helpful to ignore a specific screen. In that case
92+
add the screen name to the `ignore` configuration array.
93+
94+
```js
95+
// tailwind.config.js
96+
module.exports = {
97+
theme: {
98+
debugScreens: {
99+
ignore: ["custom-screen-name"],
100+
},
101+
},
102+
plugins: [
103+
require('tailwindcss-debug-screens'),
104+
],
105+
}
106+
```

index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module.exports = function ({ addComponents, theme }) {
22
const screens = theme('screens');
33
const userStyles = theme('debugScreens.style', {});
4+
const ignore = theme("debugScreens.ignore", [])
45

56
const defaultPosition = ['bottom', 'left'];
67
const position = theme('debugScreens.position', defaultPosition);
@@ -24,7 +25,7 @@ module.exports = function ({ addComponents, theme }) {
2425
}, userStyles),
2526
};
2627

27-
Object.entries(screens).forEach(([screen]) => {
28+
Object.entries(screens).filter(([screen]) => ignore.indexOf(screen) === -1).forEach(([screen]) => {
2829
components[`@screen ${screen}`] = {
2930
'.debug-screens::before': {
3031
content: `'screen: ${screen}'`,

0 commit comments

Comments
 (0)