completed css minifier breaks with a particular rule

SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
I have some print styles in my css, but the minifier doesn't cope with the first rule which causes a little chaos.

The style is this:
@media print {
  *,
  *:before,
  *:after {
    color: #000 !important;
    text-shadow: none !important;
    background: transparent !important;
    -webkit-box-shadow: none !important;
            box-shadow: none !important;
  }
...
Which after minification ends up as this:
@media print {color: #000 !important;text-shadow: none !important;background: transparent !important;-webkit-box-shadow: none !important;box-shadow: none !important;}
...

After some investigation it seems that the print styles themselves are fine, the others work, but the following style from Twitter Bootstrap is broken by the minifier which in my case breaks the surrounding print style:
  *,
  *:before,
  *:after {
    color: #000 !important;
    text-shadow: none !important;
    background: transparent !important;
    -webkit-box-shadow: none !important;
            box-shadow: none !important;
  }



--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

updated by @ultrajam: 01/21/16 03:54:14PM
michael
@michael
10 years ago
7,793 posts
Got a tracker open for this here:
https://www.jamroom.net/the-jamroom-network/tracker/1742/css-minifier-not-compressing-correctly

The work around option would be to attach it as its own sheet, but you knew that already. It should work. Thanks for letting us know about it. :)
SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
Thanks Michael :)


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
brian
@brian
10 years ago
10,149 posts
This is fixed in Core 5.2.40.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
SteveX
SteveX
@ultrajam
10 years ago
2,584 posts
Thank you Brian :)


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

Tags