Skip to content

bentatum/minify-css-string

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published