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

@budiq/design-tokens

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

@budiq/design-tokens

Visual primitives such as typography, color, and spacing that are shared across platforms.

  • 5.3.0
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@sumup/design-tokens

Visual primitives such as typography, color, and spacing that are shared across platforms.

Stars Version Coverage License Contributor Covenant

Installation

Depending on your preference, run one of the following in your terminal:

# With npm
npm install @sumup/design-tokens

# With yarn v1
yarn add @sumup/design-tokens

Usage

The package currently exports a single light theme that is meant to be used with SumUp's React component library, Circuit UI. Pass the theme to Emotion's ThemeProvider:

import { light } from '@sumup/design-tokens';
import { ThemeProvider } from '@emotion/react';
import styled from '@emotion/styled';

const Bold = styled.strong`
  font-weight: ${(p) => p.theme.fontWeight.bold};
`;

const App = () => (
  <ThemeProvider theme={light}>
    <Bold>This styled component has access to the theme.</Bold>
  </ThemeProvider>
);

The theme is a plain JavaScript object, so you can use it in other ways, too.

With prop types

The package exports a themePropType which can be used to check the theme prop:

import PropTypes from 'prop-types';
import { withTheme } from '@emotion/react';
import { themePropType } from '@sumup/design-tokens';

function ComponentWithInlineStyles({ theme, label }) {
  return <div style={{ color: theme.colors.p500 }}>{label}</div>;
}

ComponentWithInlineStyles.propTypes = {
  theme: themePropType.isRequired,
  label: PropTypes.string,
};

export default function withTheme(ComponentWithInlineStyles);

With TypeScript

The package exports a Theme interface which can be used to type Emotion's styled function. Create a custom styled instance as described in the Emotion docs:

import styled, { CreateStyled } from '@emotion/styled';
import { Theme } from '@sumup/design-tokens';

export default styled as CreateStyled<Theme>;

FAQs

Package last updated on 24 Jun 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

  • 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