Socket
Book a DemoInstallSign in
Socket

tack-css

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

tack-css

On the fly pseudo-class generation for functional CSS.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

tack

NPM version

On the fly pseudo-class generation for functional CSS.

This package allows you to generate pseudo-class variations of CSS classes at runtime. When used with Tachyons or Basscss, it entirely alleviates the need for pseudo-class specific selectors.

Installation

$ npm install --save tack-css

Usage

First, import tack:

import tack from 'tack-css';

After your functional styles are loaded, call tack.hash to seed the style index:

tack.hash();

The tack function takes a pseudo-class and a list of CSS classes and returns a list of generated CSS classes that target the pseudo-class.

tack('hover', 'b--blue', 'blue') // => 'b--blue--tack-hover blue--tack-hover'

The specific permutation of pseudo-class and CSS classes are generated and added to the DOM the first time tack sees them. They are re-used afterwards.

License

MIT © Justin Vaillancourt

Keywords

react

FAQs

Package last updated on 06 Nov 2016

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