Socket
Book a DemoInstallSign in
Socket

@overdose/theme

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@overdose/theme

A bunch of CSS vars for use with Overdose components

1.1.0
latest
npmnpm
Version published
Weekly downloads
243
109.48%
Maintainers
1
Weekly downloads
 
Created
Source

Theme

A CSS based theming engine for use with Overdose Figma design tokens.

Usage

yarn add @overdose/theme
yarn add @overdose/design-tokens-transformer -D

1. Import the CSS directly into your project:

// JavaScript/TypeScript

import '@overdose/theme/styles.css'
/* CSS */

@import '@overdose/theme/styles.css';

2. Generate project design tokens

Tokens from @overdose/theme work best with CSS variables generated from Figma. Check the @overdose/design-tokens-transformer docs for more information.

  • Export design tokens from Figma using the Design Tokens plugin. Save the exported design-tokens.tokens.json file in your project.
  • Generate tokens with:
yarn transform-design-tokens build -s "<SOURCE_PATH>" -d "<DESTINATION_PATH>"

For example:

yarn transform-design-tokens build -s "./theme/tokens/design-tokens.tokens.json" -d "./theme/__generated__/"

3. Import the generated CSS variables into your app

// JavaScript/TypeScript

import '@overdose/theme/styles.css'
import 'theme/__generated__/_tokens.css'
/* CSS */

@import '@overdose/theme/styles.css';
@import 'theme/__generated__/_tokens.css';

3. Overwrite specific variables

Variables can be overwritten when the default value is not appropriate for your project.

@import '@overdose/theme/styles.css';

:root {
  --btn-border-radius-default: 4px;
}

Check out the pwa monorepo for a full list of available variables.

FAQs

Package last updated on 22 Nov 2023

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.