Skip to content

Commit f521a96

Browse files
committed
add prefix documentation
1 parent c14f9b2 commit f521a96

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ plugins: [
3535
]
3636
```
3737

38+
If you want to prefix your CSS classes, use the tailwind prefix option:
39+
40+
```js
41+
// tailwind.config.js
42+
module.exports = {
43+
prefix: 'tw-',
44+
// ...
45+
}
46+
```
3847
### Adjustable, optional settings
3948
* ```animatedSpeed``` used for the animationDuration of the .animated class
4049
* ```heartBeat``` used for the animationDuration of the .heartBeat class

animate/animate.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const keyframesFadeIn = require('./keyframes/fadeIn');
1414
const keyframesFadeOut = require('./keyframes/fadeOut');
1515

1616
module.exports = function ({ settings = {}, variants = ['responsive'] }) {
17-
return function ({ e, addUtilities }) {
17+
return function ({ e, addUtilities, prefix }) {
1818

1919
// set fallback if speed not defined
2020
const animatedSpeed = settings.animatedSpeed ? settings.animatedSpeed : 1000;
@@ -306,7 +306,12 @@ module.exports = function ({ settings = {}, variants = ['responsive'] }) {
306306
'.fadeOutUpBig': {
307307
animationName: 'fadeOutUpBig'
308308
},
309-
}, { variants, respectImportant: false });
309+
}, {
310+
variants,
311+
respectPrefix: true,
312+
respectImportant: false
313+
}
314+
);
310315

311316
addUtilities({
312317
'@keyframes bounce': keyframes.keyframeBounce,
@@ -387,6 +392,9 @@ module.exports = function ({ settings = {}, variants = ['responsive'] }) {
387392
'@keyframes fadeOutRightBig': keyframesFadeOut.keyframeFadeOutRightBig,
388393
'@keyframes fadeOutUp': keyframesFadeOut.keyframeFadeOutUp,
389394
'@keyframes fadeOutUpBig': keyframesFadeOut.keyframeFadeOutUpBig
390-
}, { respectImportant: false });
395+
}, {
396+
respectPrefix: true,
397+
respectImportant: false
398+
});
391399
};
392400
};

0 commit comments

Comments
 (0)