Skip to content

Commit 96b9e95

Browse files
authored
Merge pull request #7 from julianstark999/indicator-prefix
Add ability to modify indicator prefix
2 parents b94fdbb + 84b6459 commit 96b9e95

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,21 @@ module.exports = {
103103
],
104104
}
105105
```
106+
107+
#### Prefix
108+
109+
Modify the debug label prefix with the `prefix` configuration option.
110+
111+
```js
112+
// tailwind.config.js
113+
module.exports = {
114+
theme: {
115+
debugScreens: {
116+
prefix: 'screen: ',
117+
},
118+
},
119+
plugins: [
120+
require('tailwindcss-debug-screens'),
121+
],
122+
}
123+
```

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module.exports = function ({ addComponents, theme }) {
22
const screens = theme('screens');
33
const userStyles = theme('debugScreens.style', {});
44
const ignoredScreens = theme('debugScreens.ignore', [])
5+
const prefix = theme('debugScreens.prefix', 'screen: ');
56

67
const defaultPosition = ['bottom', 'left'];
78
const position = theme('debugScreens.position', defaultPosition);
@@ -21,7 +22,7 @@ module.exports = function ({ addComponents, theme }) {
2122
backgroundColor: '#000',
2223
color: '#fff',
2324
boxShadow: '0 0 0 1px #fff',
24-
content: `'screen: _'`,
25+
content: `'${prefix}_'`,
2526
}, userStyles),
2627
};
2728

@@ -30,7 +31,7 @@ module.exports = function ({ addComponents, theme }) {
3031
.forEach(([screen]) => {
3132
components[`@screen ${screen}`] = {
3233
'.debug-screens::before': {
33-
content: `'screen: ${screen}'`,
34+
content: `'${prefix}${screen}'`,
3435
},
3536
};
3637
});

0 commit comments

Comments
 (0)