🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

minify-css-string

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

minify-css-string

Remove new lines and extra space from a string of css.

1.0.0
latest
Source
npm
Version published
Weekly downloads
13K
-26.57%
Maintainers
1
Weekly downloads
 
Created
Source

minify-css-string

npm travis standard

Remove new lines and extra space from a string of css.

Install

npm i minify-css-string

Usage

import { default as minifyCssString } from 'minify-css-string'

const cssString = `
  @-webkit-keyframes react-fade-in {
    0%   { opacity: 0; }
    50%  { opacity: 0; }
    100% { opacity: 1; }
  }

  @-moz-keyframes react-fade-in {
    0%   { opacity: 0; }
    50%  { opacity: 0; }
    100% { opacity: 1; }
  }

  @-ms-keyframes react-fade-in {
    0%   { opacity: 0; }
    50%  { opacity: 0; }
    100% { opacity: 1; }
  }

  @keyframes react-fade-in {
    0%   { opacity: 0; }
    50%  { opacity: 0; }
    100% { opacity: 1; }
  }
`

<style>
  {minifyCssString(cssString)}
</style>

/* minifyCssString(cssString) === `@-webkit-keyframes react-fade-in { 0% { opacity: 0; } 50% { opacity: 0; } 100% { opacity: 1; } } @-moz-keyframes react-fade-in { 0% { opacity: 0; } 50% { opacity: 0; } 100% { opacity: 1; } } @-ms-keyframes react-fade-in { 0% { opacity: 0; } 50% { opacity: 0; } 100% { opacity: 1; } } @keyframes react-fade-in { 0% { opacity: 0; } 50% { opacity: 0; } 100% { opacity: 1; } }` */

Contributing

Contributions welcome! Please read the contributing guidelines first.

License

ISC

Keywords

css

FAQs

Package last updated on 12 Jul 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