mrclay / minify

Combines. minifies, and serves CSS or Javascript files
BSD 3-Clause "New" or "Revised" License
3.01k stars 472 forks source link

HTML Minify putting Bootstrap 4 styles inline #644

Closed rafaelcavalcanti closed 5 years ago

rafaelcavalcanti commented 5 years ago

Hi, For example, using Bootstrap 4 css minify code:

<style type="text/css"> :root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace} </style>

Causing error when its passing through:

$this->_html = preg_replace_callback( '/\\s*<style(\\b[^>]*>)([\\s\\S]*?)<\\/style>\\s*/iu' ,array($this, '_removeStyleCB') ,$this->_html);

I cant use the tag '' in this time, what can i do? Thanks.

rafaelcavalcanti commented 5 years ago

In fact, is when i user the whole code inside the bootstrap.min.css

Thanks

rafaelcavalcanti commented 5 years ago

I split the code in two '