Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-button

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-button

A PostCSS plugin to create buttons.

  • 0.2.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
34
increased by6.25%
Maintainers
1
Weekly downloads
 
Created
Source

postcss-button

npm version Build Status Dependency Status

francoisromain.github.io/postcss-button

A PostCSS plugin to create buttons.


Examples

There are two ways to declare a button:

With an atRule declaration
@button big-button {
  button-border-width: 1px;
  button-color: orange;
  button-background-color: white;
  button-border-color: silver;
  button-color-hover: white;
  button-background-color-hover: orange;
  button-border-color-hover: orange;
  button-color-active: white;
  button-background-color-active: silver;
  button-border-color-active: silver;
  button-class-active: active;
  button-class-disabled: disabled;
}
.my-button {
  button: big-button;
}
With specific declarations
.your-button {
  button-color: skyblue white white;
  button-background: white skyblue silver;
  button-border: 4px skyblue skyblue silver;
  button-classes: active diabled;
}

01: input, output, markup, demo

02: input, output, markup, demo


Installation

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…


Configuration (optional)

@button ([name]) {
  button-color: grey;
  button-background-color: white;
  button-color-active: white;
  button-background-color-active: grey;
  button-border-width: 0;
  button-border-color: grey;
  button-border-color-active: black;
  button-class-active: active;
  button-class-disabled: disabled;
}
  • name (optional): custom identifier. If no name is provided, the default settings are overwritten.

Usage

Name

button: [name];

  • name: string identifier referring to a settings atRule. Set to default to use default settings.

Color

button-color: [color] ([color-active]) ([color-hover]);

  • color: button text color.
  • color-active (optional): button text color when active.
  • color-hover (optional): button text color on mouseover.

Background color

button-background: [background-color] ([background-color-active]) ([background-color-hover]);

  • background-color (optional): button background color.
  • background-color-active (optional): button background color when active.
  • background-color-hover (optional): button background color on mouseover.

Border

button-border: [width] ([border-color]) ([border-color-active]) ([border-color-hover]);

  • width: width of the border.
  • border-color (optional): color of the border.
  • border-color-active (optional): color of the border when active.
  • _border-color-hover (optional): color of the border on mouseover.

Classes

button-classes: [active] ([disabled]);

  • active: class name to apply the active styles.
  • disabled (optional): class name to apply the disabled styles.

Missing declarations fallback to the default settings.

Keywords

FAQs

Package last updated on 10 Oct 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc