Permalink
Browse files

Add optimisation for normalising strings.

  • Loading branch information...
1 parent ae65183 commit fa0580d5df958ccc8ffb33576a73f9c8610ab0bf @ben-eb committed Dec 12, 2016
View
@@ -1,6 +1,6 @@
{
"presets": ["es2015-loose", "stage-0"],
- "plugins": ["add-module-exports"],
+ "plugins": ["add-module-exports", "precompile-charcodes"],
"env": {
"development": {
"sourceMaps": "inline"
View
@@ -65,6 +65,30 @@ outputExample = """
source = "https://github.com/ben-eb/cssnano/blob/master/src/lib/functionOptimiser.js"
[[modules]]
+name = "normalize-string"
+shortDescription = "Normalizes quotation marks in strings"
+longDescription = """
+Standardises the usage of double (by default) or single quoted strings, for
+better gzip compression. Can also remove linebreaks which are inserted for
+aesthetic purposes. If you prefer single quotes, you can set
+`preferredQuote: 'single'` instead.
+"""
+inputExample = """
+.box {
+ quotes: '«' "»";
+ content: 'This is a string which is \\
+broken over multiple lines.';
+}
+"""
+outputExample = """
+.box {
+ quotes: "«" "»";
+ content: "This is a string which is broken over multiple lines.";
+}
+"""
+source = "https://github.com/ben-eb/cssnano/blob/master/src/lib/normalizeString.js"
+
+[[modules]]
name = "postcss-calc"
shortDescription = "Reduces CSS calc expressions"
longDescription = "Reduces CSS `calc` expressions whereever possible, ensuring both browser compatibility and compression."
View
@@ -63,6 +63,7 @@
"babel-core": "^6.5.1",
"babel-loader": "^6.2.4",
"babel-plugin-add-module-exports": "^0.2.0",
+ "babel-plugin-precompile-charcodes": "^1.0.0",
"babel-preset-es2015-loose": "^7.0.0",
"babel-preset-stage-0": "^6.5.0",
"coveralls": "^2.11.6",
@@ -260,7 +260,7 @@ hr{border:0;border-bottom-style:solid;border-bottom-width:1px;border-bottom-colo
input[type=range]{vertical-align:middle;background-color:transparent}
.range-light{color:inherit;-webkit-appearance:none;padding-top:.5rem;padding-bottom:.5rem}
.range-light::-webkit-slider-thumb{-webkit-appearance:none;position:relative;width:.5rem;height:1.25rem;border-radius:3px;background-color:currentcolor;cursor:pointer;margin-top:-.5rem}
-.range-light::-webkit-slider-thumb:before{content:'';display:block;position:absolute;top:-.5rem;left:-.875rem;width:2.25rem;height:2.25rem;opacity:0}
+.range-light::-webkit-slider-thumb:before{content:"";display:block;position:absolute;top:-.5rem;left:-.875rem;width:2.25rem;height:2.25rem;opacity:0}
.range-light::-moz-range-thumb{width:.5rem;height:1.25rem;border-radius:3px;border-color:transparent;border-width:0;background-color:currentcolor;cursor:pointer}
.range-light::-webkit-slider-runnable-track{height:.25rem;cursor:pointer;border-radius:3px;background-color:rgba(0,0,0,.25)}
.range-light::-moz-range-track{height:.25rem;cursor:pointer;border-radius:3px;background-color:rgba(0,0,0,.25)}
@@ -274,14 +274,14 @@ input[type=range]{vertical-align:middle;background-color:transparent}
.table-light td,.table-light th{border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgba(0,0,0,.125)}
.table-light tr:last-child td{border-bottom:0}
.button-outline{position:relative;z-index:2;color:inherit;background-color:transparent;border-radius:3px;border:1px solid currentcolor;-webkit-transition-duration:.1s;transition-duration:.1s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;-webkit-transition-property:box-shadow,background-color;transition-property:box-shadow,background-color}
-.button-outline:before{content:'';width:100%;height:100%;display:block;position:absolute;z-index:-1;top:-1px;left:-1px;border:1px solid transparent;background-color:currentcolor;border-radius:3px;-webkit-transition-duration:.1s;transition-duration:.1s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;-webkit-transition-property:opacity;transition-property:opacity;opacity:0}
+.button-outline:before{content:"";width:100%;height:100%;display:block;position:absolute;z-index:-1;top:-1px;left:-1px;border:1px solid transparent;background-color:currentcolor;border-radius:3px;-webkit-transition-duration:.1s;transition-duration:.1s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;-webkit-transition-property:opacity;transition-property:opacity;opacity:0}
.button-outline:hover{box-shadow:none}
.button-outline:hover:before{opacity:.125}
.button-outline:focus{outline:none;border:1px solid currentcolor;box-shadow:0 0 3px 1px}
.button-outline.is-active,.button-outline:active{box-shadow:inset 0 1px 5px 0,0 0 1px}
.button-outline.is-disabled,.button-outline:disabled{opacity:.5}
.button-transparent{position:relative;z-index:2;color:inherit;background-color:transparent;border-radius:0;border:1px solid transparent;-webkit-transition-duration:.1s;transition-duration:.1s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;-webkit-transition-property:box-shadow;transition-property:box-shadow}
-.button-transparent:before{content:'';width:100%;height:100%;display:block;position:absolute;z-index:-1;top:-1px;left:-1px;border:1px solid transparent;background-color:currentcolor;-webkit-transition-duration:.1s;transition-duration:.1s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;-webkit-transition-property:opacity;transition-property:opacity;opacity:0}
+.button-transparent:before{content:"";width:100%;height:100%;display:block;position:absolute;z-index:-1;top:-1px;left:-1px;border:1px solid transparent;background-color:currentcolor;-webkit-transition-duration:.1s;transition-duration:.1s;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;-webkit-transition-property:opacity;transition-property:opacity;opacity:0}
.button-transparent:hover{box-shadow:none}
.button-transparent:hover:before{opacity:.0625;opacity:.09375}
.button-transparent:focus{outline:none;border-color:transparent;box-shadow:0 0 3px}
@@ -5,7 +5,7 @@ body{line-height:1.5;background:#fff}
table{border-collapse:separate;border-spacing:0}
caption,td,th{text-align:left;font-weight:400;float:none!important}
table,td,th{vertical-align:middle}
-blockquote:after,blockquote:before,q:after,q:before{content:''}
+blockquote:after,blockquote:before,q:after,q:before{content:""}
blockquote,q{quotes:"" ""}
a img{border:none}
:focus{outline:0}
@@ -65,7 +65,7 @@ td,th{padding:0}
.table td,.table th{background-color:#fff!important}
.table-bordered td,.table-bordered th{border:1px solid #ddd!important}
}
-@font-face{font-family:Glyphicons Halflings;src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}
+@font-face{font-family:Glyphicons Halflings;src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format("embedded-opentype"),url(../fonts/glyphicons-halflings-regular.woff2) format("woff2"),url(../fonts/glyphicons-halflings-regular.woff) format("woff"),url(../fonts/glyphicons-halflings-regular.ttf) format("truetype"),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format("svg")}
.glyphicon{position:relative;top:1px;display:inline-block;font-family:Glyphicons Halflings;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
.glyphicon-asterisk:before{content:"\2a"}
.glyphicon-plus:before{content:"\2b"}
@@ -409,10 +409,10 @@ abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}
blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}
blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}
blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}
-blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}
+blockquote .small:before,blockquote footer:before,blockquote small:before{content:"\2014 \00A0"}
.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}
-.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}
-.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}
+.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:""}
+.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:"\00A0 \2014"}
address{margin-bottom:20px;font-style:normal;line-height:1.42857143}
code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,Courier New,monospace}
code{color:#c7254e;background-color:#f9f2f4;border-radius:4px}
@@ -1439,15 +1439,15 @@ button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:transpa
.carousel-inner>.active.left{left:-100%}
.carousel-inner>.active.right{left:100%}
.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);filter:alpha(opacity=50);opacity:.5}
-.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5),rgba(0,0,0,.0001));background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(90deg,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000',endColorstr='#00000000',GradientType=1);background-repeat:repeat-x}
-.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001),rgba(0,0,0,.5));background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(90deg,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000',endColorstr='#80000000',GradientType=1);background-repeat:repeat-x}
+.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5),rgba(0,0,0,.0001));background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(90deg,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#80000000",endColorstr="#00000000",GradientType=1);background-repeat:repeat-x}
+.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001),rgba(0,0,0,.5));background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(90deg,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00000000",endColorstr="#80000000",GradientType=1);background-repeat:repeat-x}
.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}
.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:3;display:inline-block}
.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}
.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}
.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;margin-top:-10px;font-family:serif;line-height:1}
-.carousel-control .icon-prev:before{content:'\2039'}
-.carousel-control .icon-next:before{content:'\203a'}
+.carousel-control .icon-prev:before{content:"\2039"}
+.carousel-control .icon-next:before{content:"\203a"}
.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:5;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}
.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:transparent;border:1px solid #fff;border-radius:10px}
.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}
Oops, something went wrong.

0 comments on commit fa0580d

Please sign in to comment.