@tempera/stylelint-tokens

0.2.0 • Public • Published

stylelint-tokens

A Stylelint plugin that helps avoid the adoption of unofficial design specifications.

Installation

yarn add @tempera/stylelint-tokens

Usage

Install Stylelint and update your configuration file to utilize the plugin.

// stylelint.config.js
const tokens = require("./fixtures/example-tokens");

module.exports = {
  // ...
  plugins: ["@tempera/stylelint-tokens"],
  rules: {
    "@tempera/official-specs": tokens,
  },
};

Tokens

The plugin expects these tokens to be in the javascript/es6 format which you can generate using Style Dictionary except exported as CommonJS modules.

In other words, flat CommonJS modules in PascalCase are expected.

Example:

module.exports.ColorBackgroundBase = "#ffffff";
module.exports.ColorBackgroundAlt = "#fcfcfcfc";

Support for tokens in ES6 format is on the roadmap.

View the source)

Package Sidebar

Install

npm i @tempera/stylelint-tokens

Weekly Downloads

1

Version

0.2.0

License

MIT

Unpacked Size

12.4 kB

Total Files

9

Last publish

Collaborators

  • mike1765