Git Product home page Git Product logo

accoutrement's Introduction

Sass Accoutrement

Build Status

Robust design systems require meaningful, readable, reusable code. These Sass utilities are designed to help define and manage your design tokens (colors, fonts, sizes, etc.) in a format that can be understood by both humans and parsers -- opening the door for automation, while improving consistency and readability. These tools also integrate with Herman, our automated living pattern-library generator built on SassDoc.

Brought to you by OddBird -- the creators of Susy, True, and Herman.

Installation

Install the package with npm or yarn

npm install accoutrement [--save-dev]
yarn add accoutrement [--dev]

Import what you need:

// core and all plugins (also available with `/index`)
@import '<path-to>/accoutrement/sass/tools';

// init normalization
@import '<path-to>/accoutrement/sass/init';

// individual plugins (core is required)
@import '<path-to>/accoutrement/sass/core';
@import '<path-to>/accoutrement/sass/plugin/<name>';

If you're using Eyeglass, you can import the default "tools" (core + plugins) using only:

@import 'accoutrement';

Usage

The accoutrement tools are built around a shared data-storage syntax using Sass "map" objects:

$map: (
  'root': 16px,
  'gutter': 1em,
);

Using a custom syntax, we can extend maps to handle internal reference, and functional adjustments -- capturing meaningful relationships between design tokens:

$map: (
  'root': 16px,

  // internal reference & adjustments
  'gutter': '#root' ('_major-third': 1, 'convert-units': 'rem'),
);

Map storage serves a larger purpose:

  • Related data is grouped explicitly, making the code more readable and maintainable
  • The "single source of truth" encourages reusable design patterns
  • Meaningful structure allows automation, from automated style guides to automated functionality (provided in the plugins)

The Core module provides the generic (non data-specific) setup and syntax parsing:

We provide light-weight browser-normalization, as a distinct include. This is not part of the accoutrement/sass/tools package because it is the only module to produce direct CSS output.

Plugins…

While the core module handles generic data-management, we also provide plugins for a few common data types:

  • Animate -- Tools for managing CSS transitions and animations
  • Color -- Tools for managing CSS colors and contrast-ratios
  • Scale -- Tools for managing CSS sizes: typographic scales, spacing, etc.
  • Type -- Tools for managing webfonts, generated content, and other text needs

accoutrement's People

Contributors

mirisuzanne avatar joelschou avatar jgerigmeyer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.