Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
postcss-button
Advanced tools
francoisromain.github.io/postcss-button
A PostCSS plugin to create buttons.
This plugin handles a lot of repetetive css code necessary to create clean buttons. It also uses box-shadow
to create borders which respect the vertical rythm.
There are two ways to declare a button:
.my-button-class {
/* short-hand syntax example */
/* color: default | active | hover */
button-color: skyblue white white;
/* background-color: default | active | hover */
button-background: white skyblue silver;
/* border: size | default | active | hover */
button-border: 4px skyblue skyblue silver;
/* classes: active class name | disabled class name | apply classes and pseudo classes to the parent selector */
button-class: active disabled true;
}
@button my-button-name {
/* detailed-syntax example */
/* color */
button-color: orange;
button-color-active: white;
button-color-hover: white;
/* background-color */
button-background-color: white;
button-background-color-active: silver;
button-background-color-hover: orange;
/* border */
button-border-width: 1px;
button-border-color: silver;
button-border-color-active: silver;
button-border-color-hover: orange;
/* classes */
button-class-active: active;
button-class-disabled: disabled;
button-class-parent: true;
}
.my-button-class {
button: my-button-name;
}
01: input, output, markup, demo
02: input, output, markup, demo
Install the npm package:
$ npm install postcss-button --save-dev
Require the PostCSS plugin:
postcss([ require('postcss-button') ])
See PostCSS docs to setup with Gulp, Grunt, Webpack, npm scripts…
@button ([name]) {
[button-rules…]
}
.my-class {
button: [name];
}
.my-class {
[button-rules…]
}
button-color-active: [color];
button-color-hover: [color];
/* short-hand syntax */
button-color: [color] ([color-active]) ([color-hover]);
button-background-active: [color];
button-background-hover: [color];
/* short-hand syntax */
button-background: [background-color] ([background-color-active]) ([background-color-hover]);
button-border-width: [width];
button-border-color: [color];
button-border-color-active: [color];
button-border-color-hover: [color];
/* short-hand syntax */
button-border: [width] ([border-color]) ([border-color-active]) ([border-color-hover]);
button-class-active: [class-name];
button-class-disbaled: [class-name];
button-class-parent: [boolean];
/* short-hand syntax */
button-class: [active] ([disabled]) ([parent]);`
Missing declarations fallback to the default settings.
0.3.0
button-class-parent: true
. Default to false. See test 08.FAQs
A PostCSS plugin to create buttons.
The npm package postcss-button receives a total of 31 weekly downloads. As such, postcss-button popularity was classified as not popular.
We found that postcss-button 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.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.