Skip to content

Commit

Permalink
Add ability to modify indicator prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
julianstark999 committed Nov 18, 2020
1 parent a0b27a9 commit ee7fe31
Show file tree
Hide file tree
Showing 2 changed files with 22 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 = {
],
}
```

#### Screen Prefix

To modify the prefix for the screens, add the `indicatorPrefix` configuration.

```js
// tailwind.config.js
module.exports = {
theme: {
debugScreens: {
indicatorPrefix: 'screen: ',
},
},
plugins: [
require('tailwindcss-debug-screens'),
],
}
```
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ module.exports = function ({ addComponents, theme }) {
const positionY = position[0] || defaultPosition[0];
const positionX = position[1] || defaultPosition[1];

const indicatorPrefix = theme('debugScreens.indicatorPrefix', 'screens: ');

const components = {
'.debug-screens::before': Object.assign({
position: 'fixed',
Expand All @@ -21,7 +23,7 @@ module.exports = function ({ addComponents, theme }) {
backgroundColor: '#000',
color: '#fff',
boxShadow: '0 0 0 1px #fff',
content: `'screen: _'`,
content: `'${indicatorPrefix}_'`,
}, userStyles),
};

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

0 comments on commit ee7fe31

Please sign in to comment.