项目作者: jedmao

项目描述 :
PostCSS plugin to insert a circle with color.
高级语言: TypeScript
项目地址: git://github.com/jedmao/postcss-circle.git
创建时间: 2015-07-28T22:04:48Z
项目社区:https://github.com/jedmao/postcss-circle

开源协议:MIT License

下载


postcss-circle

NPM version
npm license
Travis Build Status
codecov
Dependency Status

npm

PostCSS plugin to insert a circle with color.

Introduction

Creating a circle in CSS isn’t terribly difficult; however, it could be easier and more expressive:

  1. .circle {
  2. circle: <diameter> [color];
  3. }

The diameter is required and the color is optional. You don’t have to remember the order, because you can swap their positions.

Let’s create a red circle with a 100px diameter:

  1. .circle {
  2. circle: 100px red;
  3. }

This transpiles into:

  1. .circle {
  2. border-radius: 50%;
  3. width: 100px;
  4. height: 100px;
  5. background-color: red;
  6. }

That’s it, really.

Installation

  1. $ npm install postcss-circle

Usage

JavaScript

  1. postcss([ require('postcss-circle') ]);

TypeScript

  1. import * as postcssCircle from 'postcss-circle';
  2. postcss([ postcssCircle ]);

Options

None at this time.

Testing

Run the following command:

  1. $ npm test

This will build scripts, run tests and generate a code coverage report. Anything less than 100% coverage will throw an error.

Watching

For much faster development cycles, run the following commands in 2 separate processes:

  1. $ npm run build:watch

Compiles TypeScript source into the ./dist folder and watches for changes.

  1. $ npm run watch

Runs the tests in the ./dist folder and watches for changes.