Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Repo Case:
module_load_include('inc', 'advagg', 'advagg.missing');
$filename = 'modules/simpletest/files/css_test_files/css_input_without_import.css.optimized.css';
$css = file_get_contents($filename);
$parsed = advagg_parse_media_blocks($css);
echo httprl_pr($css, $parsed);
Outputs:
Array (
[0] => body{margin:0;padding:0;background:#edf5fa;font:76%/170% Verdana,sans-serif;color:#494949;}.this .is .a .test{font:1em/100% Verdana,sans-serif;color:#494949;}.this
.is
.a
.test{font:1em/100% Verdana,sans-serif;color:#494949;}some :pseudo .thing{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;filter:progid:DXImageTransform.Microsoft.Shadow(color=#000000,direction='180',strength='10');-ms-filter:"progid:DXImageTransform.Microsoft.Shadow(color=#000000,direction='180',strength='10')";}::-moz-selection{background:#000;color:#fff;}::selection{background:#000;color:#fff;}
[1] => @media print{*{background:#000 !important;color:#fff !important;}@page{margin:0.5cm;}}@
[2] => media screen and (max-device-width:480px){background:#000;color:#fff;}textarea,select{font:1em/160% Verdana,sans-serif;color:#494949;}
[3] => @media screen and (max-device-width:480px){background:#000;color:#fff;}t
[4] => extarea,select{font:1em/160% Verdana,sans-serif;color:#494949;}
)
Should Output:
Array (
[0] => body{margin:0;padding:0;background:#edf5fa;font:76%/170% Verdana,sans-serif;color:#494949;}.this .is .a .test{font:1em/100% Verdana,sans-serif;color:#494949;}.this
.is
.a
.test{font:1em/100% Verdana,sans-serif;color:#494949;}some :pseudo .thing{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;filter:progid:DXImageTransform.Microsoft.Shadow(color=#000000,direction='180',strength='10');-ms-filter:"progid:DXImageTransform.Microsoft.Shadow(color=#000000,direction='180',strength='10')";}::-moz-selection{background:#000;color:#fff;}::selection{background:#000;color:#fff;}
[1] => @media print{*{background:#000 !important;color:#fff !important;}@page{margin:0.5cm;}}
[2] => @media screen and (max-device-width:480px){background:#000;color:#fff;}
[3] => textarea,select{font:1em/160% Verdana,sans-serif;color:#494949;}
)
Comment | File | Size | Author |
---|---|---|---|
#1 | advagg-2124391-1-fix-off-by-one-media.patch | 915 bytes | mikeytown2 |
Comments
Comment #1
mikeytown2 CreditAttribution: mikeytown2 commentedFollowing patch has been committed.
Comment #1.0
mikeytown2 CreditAttribution: mikeytown2 commentedUpdated issue summary.