ghinda / css-toggle-switch

Accessible, CSS-only, toggle switches

Home Page:http://ghinda.net/css-toggle-switch/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Request for already minified file in distro

mtgibbs opened this issue · comments

Hey guys,

I have an issue with minifying the content of the 4.0.2 build using Microsoft's MVC Bundler. Could we provide an already minified file in the distro?

/* Minification failed. Returning unminified contents.
(7845,28): run-time error CSS1019: Unexpected token, found '}'
(7854,1): run-time error CSS1019: Unexpected token, found '@-webkit-keyframes'
(7855,8): run-time error CSS1035: Expected colon, found '{'
(9829,1): run-time error CSS1019: Unexpected token, found '@keyframes'
(9830,3): run-time error CSS1062: Expected semicolon or closing curly-brace, found '20%'
(9854,1): run-time error CSS1019: Unexpected token, found '@keyframes'
(9855,3): run-time error CSS1062: Expected semicolon or closing curly-brace, found '0%'
 */

What file is it trying to minify?
Do you know what the MVC Bundler is using for minification? So I can test it on my end.

I would like to avoid including minified files, and rather fix the current dist/ files to work with any minifier.

Thanks for your response.

That makes sense. The MVC bundler is its own implementation as far as I know. I tested minifying this with other tools available and it works, so it could be a problem with their implementation. Heck, it could be a problem with how they're concating the files. If you prefer to make it work with other minifiers, I'll take some time and see if I can make a repro project to make it easy to track down.

I released a new version 4.0.3, built with a newer version of node-sass.
Can you check if you still get the error?

Unfortunately the error is still occurring with 4.0.3.

/* Minification failed. Returning unminified contents.
(471,28): run-time error CSS1019: Unexpected token, found '}'
(481,1): run-time error CSS1019: Unexpected token, found '@-webkit-keyframes'
(482,8): run-time error CSS1035: Expected colon, found '{'
 */

So the error at least manifests in this block:

 /* trick to prevent the default checked ripple animation from showing
 * when the page loads.
 * the ripples are hidden by default, and shown only when the input is focused.
 */
  .switch-light.switch-material.switch-light input ~ span:before,
  .switch-light.switch-material.switch-light input ~ span:after,
  .switch-material.switch-toggle input + label:after {
    visibility: hidden; }
  .switch-light.switch-material.switch-light input:focus:checked ~ span:before,
  .switch-light.switch-material.switch-light input:focus:not(:checked) ~ span:after,
  .switch-material.switch-toggle input:focus:checked + label:after {
    visibility: visible; } }

/* Bugfix for older Webkit, including mobile Webkit. Adapted from
 * http://css-tricks.com/webkit-sibling-bug/
 */
@media only screen and (-webkit-max-device-pixel-ratio: 2) and (max-device-width: 80em) {
  .switch-light,
  .switch-toggle {
    -webkit-animation: webkitSiblingBugfix infinite 1s; } }

@-webkit-keyframes webkitSiblingBugfix {
  from {
    -webkit-transform: translate3d(0, 0, 0); }
  to {
    -webkit-transform: translate3d(0, 0, 0); } }

Looking through this though, I don't see any of this as invalid, so their parser for MVC bundler is doing something weird, but I can't seem to get it to give me a better explanation or log right now.

The issue seems to be in the BundlerMinifier extension. Somebody already reported it:
madskristensen/BundlerMinifier#282

I managed to minify dist/toggle-switch.css without any errors with csso, clean-css and yui-compressor.

Thanks for doing the research into this. Seems like everything in the Microsoft space is messed up here. I'm closing this issue because, like you and I have tested, it works in every sane minifier and you don't want to keep and maintain pre-minified css files in your output.

I get an error, when will the problem be solved?

So the error at least manifests in this block:

@-webkit-keyframes progress-bar-stripes {
from {
background-position: 1rem 0; }
to {
background-position: 0 0; } }

@Keyframes progress-bar-stripes {
from {
background-position: 1rem 0; }
to {
background-position: 0 0; } }

If it's the same error, it's coming from the BundlerMinifier Visual Studio extension:
madskristensen/BundlerMinifier#282

There doesn't seem to be any activity on the upstream issue.