New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

scss-theo-importer

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scss-theo-importer

Basic importer for using Theo design token files directly in Sass

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

scss-theo-importer

Basic importer for using Theo design token files directly in Sass

Intention

Design tokens are great - but they are better when they can be used invisibly by a variety of consumers. This Sass importer allows you to import design token files (either yml or json), formatted according to https://github.com/salesforce-ux/theo, directly in Sass, with the tokens converted into Sass variables.

Installation

npm install scss-theo-importer

Usage

// .sassrc.js

const theoImporter = require('scss-theo-importer')

module.exports = {
	importer: [theoImporter()],
}
# src/tokens/_color.theo.yml

props:
    color-background:
        value: '{!gray}'
aliases:
    gray: '#eff4f6'
global:
    type: color
    category: color


# src/tokens/index.theo.yml

imports:
  - ./_color.theo.scss
// src/app.scss

@import './tokens/index.theo.yml';

body {
	background-color: $color-background;
}

Options

The theoImporter function takes an optional object argument with the following possible props:

opts.matcher

The regex used to match token filenames

  • type: RegExp
  • default: /\.theo\.(ya?ml|json)$/

opts.transform

The transform passed to the underlying Theo conversion (file is added dynamically)

opts.format

The format passed to the underlying Theo conversion

Keywords

FAQs

Package last updated on 24 Mar 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc