Socket
Socket
Sign inDemoInstall

@vtex/admin-styles

Package Overview
Dependencies
81
Maintainers
68
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @vtex/admin-styles

> the vtex admin css-in-js style parser


Version published
Maintainers
68
Created

Readme

Source

admin styles

the vtex admin css-in-js style parser

NPM

Summary

This package is responsible to:

  1. Define the VTEX admin theme structure
  2. Parse the StyleProp to the a emotion ObjectStyle

Installation

yarn add @vtex/admin-styles

Usage

Define a theme object that respect's the defined shape of the Theme type, and call the styles function:

import { styles, Theme } from '@vtex/admin-styles'

const theme: Theme = {
  colors: {
    dark: {
      primary: 'black',
      secondary: 'silver',
    },
  },
}

styles({
  bg: 'dark.primary',
  color: 'dark.secondary',
})(theme)

// returns { backgroundColor: 'black', color: 'silver' }

You can also use emotion to style your react components after parse.

import { css } from '@emotion/css'
import { styles, Theme } from '@vtex/admin-styles'

const theme: Theme = {
  colors: {
    dark: {
      primary: 'black',
      secondary: 'silver',
    },
  },
}

const styles = styles({
  bg: 'dark.primary',
  color: 'dark.secondary',
})(theme)

/** compiled className */
const className = css(styles)

render(<div className={className} />)

FAQs

Last updated on 01 Feb 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc