Gathering detailed insights and metrics for postcss-utilities
Gathering detailed insights and metrics for postcss-utilities
Gathering detailed insights and metrics for postcss-utilities
Gathering detailed insights and metrics for postcss-utilities
PostCSS plugin to add a collection of mixins, shortcuts, helpers and tools for your CSS
npm install postcss-utilities
Typescript
Module System
Node Version
NPM Version
83.7
Supply Chain
98.8
Quality
75.8
Maintenance
50
Vulnerability
100
License
JavaScript (67.19%)
CSS (32.81%)
Total Downloads
1,643,733
Last Day
112
Last Week
5,542
Last Month
23,869
Last Year
320,519
MIT License
325 Stars
53 Commits
11 Forks
6 Watchers
12 Branches
6 Contributors
Updated on Jun 19, 2025
Minified
Minified + Gzipped
Latest Version
0.8.4
Package Id
postcss-utilities@0.8.4
Size
22.95 kB
NPM Version
6.9.0
Node Version
10.15.3
Published on
Jul 31, 2019
Cumulative downloads
Total Downloads
Last Day
-22.2%
112
Compared to previous day
Last Week
-7.5%
5,542
Compared to previous week
Last Month
-21.9%
23,869
Compared to previous month
Last Year
81.7%
320,519
Compared to previous year
2
4
postcss-utilities is a PostCSS plugin that includes the most commonly used mixins, shortcuts and helpers. It's as easy as specifying @util utility-name
in your stylesheet, and postcss-utilities will handle the rest for you.
PostCSS has a lot of plugins and some of them use non-standard CSS properties to work as mixins or helpers. This is not a best way for a PostCSS plugin, because developers will not understand what is the source of this property.
"This plugin saves us from many tiny plugins with unknown properties" ‒@ai proposal postcss/issues/645
There are lot of Sass Mixins Libraries (over 65!), but postcss-utilities makes the difference. All mixins and helpers are built with JavaScript and you can add to your workflow with ease, as simple as adding autoprefixer or many others useful PostCSS plugins.
You can forget about copy mixins from project to project and focus on write your project specific mixins and use this plugin for the most generic helpers.
IMPORTANT: The list of utilities is open for suggestions.
1 2.cfx { 3 @util clearfix; 4} 5 6.rounded-top { 7 @util border-top-radius(4px); 8} 9 10@util no-hover { 11 .box { 12 background-color: #666; 13 } 14} 15
1 2.cfx:after { 3 content: ''; 4 display: block; 5 clear: both; 6} 7 8.rounded-top { 9 border-top-left-radius: 4px; 10 border-top-right-radius: 4px; 11} 12 13.no-hover .box { 14 background-color: #666; 15} 16
Using PostCSS CLI you can do the following:
Install postcss-cli
and the plugin on your project directory:
npm install postcss-cli postcss-utilities --save-dev
Add a postcss
script to your package.json
:
1"scripts": { 2 "postcss": "postcss input.css -u postcss-utilities -o output.css" 3}
After this, you can run npm run postcss
and transform your input.css
into output.css
.
styled-jsx allows you to use full, scoped and component-friendly CSS in your JSX (rendered on the server or the client) and you can add @util
rules with postcss-utilities
.
npm install --save styled-jsx styled-jsx-plugin-postcss postcss-utilities
Add postcss
config in your package.json
:
1"postcss": { 2 "plugins": { 3 "postcss-utilities": {} 4 } 5}
Add styled-jsx/babel
to plugins in your babel configuration:
1{ 2 "plugins": [ 3 "styled-jsx/babel" 4 ] 5}
Then write @util
rules in your code:
1export default () => ( 2 <div> 3 <p>only this paragraph will get the style :)</p> 4 5 <style jsx>{` 6 p { 7 color: red; 8 @util center; 9 } 10 `}</style> 11 </div> 12)
1postcss([ require('postcss-utilities')({ /* options*/ }) ])
See PostCSS docs for examples of your environment.
Type: string
Default: .no-hover
To use with no-hover
utility
Type: string
Default: .no-js
To use with no-js
utility
Type: boolean
Default: false
Set true
to use clearfix
method IE8 compatible
Type: string
Default: transform
Values: ['transform'|'flexbox']
To use with center
utility
Type: string
Default: indent
Values: ['indent'|'font']
To use with text-hide
utility
The list of utilities is open for suggestions.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 3/25 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
32 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More