Skip to content

Commit

Permalink
Rename indicatorPrefix to prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenvanhee committed Nov 23, 2020
1 parent ee7fe31 commit 84b6459
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,16 @@ module.exports = {
}
```

#### Screen Prefix
#### Prefix

To modify the prefix for the screens, add the `indicatorPrefix` configuration.
Modify the debug label prefix with the `prefix` configuration option.

```js
// tailwind.config.js
module.exports = {
theme: {
debugScreens: {
indicatorPrefix: 'screen: ',
prefix: 'screen: ',
},
},
plugins: [
Expand Down
7 changes: 3 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ 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);
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 @@ -23,7 +22,7 @@ module.exports = function ({ addComponents, theme }) {
backgroundColor: '#000',
color: '#fff',
boxShadow: '0 0 0 1px #fff',
content: `'${indicatorPrefix}_'`,
content: `'${prefix}_'`,
}, userStyles),
};

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

0 comments on commit 84b6459

Please sign in to comment.