From 1f21667b4877332bd88f9112c5be3a40ee3323e9 Mon Sep 17 00:00:00 2001 From: GoalSmashers Date: Wed, 31 Oct 2012 21:49:31 +0000 Subject: [PATCH] Fixed shortening hex colors and their relation to hashes in urls. --- lib/clean.js | 6 +++--- test/data/big-min.css | 36 ++++++++++++++++++------------------ test/unit-test.js | 8 +++++++- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/lib/clean.js b/lib/clean.js index d8da80cb..93f97340 100644 --- a/lib/clean.js +++ b/lib/clean.js @@ -112,11 +112,11 @@ var CleanCSS = { }); // long hex to short hex - replace(/([^"'=\s])\s*#([0-9a-f]{6})/gi, function(match, prefix, color) { + replace(/([,: \(])#([0-9a-f]{6})/gi, function(match, prefix, color) { if (color[0] == color[1] && color[2] == color[3] && color[4] == color[5]) - return (prefix + (/:$/.test(prefix) ? '' : ' ')) + '#' + color[0] + color[2] + color[4]; + return prefix + '#' + color[0] + color[2] + color[4]; else - return (prefix + (/:$/.test(prefix) ? '' : ' ')) + '#' + color; + return prefix + '#' + color; }); // replace standard colors with hex values (only if color name is longer then hex value) diff --git a/test/data/big-min.css b/test/data/big-min.css index f58b3673..06c63ec3 100644 --- a/test/data/big-min.css +++ b/test/data/big-min.css @@ -277,9 +277,9 @@ figure img,article img,.img_bord{border:1px solid #eef1f5;vertical-align:bottom} img[width="642"]{margin-bottom:6px} img[width="312"]{margin-bottom:6px} img[width="202"]{margin-bottom:4px} -.btn,.btn_fonce,.btn_abo,.btn_petit{display:inline-block;padding:4px 10px 4px;margin-bottom:0;color:#000b15;text-align:center;font-weight:700;vertical-align:middle;background-color:#f5f5f5;background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from( #fff),to( #e6e6e6));background-image:-webkit-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:linear-gradient(top, #fff, #e6e6e6);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);border:1px solid #ccc;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);cursor:pointer} -.btn_fonce,.bt_fonce a{color:#fff;background-color:#000b15;background-image:-moz-linear-gradient(top, #5d666d, #000b15);background-image:-ms-linear-gradient(top, #5d666d, #000b15);background-image:-webkit-gradient(linear,0 0,0 100%,from( #5d666d),to( #000b15));background-image:-webkit-linear-gradient(top, #5d666d, #000b15);background-image:-o-linear-gradient(top, #5d666d, #000b15);background-image:linear-gradient(top, #5d666d, #000b15);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5d666d', endColorstr='#000b15', GradientType=0);border-color:#000b15;border-color:rgba(0,0,0,.1);filter:progid:dximagetransform.microsoft.gradient(enabled=false)} -.btn_abo{color:#000b15;background-color:#ffc600;background-image:-moz-linear-gradient(top, #ffe562, #ffc600);background-image:-ms-linear-gradient(top, #ffe562, #ffc600);background-image:-webkit-gradient(linear,0 0,0 100%,from( #ffe562),to( #ffc600));background-image:-webkit-linear-gradient(top, #ffe562, #ffc600);background-image:-o-linear-gradient(top, #ffe562, #ffc600);background-image:linear-gradient(top, #ffe562, #ffc600);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe562', endColorstr='#ffc600', GradientType=0);border-color:#ffc600;border-color:rgba(0,0,0,.1);filter:progid:dximagetransform.microsoft.gradient(enabled=false)} +.btn,.btn_fonce,.btn_abo,.btn_petit{display:inline-block;padding:4px 10px 4px;margin-bottom:0;color:#000b15;text-align:center;font-weight:700;vertical-align:middle;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-ms-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(top,#fff,#e6e6e6);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);border:1px solid #ccc;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);cursor:pointer} +.btn_fonce,.bt_fonce a{color:#fff;background-color:#000b15;background-image:-moz-linear-gradient(top,#5d666d,#000b15);background-image:-ms-linear-gradient(top,#5d666d,#000b15);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5d666d),to(#000b15));background-image:-webkit-linear-gradient(top,#5d666d,#000b15);background-image:-o-linear-gradient(top,#5d666d,#000b15);background-image:linear-gradient(top,#5d666d,#000b15);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5d666d', endColorstr='#000b15', GradientType=0);border-color:#000b15;border-color:rgba(0,0,0,.1);filter:progid:dximagetransform.microsoft.gradient(enabled=false)} +.btn_abo{color:#000b15;background-color:#ffc600;background-image:-moz-linear-gradient(top,#ffe562,#ffc600);background-image:-ms-linear-gradient(top,#ffe562,#ffc600);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ffe562),to(#ffc600));background-image:-webkit-linear-gradient(top,#ffe562,#ffc600);background-image:-o-linear-gradient(top,#ffe562,#ffc600);background-image:linear-gradient(top,#ffe562,#ffc600);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe562', endColorstr='#ffc600', GradientType=0);border-color:#ffc600;border-color:rgba(0,0,0,.1);filter:progid:dximagetransform.microsoft.gradient(enabled=false)} .btn.large{width:100%;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box} .btn_petit{padding:2px 4px;font-size:11px;line-height:16px} .btn:hover,.btn_fonce:hover,.btn_abo:hover,.btn_petit:hover{text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-ms-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear} @@ -590,7 +590,7 @@ img[height="97"]+.ico29x29{bottom:6%;left:3.5%} .conteneur_onglets{height:35px;border:solid #d2d6db;border-width:0 0 1px} .conteneur_onglets .onglet{float:left;background:#fff;text-align:center} .conteneur_onglets .onglet.adroite{float:right} -.conteneur_onglets .onglet.courant{margin:0 4px 0 0;border:solid #d2d6db;border-width:1px 1px 0;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;border-top-left-radius:4px;border-top-right-radius:4px;background:#fff;background:-moz-linear-gradient(top, #f1f5f8 0, #fff 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%, #f1f5f8),color-stop(100%, #fff));background:-webkit-linear-gradient(top, #f1f5f8 0, #fff 100%);background:-o-linear-gradient(top, #f1f5f8 0, #fff 100%);background:-ms-linear-gradient(top, #f1f5f8 0, #fff 100%);background:linear-gradient(top, #f1f5f8 0, #fff 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#f1f5f8', endColorstr='#ffffff', GradientType=0 )} +.conteneur_onglets .onglet.courant{margin:0 4px 0 0;border:solid #d2d6db;border-width:1px 1px 0;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;border-top-left-radius:4px;border-top-right-radius:4px;background:#fff;background:-moz-linear-gradient(top,#f1f5f8 0,#fff 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#f1f5f8),color-stop(100%,#fff));background:-webkit-linear-gradient(top,#f1f5f8 0,#fff 100%);background:-o-linear-gradient(top,#f1f5f8 0,#fff 100%);background:-ms-linear-gradient(top,#f1f5f8 0,#fff 100%);background:linear-gradient(top,#f1f5f8 0,#fff 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#f1f5f8', endColorstr='#ffffff', GradientType=0 )} .conteneur_onglets .onglet>span,.conteneur_onglets .onglet>a,.conteneur_onglets .onglet .interieur_onglet{display:block;height:35px;line-height:36px;padding:0 8px;cursor:pointer} .conteneur_onglets .onglet>a:hover,.conteneur_onglets .onglet>a:focus{cursor:pointer;color:#2e3942} .conteneur_onglets .onglet.desactive>span{cursor:default;color:#b8c0c3} @@ -607,7 +607,7 @@ img[height="97"]+.ico29x29{bottom:6%;left:3.5%} .courrier72x21{display:inline-block;width:72px;height:21px;text-indent:-9999px;background:url(/medias/web/img/groupe/logo_courrier72x21.png)} .lien_img314x64.festival_cannes_une{background:url(/medias/web/img/evenementiel/festival_de_cannes_2012/widget_une.png);text-indent:-9999px} .lien_img314x64.legislatives_2012_une{background:url(/medias/web/img/evenementiel/legislatives_2012/widget_une.png);text-indent:-9999px} -#en_ce_moment{height:33px;overflow:hidden;background:#2d3143;background:-moz-linear-gradient(top, #2d3143 0, #10141d 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%, #2d3143),color-stop(100%, #10141d));background:-webkit-linear-gradient(top, #2d3143 0, #10141d 100%);background:-o-linear-gradient(top, #2d3143 0, #10141d 100%);background:-ms-linear-gradient(top, #2d3143 0, #10141d 100%);background:linear-gradient(top, #2d3143 0, #10141d 100%)} +#en_ce_moment{height:33px;overflow:hidden;background:#2d3143;background:-moz-linear-gradient(top,#2d3143 0,#10141d 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#2d3143),color-stop(100%,#10141d));background:-webkit-linear-gradient(top,#2d3143 0,#10141d 100%);background:-o-linear-gradient(top,#2d3143 0,#10141d 100%);background:-ms-linear-gradient(top,#2d3143 0,#10141d 100%);background:linear-gradient(top,#2d3143 0,#10141d 100%)} #en_ce_moment ul{padding:0 13px 0 0} #en_ce_moment li{display:block;float:left} .ie #en_ce_moment li:first-child{font-size:12px} @@ -632,7 +632,7 @@ img[height="97"]+.ico29x29{bottom:6%;left:3.5%} .pagination>li{background:#f8f9fb} .pagination>li:hover{background:#e4e6e9} .pagination .page{display:block;float:left;padding:0 9px;height:26px;border:solid #e4e6e9;border-width:0 0 0 1px;text-align:center;line-height:26px;font-size:12px} -.conteneur_pagination .prev,.conteneur_pagination .next{display:block;float:left;width:27px;height:26px;text-shadow:0 1px 1px rgba(255,255,255,.75);background-color:#fafafa;background-image:-webkit-gradient(linear,0 0,0 100%,from( #fefefe),color-stop(25%, #fefefe),to( #e4e6e9));background-image:-webkit-linear-gradient( #fefefe, #fefefe 25%, #e4e6e9);background-image:-moz-linear-gradient(left, #fefefe, #fefefe 25%, #e4e6e9);background-image:-ms-linear-gradient( #fefefe, #fefefe 25%, #e4e6e9);background-image:-o-linear-gradient( #fefefe, #fefefe 25%, #e4e6e9);background-image:linear-gradient( #fefefe, #fefefe 25%, #e4e6e9);background-repeat:no-repeat;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fefefe', endColorstr='#e4e6e9', GradientType=0);text-align:center;line-height:26px;font-size:15px;color:#2e3942} +.conteneur_pagination .prev,.conteneur_pagination .next{display:block;float:left;width:27px;height:26px;text-shadow:0 1px 1px rgba(255,255,255,.75);background-color:#fafafa;background-image:-webkit-gradient(linear,0 0,0 100%,from(#fefefe),color-stop(25%,#fefefe),to(#e4e6e9));background-image:-webkit-linear-gradient(#fefefe,#fefefe 25%,#e4e6e9);background-image:-moz-linear-gradient(left,#fefefe,#fefefe 25%,#e4e6e9);background-image:-ms-linear-gradient(#fefefe,#fefefe 25%,#e4e6e9);background-image:-o-linear-gradient(#fefefe,#fefefe 25%,#e4e6e9);background-image:linear-gradient(#fefefe,#fefefe 25%,#e4e6e9);background-repeat:no-repeat;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fefefe', endColorstr='#e4e6e9', GradientType=0);text-align:center;line-height:26px;font-size:15px;color:#2e3942} .conteneur_pagination .prev:hover,.conteneur_pagination .next:hover{color:#2e3942;text-decoration:none;background-color:#e4e6e9;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-ms-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear} .conteneur_pagination .prev{border-right:1px solid #d2d6db} .conteneur_pagination .next{border-left:1px solid #d2d6db;float:right} @@ -796,7 +796,7 @@ img[height="97"]+.ico29x29{bottom:6%;left:3.5%} #header{font-size:12px;text-align:left} #header a{display:inline-block} .conteneur_haut{width:1000px;margin:0 auto} -#surheader,#surheader .conteneur_haut{background:#000b15;background:#1e5799;background:-moz-linear-gradient(top, #1e5799 0, #2d3841 0, #010c16 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%, #1e5799),color-stop(0%, #2d3841),color-stop(100%, #010c16));background:-webkit-linear-gradient(top, #1e5799 0, #2d3841 0, #010c16 100%);background:-o-linear-gradient(top, #1e5799 0, #2d3841 0, #010c16 100%);background:-ms-linear-gradient(top, #1e5799 0, #2d3841 0, #010c16 100%);background:linear-gradient(top, #1e5799 0, #2d3841 0, #010c16 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#2d3841', endColorstr='#010c16', GradientType=0 );height:25px;line-height:25px} +#surheader,#surheader .conteneur_haut{background:#000b15;background:#1e5799;background:-moz-linear-gradient(top,#1e5799 0,#2d3841 0,#010c16 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#1e5799),color-stop(0%,#2d3841),color-stop(100%,#010c16));background:-webkit-linear-gradient(top,#1e5799 0,#2d3841 0,#010c16 100%);background:-o-linear-gradient(top,#1e5799 0,#2d3841 0,#010c16 100%);background:-ms-linear-gradient(top,#1e5799 0,#2d3841 0,#010c16 100%);background:linear-gradient(top,#1e5799 0,#2d3841 0,#010c16 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#2d3841', endColorstr='#010c16', GradientType=0 );height:25px;line-height:25px} #surheader .droit{width:400px;float:right} #surheader .gauche{width:600px;float:left} #surheader a,#surheader span{color:#fff;font-size:11px} @@ -856,7 +856,7 @@ img[height="97"]+.ico29x29{bottom:6%;left:3.5%} #header_abonne .ea109x13{margin:0 14px 0 0} #header .acces_compte{position:relative;float:right} #header .acces_compte:hover{cursor:pointer} -#header .acces_compte .avatar_nom{height:26px;margin:3px 0 0;background-color:#fafafa;background-image:-webkit-gradient(linear,0 0,0 100%,from( #fefefe),color-stop(25%, #fefefe),to( #e4e6e9));background-image:-webkit-linear-gradient( #fefefe, #fefefe 25%, #e4e6e9);background-image:-moz-linear-gradient(top, #fefefe, #fefefe 25%, #e4e6e9);background-image:-ms-linear-gradient( #fefefe, #fefefe 25%, #e4e6e9);background-image:-o-linear-gradient( #fefefe, #fefefe 25%, #e4e6e9);background-image:linear-gradient( #fefefe, #fefefe 25%, #e4e6e9);background-repeat:no-repeat;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e4e6e9', GradientType=0);border:1px solid #d2d6db;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px} +#header .acces_compte .avatar_nom{height:26px;margin:3px 0 0;background-color:#fafafa;background-image:-webkit-gradient(linear,0 0,0 100%,from(#fefefe),color-stop(25%,#fefefe),to(#e4e6e9));background-image:-webkit-linear-gradient(#fefefe,#fefefe 25%,#e4e6e9);background-image:-moz-linear-gradient(top,#fefefe,#fefefe 25%,#e4e6e9);background-image:-ms-linear-gradient(#fefefe,#fefefe 25%,#e4e6e9);background-image:-o-linear-gradient(#fefefe,#fefefe 25%,#e4e6e9);background-image:linear-gradient(#fefefe,#fefefe 25%,#e4e6e9);background-repeat:no-repeat;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e4e6e9', GradientType=0);border:1px solid #d2d6db;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px} #header .acces_compte .avatar_nom span{display:block;height:26px;line-height:26px;float:left} #header .acces_compte .avatar{width:28px;border-right:1px solid #d2d6db} #header .acces_compte .avatar img{display:block;margin:4px auto 0} @@ -1134,7 +1134,7 @@ label i{display:none;font-style:normal;display:none} .bloc_part.attractive.temoignage.petit .texte{height:108px} .bloc_part.attractive.text{height:208px} .bloc_part.attractive.format-text .img img{padding:15px 15px 9px} -.services .bloc_part.gymglish.grid_12,.services .bloc_part.darqroom.grid_12.promo{background-color:#e9ecf0;background-image:-moz-linear-gradient(top,#fff, #e9ecf0);background-image:-ms-linear-gradient(top, #fafbfc #e9ecf0);background-image:-webkit-gradient(linear,0 0,0 100%,from( #fafbfc),to( #e9ecf0));background-image:-webkit-linear-gradient(top, #fafbfc, #e9ecf0);background-image:-o-linear-gradient(top, #fafbfc, #e9ecf0);background-image:linear-gradient(top,#fff, #e9ecf0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafbfc', endColorstr='#e9ecf0', GradientType=0)} +.services .bloc_part.gymglish.grid_12,.services .bloc_part.darqroom.grid_12.promo{background-color:#e9ecf0;background-image:-moz-linear-gradient(top,#fff,#e9ecf0);background-image:-ms-linear-gradient(top,#fafbfc #e9ecf0);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fafbfc),to(#e9ecf0));background-image:-webkit-linear-gradient(top,#fafbfc,#e9ecf0);background-image:-o-linear-gradient(top,#fafbfc,#e9ecf0);background-image:linear-gradient(top,#fff,#e9ecf0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafbfc', endColorstr='#e9ecf0', GradientType=0)} .services .bloc_part.gymglish.grid_6{background:0} .bloc_part.gymglish .contenu{padding:12px 15px 0;height:182px;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;overflow:hidden;clear:both} .bloc_part.gymglish .exercice .texte,.bloc_part.gymglish .mot_mois .texte{width:166px;height:126px;padding:0} @@ -1205,7 +1205,7 @@ label i{display:none;font-style:normal;display:none} .bloc_part .contenu.carrousel li{overflow:hidden;float:left} .bloc_part .contenu.carrousel_petit li{height:182px;width:312px} .bloc_part .contenu.carrousel_grand li{height:182px;width:642px} -.bloc_part .contenu.carrousel .prev,.bloc_part .contenu.carrousel .next{display:block;width:13px;height:21px;text-shadow:0 1px 1px rgba(255,255,255,.75);background-color:#fafafa;background-image:-webkit-gradient(linear,0 0,0 100%,from( #fefefe),color-stop(25%, #fefefe),to( #e4e6e9));background-image:-webkit-linear-gradient( #fefefe, #fefefe 25%, #e4e6e9);background-image:-moz-linear-gradient(top, #fefefe, #fefefe 25%, #e4e6e9);background-image:-ms-linear-gradient( #fefefe, #fefefe 25%, #e4e6e9);background-image:-o-linear-gradient( #fefefe, #fefefe 25%, #e4e6e9);background-image:linear-gradient( #fefefe, #fefefe 25%, #e4e6e9);background-repeat:no-repeat;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fefefe', endColorstr='#e4e6e9', GradientType=0);font-size:21px;line-height:15px;color:#2e3942} +.bloc_part .contenu.carrousel .prev,.bloc_part .contenu.carrousel .next{display:block;width:13px;height:21px;text-shadow:0 1px 1px rgba(255,255,255,.75);background-color:#fafafa;background-image:-webkit-gradient(linear,0 0,0 100%,from(#fefefe),color-stop(25%,#fefefe),to(#e4e6e9));background-image:-webkit-linear-gradient(#fefefe,#fefefe 25%,#e4e6e9);background-image:-moz-linear-gradient(top,#fefefe,#fefefe 25%,#e4e6e9);background-image:-ms-linear-gradient(#fefefe,#fefefe 25%,#e4e6e9);background-image:-o-linear-gradient(#fefefe,#fefefe 25%,#e4e6e9);background-image:linear-gradient(#fefefe,#fefefe 25%,#e4e6e9);background-repeat:no-repeat;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fefefe', endColorstr='#e4e6e9', GradientType=0);font-size:21px;line-height:15px;color:#2e3942} .bloc_part .contenu.carrousel .prev:hover,.bloc_part .contenu.carrousel .next:hover{color:#2e3942;text-decoration:none;background-color:#e4e6e9;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-ms-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear;cursor:pointer} .bloc_part .contenu.carrousel .prev{position:absolute;left:0;top:46%;border:solid #d2d6db;border-width:1px 1px 1px 0;text-align:left;padding-left:7px} .bloc_part .contenu.carrousel .next{border:solid #d2d6db;border-width:1px 0 1px 1px;position:absolute;right:0;top:46%;text-align:right;padding-right:7px} @@ -1315,7 +1315,7 @@ label i{display:none;font-style:normal;display:none} #bandeau_bas .conteneur_lives .lives{-webkit-box-shadow:-3px 4px 15px -0 rgba(0,11,21,.5);-moz-box-shadow:-3px 4px 15px -0 rgba(0,11,21,.5);box-shadow:-3px 4px 15px -0 rgba(0,11,21,.5)} .conteneur_lives.popuped .lives{position:relative} .conteneur_lives .live{width:328px;right:0;background-color:#F6F6F6} -.conteneur_lives .live .bandeau{height:25px;width:320px;padding-right:8px;overflow:hidden;line-height:23px;cursor:pointer;background-color:#f5f5f5;background-image:-moz-linear-gradient(top, #d20303, #bf0202);background-image:-ms-linear-gradient(top, #d20303, #bf0202);background-image:-webkit-gradient(linear,0 0,0 100%,from( #d20303),to( #bf0202));background-image:-webkit-linear-gradient(top, #d20303, #bf0202);background-image:-o-linear-gradient(top, #d20303, #bf0202);background-image:linear-gradient(top, #d20303, #bf0202);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#d20303', endColorstr='#bf0202', GradientType=0)} +.conteneur_lives .live .bandeau{height:25px;width:320px;padding-right:8px;overflow:hidden;line-height:23px;cursor:pointer;background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#d20303,#bf0202);background-image:-ms-linear-gradient(top,#d20303,#bf0202);background-image:-webkit-gradient(linear,0 0,0 100%,from(#d20303),to(#bf0202));background-image:-webkit-linear-gradient(top,#d20303,#bf0202);background-image:-o-linear-gradient(top,#d20303,#bf0202);background-image:linear-gradient(top,#d20303,#bf0202);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#d20303', endColorstr='#bf0202', GradientType=0)} .conteneur_lives .live.petit .bandeau:hover{background-color:#fe2f2f;background-position:0 -25px;-webkit-transition:background-position .06s linear;-moz-transition:background-position .06s linear;-ms-transition:background-position .06s linear;-o-transition:background-position .06s linear;transition:background-position .06s linear;cursor:pointer} .conteneur_lives .live .bandeau .titre{float:left;padding:0 7px;width:220px;font-family:arial,sans-serif;font-size:13px;font-weight:700} .conteneur_lives .lives .chrome .titre{float:left;width:230px;height:25px;overflow:hidden;color:#fff;text-align:left;font-weight:700;font-family:arial,sans-serif;font-size:13px;line-height:25px} @@ -3182,7 +3182,7 @@ body.slideshow .ad-top .megaban{background:#333} .site-liberation .block-call-items .tpl-search-results .object-picture .np a.date{background-color:#c8c8c8} #core-liberation .block-item .object-picture .legende{color:#838383} .site-liberation .block-item .object-content a:hover{color:#e20000} -#core-liberation .block-item-locked{border-top-color:#c1b0bb;border-bottom-color:#c1b0bb;background:#fff;background:-moz-linear-gradient(top, #dbdad6 0,#fff 2%,#fff 98%, #e1e0de 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%, #dbdad6),color-stop(2%,#fff),color-stop(98%,#fff),color-stop(100%, #e1e0de));background:-o-linear-gradient(top, #dbdad6 0,#fff 2%,#fff 98%, #e1e0de 100%)} +#core-liberation .block-item-locked{border-top-color:#c1b0bb;border-bottom-color:#c1b0bb;background:#fff;background:-moz-linear-gradient(top,#dbdad6 0,#fff 2%,#fff 98%,#e1e0de 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#dbdad6),color-stop(2%,#fff),color-stop(98%,#fff),color-stop(100%,#e1e0de));background:-o-linear-gradient(top,#dbdad6 0,#fff 2%,#fff 98%,#e1e0de 100%)} #core-liberation .block-item-locked .block-top span{background-color:#fff} #core-liberation .block-item-locked .btn-zoneabo a:hover{color:#fff} #core-liberation .block-item-read-more{border-color:#ddd} @@ -3311,7 +3311,7 @@ body.slideshow .ad-top .megaban{background:#333} .site-liberation .btn-basic a, .site-liberation form .btn-basic input[type=button], .site-liberation form .btn-basic input[type=submit], -.site-liberation form .btn-basic input[type=reset]{background:#ccc;background:-moz-linear-gradient(top, #f2f2f2 0, #f2f2f2 50%,#ccc 51%,#ccc 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%, #f2f2f2),color-stop(50%, #f2f2f2),color-stop(51%,#ccc),color-stop(100%,#ccc));background:-webkit-linear-gradient(top, #f2f2f2 0, #f2f2f2 50%,#ccc 51%,#ccc 100%);background:-o-linear-gradient(top, #f2f2f2 0, #f2f2f2 50%,#ccc 51%,#ccc 100%);background:-ms-linear-gradient(top, #f2f2f2 0, #f2f2f2 50%,#ccc 51%,#ccc 100%);background:linear-gradient(top, #f2f2f2 0, #f2f2f2 50%,#ccc 51%,#ccc 100%);border-color:#888;color:#222} +.site-liberation form .btn-basic input[type=reset]{background:#ccc;background:-moz-linear-gradient(top,#f2f2f2 0,#f2f2f2 50%,#ccc 51%,#ccc 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#f2f2f2),color-stop(50%,#f2f2f2),color-stop(51%,#ccc),color-stop(100%,#ccc));background:-webkit-linear-gradient(top,#f2f2f2 0,#f2f2f2 50%,#ccc 51%,#ccc 100%);background:-o-linear-gradient(top,#f2f2f2 0,#f2f2f2 50%,#ccc 51%,#ccc 100%);background:-ms-linear-gradient(top,#f2f2f2 0,#f2f2f2 50%,#ccc 51%,#ccc 100%);background:linear-gradient(top,#f2f2f2 0,#f2f2f2 50%,#ccc 51%,#ccc 100%);border-color:#888;color:#222} .site-liberation .btn-laune span, .site-liberation .btn-laune a, .site-liberation .btn-monlibe span, @@ -3351,15 +3351,15 @@ body.slideshow .ad-top .megaban{background:#333} .site-liberation #core-liberation form .btn-zoneabo input[type=button]:hover, .site-liberation #core-liberation form .btn-zoneabo input[type=submit]:hover{background:#a00} .site-liberation .btn-rounded-degraded span, -.site-liberation .btn-rounded-degraded a{background:#e20000;background:-moz-linear-gradient(top, #f33333 0,#b33 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%, #f33333),color-stop(100%,#b33));background:-webkit-linear-gradient(top, #f33333 0,#b33 100%);background:-o-linear-gradient(top, #f33333 0,#b33 100%);background:-ms-linear-gradient(top, #f33333 0,#b33 100%);background:linear-gradient(top, #f33333 0,#b33 100%);color:#fff} +.site-liberation .btn-rounded-degraded a{background:#e20000;background:-moz-linear-gradient(top,#f33333 0,#b33 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#f33333),color-stop(100%,#b33));background:-webkit-linear-gradient(top,#f33333 0,#b33 100%);background:-o-linear-gradient(top,#f33333 0,#b33 100%);background:-ms-linear-gradient(top,#f33333 0,#b33 100%);background:linear-gradient(top,#f33333 0,#b33 100%);color:#fff} .site-liberation .btn-rounded-degraded span:hover, -.site-liberation .btn-rounded-degraded a:hover{background:#e20000;background:-moz-linear-gradient(top,#b33 0, #f33333 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#b33),color-stop(100%, #f33333));background:-webkit-linear-gradient(top,#b33 0, #f33333 100%);background:-o-linear-gradient(top,#b33 0, #f33333 100%);background:-ms-linear-gradient(top,#b33 0, #f33333 100%);background:linear-gradient(top,#b33 0, #f33333 100%);color:#fff} +.site-liberation .btn-rounded-degraded a:hover{background:#e20000;background:-moz-linear-gradient(top,#b33 0,#f33333 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#b33),color-stop(100%,#f33333));background:-webkit-linear-gradient(top,#b33 0,#f33333 100%);background:-o-linear-gradient(top,#b33 0,#f33333 100%);background:-ms-linear-gradient(top,#b33 0,#f33333 100%);background:linear-gradient(top,#b33 0,#f33333 100%);color:#fff} .site-liberation form .btn-rounded-degraded input[type=button], -.site-liberation form .btn-rounded-degraded input[type=submit]{background:#e20000;background:-moz-linear-gradient(top, #f33333 0,#b33 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%, #f33333),color-stop(100%,#b33));background:-webkit-linear-gradient(top, #f33333 0,#b33 100%);background:-o-linear-gradient(top, #f33333 0,#b33 100%);background:-ms-linear-gradient(top, #f33333 0,#b33 100%);background:linear-gradient(top, #f33333 0,#b33 100%);color:#fff} +.site-liberation form .btn-rounded-degraded input[type=submit]{background:#e20000;background:-moz-linear-gradient(top,#f33333 0,#b33 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#f33333),color-stop(100%,#b33));background:-webkit-linear-gradient(top,#f33333 0,#b33 100%);background:-o-linear-gradient(top,#f33333 0,#b33 100%);background:-ms-linear-gradient(top,#f33333 0,#b33 100%);background:linear-gradient(top,#f33333 0,#b33 100%);color:#fff} .site-liberation form .btn-rounded-degraded input[type=button]:hover, .site-liberation form .btn-rounded-degraded input[type=submit]:hover, .site-liberation form .btn-rounded-degraded input[type=button]:focus, -.site-liberation form .btn-rounded-degraded input[type=submit]:focus{background:#e20000;background:-moz-linear-gradient(top,#b33 0, #f33333 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#b33),color-stop(100%, #f33333));background:-webkit-linear-gradient(top,#b33 0, #f33333 100%);background:-o-linear-gradient(top,#b33 0, #f33333 100%);background:-ms-linear-gradient(top,#b33 0, #f33333 100%);background:linear-gradient(top,#b33 0, #f33333 100%);color:#fff} +.site-liberation form .btn-rounded-degraded input[type=submit]:focus{background:#e20000;background:-moz-linear-gradient(top,#b33 0,#f33333 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#b33),color-stop(100%,#f33333));background:-webkit-linear-gradient(top,#b33 0,#f33333 100%);background:-o-linear-gradient(top,#b33 0,#f33333 100%);background:-ms-linear-gradient(top,#b33 0,#f33333 100%);background:linear-gradient(top,#b33 0,#f33333 100%);color:#fff} .site-liberation .btn-read-digitalpaper{border-color:#878787} .site-liberation .btn-read-digitalpaper span, .site-liberation .btn-read-digitalpaper a{color:#2e2e2e} @@ -3480,7 +3480,7 @@ body.slideshow .ad-top .megaban{background:#333} #page-paywall .content .arguments .arg h4, #page-paywall .content .arguments .arg .price{color:#222} #page-paywall .content .arguments .arg .price .total{color:#999} -#page-paywall .content .banner-degraded{border-top-color:#c1b0bb;border-bottom-color:#c1b0bb;background:#fff;background:-moz-linear-gradient(top, #dbdad6 0,#fff 10%,#fff 90%, #e1e0de 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%, #dbdad6),color-stop(10%,#fff),color-stop(90%,#fff),color-stop(100%, #e1e0de));background:-webkit-linear-gradient(top, #dbdad6 0,#fff 10%,#fff 90%, #e1e0de 100%);background:-o-linear-gradient(top, #dbdad6 0,#fff 10%,#fff 90%, #e1e0de 100%);background:-ms-linear-gradient(top, #dbdad6 0,#fff 10%,#fff 90%, #e1e0de 100%);background:linear-gradient(top, #dbdad6 0,#fff 10%,#fff 90%, #e1e0de 100%);color:#777} +#page-paywall .content .banner-degraded{border-top-color:#c1b0bb;border-bottom-color:#c1b0bb;background:#fff;background:-moz-linear-gradient(top,#dbdad6 0,#fff 10%,#fff 90%,#e1e0de 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#dbdad6),color-stop(10%,#fff),color-stop(90%,#fff),color-stop(100%,#e1e0de));background:-webkit-linear-gradient(top,#dbdad6 0,#fff 10%,#fff 90%,#e1e0de 100%);background:-o-linear-gradient(top,#dbdad6 0,#fff 10%,#fff 90%,#e1e0de 100%);background:-ms-linear-gradient(top,#dbdad6 0,#fff 10%,#fff 90%,#e1e0de 100%);background:linear-gradient(top,#dbdad6 0,#fff 10%,#fff 90%,#e1e0de 100%);color:#777} #page-paywall .content .banner-degraded a{color:#777} #page-paywall .content .form-login form p input[type=text], #page-paywall .content .form-login form p input[type=password]{border-color:#888} diff --git a/test/unit-test.js b/test/unit-test.js index 67df3d00..b08cb65d 100644 --- a/test/unit-test.js +++ b/test/unit-test.js @@ -302,7 +302,9 @@ vows.describe('clean-units').addBatch({ 'border color': [ 'p{border:1px solid #f94311}', 'p{border:1px solid #f94311}' - ] + ], + 'colors and colons': 'a{background-image:linear-gradient(top,red,#e6e6e6)}', + 'colors and parentheses': 'a{background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6))}' }), 'font weights': cssContext({ 'font-weight:normal to 400': [ @@ -331,6 +333,10 @@ vows.describe('clean-units').addBatch({ 'not strip comments if spaces inside': [ 'a{background:url("/images/long image name.png") 0 0 no-repeat}a{}a{background:url("/images/no-spaces.png") 0 0 no-repeat}', 'a{background:url("/images/long image name.png") 0 0 no-repeat}a{}a{background:url(/images/no-spaces.png) 0 0 no-repeat}' + ], + 'not add a space before url\'s hash': [ + "url(\"../fonts/d90b3358-e1e2-4abb-ba96-356983a54c22.svg#d90b3358-e1e2-4abb-ba96-356983a54c22\")", + "url(../fonts/d90b3358-e1e2-4abb-ba96-356983a54c22.svg#d90b3358-e1e2-4abb-ba96-356983a54c22)", ] }), 'ie filters': cssContext({ -- 2.34.1