Skip to content

Commit

Permalink
Merge pull request jorenvanhee#7 from julianstark999/indicator-prefix
Browse files Browse the repository at this point in the history
Add ability to modify indicator prefix
  • Loading branch information
jorenvanhee authored Nov 23, 2020
2 parents b94fdbb + 84b6459 commit 96b9e95
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,21 @@ module.exports = {
],
}
```

#### Prefix

Modify the debug label prefix with the `prefix` configuration option.

```js
// tailwind.config.js
module.exports = {
theme: {
debugScreens: {
prefix: 'screen: ',
},
},
plugins: [
require('tailwindcss-debug-screens'),
],
}
```
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module.exports = function ({ addComponents, theme }) {
const screens = theme('screens');
const userStyles = theme('debugScreens.style', {});
const ignoredScreens = theme('debugScreens.ignore', [])
const prefix = theme('debugScreens.prefix', 'screen: ');

const defaultPosition = ['bottom', 'left'];
const position = theme('debugScreens.position', defaultPosition);
Expand All @@ -21,7 +22,7 @@ module.exports = function ({ addComponents, theme }) {
backgroundColor: '#000',
color: '#fff',
boxShadow: '0 0 0 1px #fff',
content: `'screen: _'`,
content: `'${prefix}_'`,
}, userStyles),
};

Expand All @@ -30,7 +31,7 @@ module.exports = function ({ addComponents, theme }) {
.forEach(([screen]) => {
components[`@screen ${screen}`] = {
'.debug-screens::before': {
content: `'screen: ${screen}'`,
content: `'${prefix}${screen}'`,
},
};
});
Expand Down

0 comments on commit 96b9e95

Please sign in to comment.