Skip to content
forked from acss-io/atomizer

A tool for creating Atomic CSS, a collection of single purpose styling units for maximum reuse

License

Notifications You must be signed in to change notification settings

seodom/atomizer

 
 

Repository files navigation

Atomizer

npm version Build Status Dependency Status devDependency Status Coverage Status

Overview

Atomizer is a tool that helps you create Atomic CSS rules.

Atomic CSS is a collection of single purpose styling units for maximum reuse that fits well with components in templated frameworks such as React, Ember or Angular. For more information we recommend that you read "Challenging CSS best practices" or watch the Atomic CSS presentation.

Install

npm install atomizer -g

Usage

CLI

atomizer [-c|--config=<file>] [-o|--outfile=<file>] [--rtl] [--help] [--verbose] [ [-R] files_to_parse ...]

Example:

atomizer -o atomic.css ./site/*.html
atomizer -c config.js -R ./site/ > atomic.css
atomizer -c config.js > atomic.css


API

var Atomizer = require('atomizer');

var defaultConfig = {
    "breakPoints": {
        'sm': '750px',
        'md': '1000px',
        'lg': '1200px'
    },
    "border": {
        "custom": [
            {
                "suffix": "1",
                "values": [ "1px solid #000" ]
            },
            {
                "suffix": "foo",
                "values": [ "2px dotted #f00" ],
                "breakPoints": ['sm', 'md']
            }
        ]
    }
};

// Parse text to find Atomic CSS classes
var classes = Atomizer.parse('<div class="P-10px M-20% B-1"></div>');

// Generate Atomizer configuration from an array of Atomic classnames
var config = Atomizer.getConfig(classes, defaultConfig);

// Generate Atomic CSS from configuration
var css = Atomizer.createCSS(config);

Developer docs

We have wiki docs for contributors who want to help with the maintenance and development of this tool.

License

This software is free to use under the Yahoo Inc. BSD license. See the LICENSE file for license text and copyright information.

Third-party open source code used are listed in our package.json file.

About

A tool for creating Atomic CSS, a collection of single purpose styling units for maximum reuse

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%