Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cooltilities

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

cooltilities

Some simple, common style utilities to use with composable css-in-js libraries.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

cooltilities

Some simple, common style utilities to use with composable css-in-js libraries like emotion and vudu.

Usage

Basic

cooltilities returns an object with an assortment of color and layout utilities. To see them all, check out the docs.

import cooltilities from 'cooltilities'

console.log(cooltilities)

// returns {
//    block: { display: 'block' },
//    flex: { display: 'flex' },
//    r0: { right: 0 },
//    ...etc,
// }
Custom Colors

If you'd like to generate utilities for custom colors, cooltilities can be configured with a colors object and will return all the utilities including your custom colors.

import { generate } from 'cooltilities'

console.log(generate({ red: 'red' }))

// returns {
//    block: { display: 'block' },
//    flex: { display: 'flex' },
//    red: { color: 'red' },
//    bgRed: { backgroundColor: 'red' },
//    ...etc,
// }

Examples

emotion

import c from 'cooltilities'
import { css } from 'emotion'
import styled from 'react-emotion'

const Component = styled('div')(css(c.flex, c.alignCenter, c.justifyCenter))

vudu

import c from 'cooltilities'
import v from 'vudu'

const styles = v({
  component: { '@composes': [c.flex, c.alignCenter, c.justifyCenter] }
})

const Component = ({ children }) => (
  <div className={styles.component}>{children}</div>
)

Documentation

Documentation can be found at: https://lalena-co.github.io/cooltilities/

Note

All documentation follows jsDoc and can be regenerated using documentation.js, by typing the following in Terminal:

npm run docs:build

Or if you'd like to keep it running while you work:

npm run docs:build:watch

Keywords

FAQs

Package last updated on 02 Jun 2018

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