Socket
Socket
Sign inDemoInstall

abstractconnect

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abstractconnect

connect designs managed in abstract to your code


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

AbstractConnect

A Design-Token extractor for teams using Abstract & Javascript

NPM Version and link

This package retrieves symbols from a specified sketch file stored in abstract, models the data neatly and transposes sketch format styles into more webdev(tm) friendly values.

Usage

import { getSymbols } from 'abstractconnect';

getSymbols({
  filter: symbol => symbol.name === 'MySymbol'
}).then(({ MySymbol }) => {

  //select your layer by name
  const MyLayer = MySymbol.layers.MyLayerName

  //do whatever it is you want to do with design information
  const someCSS = `
    font-size: ${MyLayer.style.text.fontSize}px;
    background: ${MyLayer.style.background};
  `;

  //etc
});

getSymbols

takes a single parameter, an object with config:

  • filter: expects a standard js filter function
  • raw: set to true to get the 'raw' symbol data from sketch
  • fromSHA: target a specific commit in abstract
  • withFS: force download to FS (ends up in the TEMP_PATH setup var below)

Setup

This package is configured using environment values. Simplest setup is to drop a .env file in your project directory.

ABSTRACT_TOKEN=<YOUR DEVELOPER TOKEN>
ABSTRACT_PROJECT_ID=<YOUR PROJECT ID>
ABSTRACT_FILE_NAME=<THE NAME OF YOUR SKETCH FILE>
ABSTRACT_BRANCH=<OPTIONAL: DEFAULTS TO 'master'>
LOG_LEVEL=<OPTIONAL: to turn off console info add this to equal 'silent'>
TEMP_PATH=<OPTIONAL: DEFAULTS TO <YOURPROJECTPATH>/temp

finding your project id The simplest way to find your project id is to open your project in browser, and collect the id from the url: https://app.abstract.com/projects/<PROJECT_ID>/;

FAQs

Package last updated on 29 Sep 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