
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
css-commons
Advanced tools
👨‍👨‍👧‍👧 let's make our css a family again
css-commons aims to reduce the number of orphaned selectors that only contain one rule that is similar to other selectors rules.
npm install css-commons -g
css-commonsis a commonjs module and can be placed as a script inside a page using./dist/css-commons.js(132k) or./dist/css-commons.min.js(42k)
cat main.css > css-commons > main.min.css
const compile = require('css-commons')
const css = `
.alert.alert-black * {
color: #fff;
}
.alert.alert-default {
background-color: #cfcfc4;
border: 1px solid #bdbdae;
}
.alert.alert-default * {
color: #fff;
}
.badge.badge-white {
background-color: #fff;
color: #000;
}
.badge.border-white {
color: #000;
}
.badge.badge-black {
background-color: #000;
color: #fff;
}
.badge.border-black {
color: #000;
}
pre {
display: block;
padding: 10px;
font-size: 13px;
line-height: 1.42857143;
word-break: break-all;
word-wrap: break-word;
white-space: normal;
background-color: #f5f5f5;
border-radius: 5px;
border-left: 0.3rem solid transparent;
}
.grid > .col-1-12 {
width: 8.333333333333332%;
margin-left: 0%;
margin-right: 0%;
}
@media screen and (min-width: 32em) {
.grid > .col-sm-0-12 {
display: none;
}
.grid > .col-sm-1-12 {
width: 8.3333%;
margin-left: 0%;
margin-right: 0%;
}
}
`;
var output = commons(css);
the above snippet will render the resulting css
@media screen and (min-width: 32em) {
.grid>.col-sm-0-12 {
display: none;
}
.grid>.col-sm-1-12 {
width: 8.3333%;
margin-left: 0%;
margin-right: 0%;
}
}
.alert.alert-black *, .alert.alert-default *, .badge.badge-black {
color: #fff;
}
.alert.alert-default {
background-color: #cfcfc4;
border: 1px solid #bdbdae;
}
.badge.badge-white {
background-color: #fff;
}
.badge.badge-white, .badge.border-white, .badge.border-black {
color: #000;
}
.badge.badge-black {
background-color: #000;
}
pre {
display: block;
padding: 10px;
font-size: 13px;
line-height: 1.42857143;
word-break: break-all;
word-wrap: break-word;
white-space: normal;
background-color: #f5f5f5;
border-radius: 5px;
border-left: 0.3rem solid transparent;
}
.grid>.col-1-12 {
width: 8.333333333333332%;
margin-left: 0%;
margin-right: 0%;
}
The rules that contained
color: #fff;orcolor: #000;were combined.
This resulted in a bundle size that weighs in an at
847Bwhich used to be1206B, this is a 29% decrease in overall size.
FAQs
👨‍👨‍👧‍👧 let's make our css a family again
The npm package css-commons receives a total of 4 weekly downloads. As such, css-commons popularity was classified as not popular.
We found that css-commons demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.