Socket
Book a DemoInstallSign in
Socket

@amendable/colors-polished

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amendable/colors-polished

This is a drop-in replacement of [@amendable/colors](https://github.com/amendable/colors) that also adds support for [polished](https://polished.js.org) color transforms. You can now write `primary-darken10` and it will just work.

0.5.0
latest
Source
npmnpm
Version published
Maintainers
3
Created
Source

Colors Polished

This is a drop-in replacement of @amendable/colors that also adds support for polished color transforms. You can now write primary-darken10 and it will just work.

Usage

All polished values that go from 0 to 1 in this resolver syntax goes from 0 to 100. So if you want to transform with darken(0.5, 'red') you have to write red-darken50.

import { render } from 'react-dom'
import Box, { AmendableProvider } from '@amendable/core'
import colorsPolished from '@amendable/colors-polished'
import inlineStyles from '@amendable/inline-styles'

render(
  <AmendableProvider
    resolvers={[
      colorsPolished({ colors: { primary: '#0055ff', red: '#F5BCCF' } }),
      inlineStyles(),
    ]}
  >
    <Box color='primary-darken10' backgroundColor='red'>
      Primary color, darkened by 10 percent
    </Box>
  </AmendableProvider>
)

Note

You can both create your own color names or redefine existing CSS colors (like red, blue, etc.)

Supported props

The same props that @amendable/colors support.

Supported Polished color transforms

Transform chaining

This resolver also supports transform chaining:

// you can even write this if you'd like:
color='primary-opacify10-darken50-invert'

FAQs

Package last updated on 10 May 2021

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.