stylelint-apply-multiline
v1.0.1
Published
A Stylelint plugin to enforce and autofix multiline formatting for Tailwind CSS @apply rules
Maintainers
Readme
stylelint-apply-multiline
A Stylelint plugin to enforce and autofix multiline formatting for Tailwind CSS @apply rules.
Installation
npm install --save-dev stylelint-apply-multiline⚙️ Usage
Add the plugin to your .stylelintrc.js:
module.exports = {
plugins: ["stylelint-apply-multiline"],
rules: {
"tailwind/apply-multiline": [
true,
{
indent: 4, // spaces to indent utilities (default: 2)
mergeConsecutive: true, // merge multiple @apply rules (default: true)
},
],
},
};Example
Input:
.btn {
@apply px-4 py-2;
@apply bg-blue-500;
}Output:
.btn {
@apply px-4
py-2
bg-blue-500;
}Options
| Option | Type | Default | Description |
| ------------------ | --------- | ------- | ----------------------------------------- |
| indent | number | 2 | Spaces used for indentation |
| mergeConsecutive | boolean | true | Merge consecutive @apply rules into one |
