Skip to content

SyberIsle/postcss-at-apply

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@syberisle/postcss-at-apply

PostCSS plugin that allows you to use @apply similar to Tailwind CSS.

Installation

npm install --save-dev @syberisle/postcss-at-apply

Add to your plugins list

module.exports = {
	plugins: {
		"@syberisle/postcss-at-apply": {}
    }
}

Usage

.a { color: red; }
.b { background: blue !important; }
.c { @apply a b; }
.d { @apply !a; }

Results:

.a { color: red; }
.b { background: blue !important; }
.c { color: red; background: blue; }
.d { color: red !important; }

You can prefix ! to a selector in @apply to have !important added to it, otherwise !important is removed.

You may add !important to the end of @apply, and it will be applied to all rules.

About

Process @apply similar to Tailwind CSS

Resources

License

Stars

Watchers

Forks

Packages

No packages published