@jswork/styled-css
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

styled-css

Zero-runtime CSS string creator in JS library.

version license size download

installation

npm install @jswork/styled-css

usage

import css from '@jswork/styled-css';

const bg = '#f00';
const bg_ = '#f50';
const results = css`
  ${bg && 'background: ' + bg + ';'}
  ${bg_ && '> * { background: ' + bg + '; }'}
`;


// results
[
  '\n      ',
  'background: #f00;',
  '\n      ',
  '> * { background: #f00; }',
  '\n    '
] 

license

Code released under the MIT license.

/@jswork/styled-css/

    Package Sidebar

    Install

    npm i @jswork/styled-css

    Weekly Downloads

    0

    Version

    1.0.9

    License

    MIT

    Unpacked Size

    5.52 kB

    Total Files

    7

    Last publish

    Collaborators

    • afeiship