You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
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.1.0
Source
npmnpm
Version published
Weekly downloads
1.9K
29.81%
Maintainers
1
Weekly downloads
 
Created
Source

postcss-button Build Status

francoisromain.github.io/postcss-button

A PostCSS plugin to create buttons.

Installation

Install the npm module:

$ 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)

The default settings can be overrided with an atrule:


@button {
  color: grey;
  background-color: white;
  color-active: black;
  background-color-active: silver;
  border-width: 0;
  border-style: none;
  border-color: grey;
  border-color-active: black;
  border-radius: 0;
  class-active: active;
  class-disabled: disabled;
}

Usage

There are two ways of declaring a button:

  • With an atRule declaration
  • With specific declarations

With an atRule declaration

@button [name] {
  color: grey;
  background-color: white;
  color-active: black;
  background-color-active: silver;
  border-width: 0;
  border-style: none;
  border-color: grey;
  border-color-active: black;
  border-radius: 0;
  class-active: active;
  class-disabled: disabled;
}

.my-button {
  button: [name]
}
  • name: custom identifier

With specific declarations

.my-button {
  button-color: [color] [background-color] [color-active] [background-color-active];
  button-border: [width] [style] [color] [color-active];
  button-radius: [size];
  button-classes: [active] [disabled];
}

Missing declarations will use the default settings.

Example: input, output, markup, demo

Keywords

postcss

FAQs

Package last updated on 25 Apr 2016

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