Comparing version 1.9.3 to 2.0.0-alpha.0
@@ -1,1 +0,1 @@ | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(e.polished={})}(this,function(e){"use strict";function r(e){return e.charAt(0).toUpperCase()+e.slice(1)}var t=["Top","Right","Bottom","Left"];function n(e,t){if(!e)return t.toLowerCase();var n=e.split("-");if(n.length>1)return n.splice(1,0,t),n.reduce(function(e,t){return""+e+r(t)});var a=e.replace(/([a-z])([A-Z])/g,"$1"+t+"$2");return e===a?""+e+t:a}function a(e){for(var r=arguments.length,a=Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];var i=a[0],u=a[1],s=void 0===u?i:u,l=a[2],f=void 0===l?i:l,c=a[3];return function(e,r){for(var a={},o=0;o<r.length;o+=1)(r[o]||0===r[o])&&(a[n(e,t[o])]=r[o]);return a}(e,[i,s,f,void 0===c?s:c])}function o(e,r){return e.substr(-r.length)===r}function i(e){var r=parseFloat(e);return isNaN(r)?e:r}var u=function(e){return function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"16px",n=r,a=t;if("string"==typeof r){if(!o(r,"px"))throw new Error('Expected a string ending in "px" or a number passed as the first argument to '+e+'(), got "'+r+'" instead.');n=i(r)}if("string"==typeof t){if(!o(t,"px"))throw new Error('Expected a string ending in "px" or a number passed as the second argument to '+e+'(), got "'+t+'" instead.');a=i(t)}if("string"==typeof n)throw new Error('Passed invalid pixel value ("'+r+'") to '+e+'(), please pass a value like "12px" or 12.');if("string"==typeof a)throw new Error('Passed invalid base value ("'+t+'") to '+e+'(), please pass a value like "12px" or 12.');return""+n/a+e}},s=u("em"),l={minorSecond:1.067,majorSecond:1.125,minorThird:1.2,majorThird:1.25,perfectFourth:1.333,augFourth:1.414,perfectFifth:1.5,minorSixth:1.6,goldenSection:1.618,majorSixth:1.667,minorSeventh:1.778,majorSeventh:1.875,octave:2,majorTenth:2.5,majorEleventh:2.667,majorTwelfth:3,doubleOctave:4};var f=u("rem");function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1.3;return"\n @media only screen and (-webkit-min-device-pixel-ratio: "+e+"),\n only screen and (min--moz-device-pixel-ratio: "+e+"),\n only screen and (-o-min-device-pixel-ratio: "+e+"/1),\n only screen and (min-resolution: "+Math.round(96*e)+"dpi),\n only screen and (min-resolution: "+e+"dppx)\n "}var p,d,h,b=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},g=((p={html:{fontFamily:"sans-serif"},body:{margin:"0"}})["a:active,\n a:hover"]={outlineWidth:"0"},p["button,\n input,\n optgroup,\n select,\n textarea"]={fontFamily:"sans-serif",fontSize:"100%",lineHeight:"1.15"},p),m=((h={html:{lineHeight:"1.15",textSizeAdjust:"100%"}})["article,\n aside,\n footer,\n header,\n nav,\n section"]={display:"block"},h.h1={fontSize:"2em",margin:"0.67em 0"},h["figcaption,\n figure,\n main"]={display:"block"},h.figure={margin:"1em 40px"},h.hr={boxSizing:"content-box",height:"0",overflow:"visible"},h.pre={fontFamily:"monospace, monospace",fontSize:"1em"},h.a={"background-color":"transparent","-webkit-text-decoration-skip":"objects"},h["abbr[title]"]=((d={borderBottom:"none",textDecoration:"underline"}).textDecoration="underline dotted",d),h["b,\n strong"]={fontWeight:"inherit"},h["code,\n kbd,\n samp"]={fontFamily:"monospace, monospace",fontSize:"1em"},h.dfn={fontStyle:"italic"},h.mark={backgroundColor:"#ff0",color:"#000"},h.small={fontSize:"80%"},h["sub,\n sup"]={fontSize:"75%",lineHeight:"0",position:"relative",verticalAlign:"baseline"},h.sub={bottom:"-0.25em"},h.sup={top:"-0.5em"},h["audio,\n video"]={display:"inline-block"},h["audio:not([controls])"]={display:"none",height:"0"},h.img={borderStyle:"none"},h["svg:not(:root)"]={overflow:"hidden"},h["button,\n input,\n optgroup,\n select,\n textarea"]={margin:"0"},h["button,\n input"]={overflow:"visible"},h["button,\n select"]={textTransform:"none"},h['button,\n html [type="button"],\n [type="reset"],\n [type="submit"]']={"-webkit-appearance":"button"},h['button::-moz-focus-inner,\n [type="button"]::-moz-focus-inner,\n [type="reset"]::-moz-focus-inner,\n [type="submit"]::-moz-focus-inner']={borderStyle:"none",padding:"0"},h['button:-moz-focusring,\n [type="button"]:-moz-focusring,\n [type="reset"]:-moz-focusring,\n [type="submit"]:-moz-focusring']={outline:"1px dotted ButtonText"},h.fieldset={border:"1px solid #c0c0c0",margin:"0 2px",padding:"0.35em 0.625em 0.75em"},h.legend={boxSizing:"border-box",color:"inherit",display:"table",maxWidth:"100%",padding:"0",whiteSpace:"normal"},h.progress={display:"inline-block",verticalAlign:"baseline"},h.textarea={overflow:"auto"},h['[type="checkbox"],\n [type="radio"]']={boxSizing:"border-box",padding:"0"},h['[type="number"]::-webkit-inner-spin-button,\n [type="number"]::-webkit-outer-spin-button']={height:"auto"},h['[type="search"]']={"-webkit-appearance":"textfield",outlineOffset:"-2px"},h['[type="search"]::-webkit-search-cancel-button,\n [type="search"]::-webkit-search-decoration']={"-webkit-appearance":"none"},h["::-webkit-file-upload-button"]={"-webkit-appearance":"button",font:"inherit"},h["details,\n menu"]={display:"block"},h.summary={display:"list-item"},h.canvas={display:"inline-block"},h.template={display:"none"},h["[hidden]"]={display:"none"},h);var v=function(e,r){return e.raw=r,e}(["radial-gradient(","","","",")"],["radial-gradient(","","","",")"]);var y={easeInBack:"cubic-bezier(0.600, -0.280, 0.735, 0.045)",easeInCirc:"cubic-bezier(0.600, 0.040, 0.980, 0.335)",easeInCubic:"cubic-bezier(0.550, 0.055, 0.675, 0.190)",easeInExpo:"cubic-bezier(0.950, 0.050, 0.795, 0.035)",easeInQuad:"cubic-bezier(0.550, 0.085, 0.680, 0.530)",easeInQuart:"cubic-bezier(0.895, 0.030, 0.685, 0.220)",easeInQuint:"cubic-bezier(0.755, 0.050, 0.855, 0.060)",easeInSine:"cubic-bezier(0.470, 0.000, 0.745, 0.715)",easeOutBack:"cubic-bezier(0.175, 0.885, 0.320, 1.275)",easeOutCubic:"cubic-bezier(0.215, 0.610, 0.355, 1.000)",easeOutCirc:"cubic-bezier(0.075, 0.820, 0.165, 1.000)",easeOutExpo:"cubic-bezier(0.190, 1.000, 0.220, 1.000)",easeOutQuad:"cubic-bezier(0.250, 0.460, 0.450, 0.940)",easeOutQuart:"cubic-bezier(0.165, 0.840, 0.440, 1.000)",easeOutQuint:"cubic-bezier(0.230, 1.000, 0.320, 1.000)",easeOutSine:"cubic-bezier(0.390, 0.575, 0.565, 1.000)",easeInOutBack:"cubic-bezier(0.680, -0.550, 0.265, 1.550)",easeInOutCirc:"cubic-bezier(0.785, 0.135, 0.150, 0.860)",easeInOutCubic:"cubic-bezier(0.645, 0.045, 0.355, 1.000)",easeInOutExpo:"cubic-bezier(1.000, 0.000, 0.000, 1.000)",easeInOutQuad:"cubic-bezier(0.455, 0.030, 0.515, 0.955)",easeInOutQuart:"cubic-bezier(0.770, 0.000, 0.175, 1.000)",easeInOutQuint:"cubic-bezier(0.860, 0.000, 0.070, 1.000)",easeInOutSine:"cubic-bezier(0.445, 0.050, 0.550, 0.950)"};var w=function(e,r,t){switch(e){case"top":return"0 "+t/2+"px "+r+"px "+t/2+"px";case"left":return r/2+"px "+t+"px "+r/2+"px 0";case"bottom":return r+"px "+t/2+"px 0 "+t/2+"px";case"right":return r/2+"px 0 "+r/2+"px "+t+"px";default:throw new Error("Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.")}},x={left:"Right",right:"Left",top:"Bottom",bottom:"Top"};function k(e){return Math.round(255*e)}function z(e,r,t){return k(e)+","+k(r)+","+k(t)}function I(e,r,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:z;if(0===r)return n(t,t,t);var a=e%360/60,o=(1-Math.abs(2*t-1))*r,i=o*(1-Math.abs(a%2-1)),u=0,s=0,l=0;a>=0&&a<1?(u=o,s=i):a>=1&&a<2?(u=i,s=o):a>=2&&a<3?(s=o,l=i):a>=3&&a<4?(s=i,l=o):a>=4&&a<5?(u=i,l=o):a>=5&&a<6&&(u=o,l=i);var f=t-o/2;return n(u+f,s+f,l+f)}var S={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var E=/^#[a-fA-F0-9]{6}$/,j=/^#[a-fA-F0-9]{3}$/,A=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/,F=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/,O=/^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/,C=/^hsla\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/;function P(e){if("string"!=typeof e)throw new Error("Passed an incorrect argument to a color function, please pass a string representation of a color.");var r=function(e){if("string"!=typeof e)return e;var r=e.toLowerCase();return S[r]?"#"+S[r]:e}(e);if(r.match(E))return{red:parseInt(""+r[1]+r[2],16),green:parseInt(""+r[3]+r[4],16),blue:parseInt(""+r[5]+r[6],16)};if(r.match(j))return{red:parseInt(""+r[1]+r[1],16),green:parseInt(""+r[2]+r[2],16),blue:parseInt(""+r[3]+r[3],16)};var t=A.exec(r);if(t)return{red:parseInt(""+t[1],10),green:parseInt(""+t[2],10),blue:parseInt(""+t[3],10)};var n=F.exec(r);if(n)return{red:parseInt(""+n[1],10),green:parseInt(""+n[2],10),blue:parseInt(""+n[3],10),alpha:parseFloat(""+n[4])};var a=O.exec(r);if(a){var o="rgb("+I(parseInt(""+a[1],10),parseInt(""+a[2],10)/100,parseInt(""+a[3],10)/100)+")",i=A.exec(o);if(!i)throw new Error("Couldn't generate valid rgb string from "+r+", it returned "+o+".");return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)}}var u=C.exec(r);if(u){var s="rgb("+I(parseInt(""+u[1],10),parseInt(""+u[2],10)/100,parseInt(""+u[3],10)/100)+")",l=A.exec(s);if(!l)throw new Error("Couldn't generate valid rgb string from "+r+", it returned "+s+".");return{red:parseInt(""+l[1],10),green:parseInt(""+l[2],10),blue:parseInt(""+l[3],10),alpha:parseFloat(""+u[4])}}throw new Error("Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.")}function T(e){return function(e){var r=e.red/255,t=e.green/255,n=e.blue/255,a=Math.max(r,t,n),o=Math.min(r,t,n),i=(a+o)/2;if(a===o)return void 0!==e.alpha?{hue:0,saturation:0,lightness:i,alpha:e.alpha}:{hue:0,saturation:0,lightness:i};var u=void 0,s=a-o,l=i>.5?s/(2-a-o):s/(a+o);switch(a){case r:u=(t-n)/s+(t<n?6:0);break;case t:u=(n-r)/s+2;break;default:u=(r-t)/s+4}return u*=60,void 0!==e.alpha?{hue:u,saturation:l,lightness:i,alpha:e.alpha}:{hue:u,saturation:l,lightness:i}}(P(e))}var R=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function M(e){var r=e.toString(16);return 1===r.length?"0"+r:r}function q(e,r,t){if("number"==typeof e&&"number"==typeof r&&"number"==typeof t)return R("#"+M(e)+M(r)+M(t));if("object"==typeof e&&void 0===r&&void 0===t)return R("#"+M(e.red)+M(e.green)+M(e.blue));throw new Error("Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).")}function W(e,r,t,n){if("string"==typeof e&&"number"==typeof r){var a=P(e);return"rgba("+a.red+","+a.green+","+a.blue+","+r+")"}if("number"==typeof e&&"number"==typeof r&&"number"==typeof t&&"number"==typeof n)return n>=1?q(e,r,t):"rgba("+e+","+r+","+t+","+n+")";if("object"==typeof e&&void 0===r&&void 0===t&&void 0===n)return e.alpha>=1?q(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new Error("Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).")}function B(e){return M(Math.round(255*e))}function Q(e,r,t){return R("#"+B(e)+B(r)+B(t))}function H(e,r,t){return I(e,r,t,Q)}function L(e,r,t){if("number"==typeof e&&"number"==typeof r&&"number"==typeof t)return H(e,r,t);if("object"==typeof e&&void 0===r&&void 0===t)return H(e.hue,e.saturation,e.lightness);throw new Error("Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).")}function N(e,r,t,n){if("number"==typeof e&&"number"==typeof r&&"number"==typeof t&&"number"==typeof n)return n>=1?H(e,r,t):"rgba("+I(e,r,t)+","+n+")";if("object"==typeof e&&void 0===r&&void 0===t&&void 0===n)return e.alpha>=1?H(e.hue,e.saturation,e.lightness):"rgba("+I(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new Error("Passed invalid arguments to hsla, please pass multiple numbers e.g. hsl(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).")}var $=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)},D=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha},V=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)},_=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha},G="Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.";function J(e){if("object"!=typeof e)throw new Error(G);if(D(e))return W(e);if($(e))return q(e);if(_(e))return N(e);if(V(e))return L(e);throw new Error(G)}function U(e){return function e(r,t,n){return function(){var a=n.concat(Array.prototype.slice.call(arguments));return a.length>=t?r.apply(this,a):e(r,t,a)}}(e,e.length,[])}var Y=U(function(e,r){var t=T(r);return J(b({},t,{hue:(t.hue+e)%360}))});function Z(e,r,t){return Math.max(e,Math.min(r,t))}var K=U(function(e,r){var t=T(r);return J(b({},t,{lightness:Z(0,1,t.lightness-e)}))});var X=U(function(e,r){var t=T(r);return J(b({},t,{saturation:Z(0,1,t.saturation-e)}))});function ee(e){var r=P(e),t=Object.keys(r).map(function(e){var t=r[e]/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)});return.2126*t[0]+.7152*t[1]+.0722*t[2]}var re=U(function(e,r){var t=T(r);return J(b({},t,{lightness:Z(0,1,t.lightness+e)}))});var te=U(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,r=arguments[1],t=arguments[2],n=P(r),a=b({},n,{alpha:"number"==typeof n.alpha?n.alpha:1}),o=P(t),i=b({},o,{alpha:"number"==typeof o.alpha?o.alpha:1}),u=a.alpha-i.alpha,s=2*e-1,l=((s*u==-1?s:s+u)/(1+s*u)+1)/2,f=1-l;return W({red:Math.floor(a.red*l+i.red*f),green:Math.floor(a.green*l+i.green*f),blue:Math.floor(a.blue*l+i.blue*f),alpha:a.alpha+(i.alpha-a.alpha)*(e/1)})});var ne=U(function(e,r){var t=P(r),n="number"==typeof t.alpha?t.alpha:1;return W(b({},t,{alpha:Z(0,1,(100*n+100*e)/100)}))});var ae=U(function(e){return ee(e)>.179?"#000":"#fff"});var oe=U(function(e,r){var t=T(r);return J(b({},t,{saturation:Z(0,1,t.saturation+e)}))});var ie=U(function(e,r){return J(b({},T(r),{hue:e}))});var ue=U(function(e,r){return J(b({},T(r),{lightness:e}))});var se=U(function(e,r){return J(b({},T(r),{saturation:e}))});var le=U(function(e,r){if("number"!=typeof e||e>1||e<-1)throw new Error("Passed an incorrect argument to shade, please pass a percentage less than or equal to 1 and larger than or equal to -1.");if("string"!=typeof r)throw new Error("Passed an incorrect argument to a color function, please pass a string representation of a color.");return te(e,r,"rgb(0, 0, 0)")});var fe=U(function(e,r){if("number"!=typeof e||e>1||e<-1)throw new Error("Passed an incorrect argument to tint, please pass a percentage less than or equal to 1 and larger than or equal to -1.");if("string"!=typeof r)throw new Error("Passed an incorrect argument to a color function, please pass a string representation of a color.");return te(e,r,"rgb(255, 255, 255)")});var ce=U(function(e,r){var t=P(r),n="number"==typeof t.alpha?t.alpha:1;return W(b({},t,{alpha:Z(0,1,(100*n-100*e)/100)}))});function pe(e,r){return e(r?":"+r:"")}function de(e,r,t){if(!r)throw new Error("You must provide a template to this method.");if(0===e.length)return pe(r,null);for(var n=[],a=0;a<e.length;a+=1){if(t&&t.indexOf(e[a])<0)throw new Error("You passed an unsupported selector state to this method.");n.push(pe(r,e[a]))}return n=n.join(",")}var he=[void 0,null,"active","focus","hover"];function be(e){return"button"+e+',\n input[type="button"]'+e+',\n input[type="reset"]'+e+',\n input[type="submit"]'+e}var ge=["absolute","fixed","relative","static","sticky"];var me=[void 0,null,"active","focus","hover"];function ve(e){return'input[type="color"]'+e+',\n input[type="date"]'+e+',\n input[type="datetime"]'+e+',\n input[type="datetime-local"]'+e+',\n input[type="email"]'+e+',\n input[type="month"]'+e+',\n input[type="number"]'+e+',\n input[type="password"]'+e+',\n input[type="search"]'+e+',\n input[type="tel"]'+e+',\n input[type="text"]'+e+',\n input[type="time"]'+e+',\n input[type="url"]'+e+',\n input[type="week"]'+e+",\n input:not([type])"+e+",\n textarea"+e}e.adjustHue=Y,e.animation=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];var n=Array.isArray(r[0]);if(!n&&r.length>8)throw new Error("The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation");return{animation:r.map(function(e){if(n&&!Array.isArray(e)||!n&&Array.isArray(e))throw new Error("To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')");if(Array.isArray(e)&&e.length>8)throw new Error("The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation");return Array.isArray(e)?e.join(" "):e}).join(", ")}},e.backgroundImages=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return{backgroundImage:r.join(", ")}},e.backgrounds=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return{background:r.join(", ")}},e.borderColor=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return a.apply(void 0,["borderColor"].concat(r))},e.borderRadius=function(e,t){var n,a,o=r(e);if(!t&&0!==t)throw new Error("borderRadius expects a radius value as a string or number as the second argument.");if("Top"===o||"Bottom"===o)return(n={})["border"+o+"RightRadius"]=t,n["border"+o+"LeftRadius"]=t,n;if("Left"===o||"Right"===o)return(a={})["borderTop"+o+"Radius"]=t,a["borderBottom"+o+"Radius"]=t,a;throw new Error('borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.')},e.borderStyle=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return a.apply(void 0,["borderStyle"].concat(r))},e.borderWidth=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return a.apply(void 0,["borderWidth"].concat(r))},e.buttons=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return de(r,be,he)},e.clearFix=function(){var e;return(e={})[(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"&")+"::after"]={clear:"both",content:'""',display:"table"},e},e.complement=function(e){var r=T(e);return J(b({},r,{hue:(r.hue+180)%360}))},e.darken=K,e.desaturate=X,e.directionalProperty=a,e.ellipsis=function(){return{display:"inline-block",maxWidth:arguments.length>0&&void 0!==arguments[0]?arguments[0]:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",wordWrap:"normal"}},e.em=s,e.fontFace=function(e){var r=e.fontFamily,t=e.fontFilePath,n=e.fontStretch,a=e.fontStyle,o=e.fontVariant,i=e.fontWeight,u=e.fileFormats,s=void 0===u?["eot","woff2","woff","ttf","svg"]:u,l=e.localFonts,f=e.unicodeRange;if(!r)throw new Error("fontFace expects a name of a font-family.");if(!t&&!l)throw new Error("fontFace expects either the path to the font file(s) or a name of a local copy.");if(l&&!Array.isArray(l))throw new Error("fontFace expects localFonts to be an array.");if(!Array.isArray(s))throw new Error("fontFace expects fileFormats to be an array.");var c={"@font-face":{fontFamily:r,src:function(e,r,t){var n=[];return r&&n.push(function(e){return e.map(function(e){return'local("'+e+'")'}).join(", ")}(r)),e&&n.push(function(e,r){return r.map(function(r){return'url("'+e+"."+r+'")'}).join(", ")}(e,t)),n.join(", ")}(t,l,s),unicodeRange:f,fontStretch:n,fontStyle:a,fontVariant:o,fontWeight:i}};return JSON.parse(JSON.stringify(c))},e.getLuminance=ee,e.grayscale=function(e){return J(b({},T(e),{saturation:0}))},e.invert=function(e){var r=P(e);return J(b({},r,{red:255-r.red,green:255-r.green,blue:255-r.blue}))},e.hideText=function(){return{textIndent:"101%",overflow:"hidden",whiteSpace:"nowrap"}},e.hideVisually=function(){return{border:"0",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",whiteSpace:"nowrap",width:"1px"}},e.hiDPI=c,e.hsl=L,e.hsla=N,e.lighten=re,e.margin=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return a.apply(void 0,["margin"].concat(r))},e.mix=te,e.modularScale=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"1em",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"perfectFourth";if("number"!=typeof e)throw new Error("Please provide a number of steps to the modularScale helper.");if("string"==typeof t&&!l[t])throw new Error("Please pass a number or one of the predefined scales to the modularScale helper as the ratio.");var n="string"==typeof r?i(r):r,a="string"==typeof t?l[t]:t;if("string"==typeof n)throw new Error('Invalid value passed as base to modularScale, expected number or em string but got "'+r+'"');return n*Math.pow(a,e)+"em"},e.normalize=function(e){return e?m:(r=g,t=b({},m),Object.keys(r).forEach(function(e){t[e]?t[e]=b({},t[e],r[e]):t[e]=b({},r[e])}),t);var r,t},e.opacify=ne,e.padding=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return a.apply(void 0,["padding"].concat(r))},e.parseToHsl=T,e.parseToRgb=P,e.placeholder=function(e){var r,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&";return(r={})[t+"::-webkit-input-placeholder"]=b({},e),r[t+":-moz-placeholder"]=b({},e),r[t+"::-moz-placeholder"]=b({},e),r[t+":-ms-input-placeholder"]=b({},e),r},e.position=function(e){for(var r=arguments.length,t=Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(ge.indexOf(e)>=0)return b({position:e},a.apply(void 0,[""].concat(t)));var o=e;return a.apply(void 0,["",o].concat(t))},e.radialGradient=function(e){var r=e.colorStops,t=e.extent,n=e.fallback,a=e.position,o=e.shape;if(!r||r.length<2)throw new Error("radialGradient requries at least 2 color-stops to properly render.");return{backgroundColor:n||function(e){return e[0].split(" ")[0]}(r),backgroundImage:function(e){for(var r="",t=0;t<e.length;t+=1)r+=e[t],3===t&&(arguments.length<=t+1?void 0:arguments[t+1])&&((arguments.length<=1?void 0:arguments[1])||(arguments.length<=2?void 0:arguments[2])||(arguments.length<=3?void 0:arguments[3]))?(r=r.slice(0,-1),r+=", "+(arguments.length<=t+1?void 0:arguments[t+1])):3!==t||arguments.length<=t+1||!arguments[t+1]||(arguments.length<=1?void 0:arguments[1])||(arguments.length<=2?void 0:arguments[2])||(arguments.length<=3?void 0:arguments[3])?(arguments.length<=t+1?void 0:arguments[t+1])&&(r+=(arguments.length<=t+1?void 0:arguments[t+1])+" "):r+=""+(arguments.length<=t+1?void 0:arguments[t+1]);return r.trim()}(v,a,o,t,r.join(", "))}},e.readableColor=ae,e.rem=f,e.retinaImage=function(e,r){var t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"png",a=arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"_2x";if(!e)throw new Error("Please supply a filename to retinaImage() as the first argument.");var i=n.replace(/^\./,""),u=a?a+"."+i:""+e+o+"."+i;return(t={backgroundImage:"url("+e+"."+i+")"})[c()]={backgroundImage:"url("+u+")",backgroundSize:r},t},e.rgb=q,e.rgba=W,e.saturate=oe,e.selection=function(e){var r,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(r={})[t+"::-moz-selection"]=b({},e),r[t+"::selection"]=b({},e),r},e.setHue=ie,e.setLightness=ue,e.setSaturation=se,e.shade=le,e.size=function(e){return{height:e,width:arguments.length>1&&void 0!==arguments[1]?arguments[1]:e}},e.stripUnit=i,e.textInputs=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return de(r,ve,me)},e.timingFunctions=function(e){return y[e]},e.tint=fe,e.toColorString=J,e.transitions=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return{transition:r.join(", ")}},e.transparentize=ce,e.triangle=function(e){var r,t=e.pointingDirection,n=e.height,a=e.width,o=e.foregroundColor,i=e.backgroundColor,u=void 0===i?"transparent":i,s=parseFloat(n),l=parseFloat(a);if(isNaN(s)||isNaN(l))throw new Error("Passed an invalid value to `height` or `width`. Please provide a pixel based unit");return(r={borderColor:u,width:"0",height:"0",borderWidth:w(t,s,l),borderStyle:"solid"})["border"+x[t]+"Color"]=o+" !important",r},e.wordWrap=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"break-word";return{overflowWrap:e,wordWrap:e,wordBreak:"break-word"===e?"break-all":e}},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(e.polished={})}(this,function(e){"use strict";function o(e){return e.charAt(0).toUpperCase()+e.slice(1)}var f=["Top","Right","Bottom","Left"];function p(e,r){if(!e)return r.toLowerCase();var t=e.split("-");if(1<t.length)return t.splice(1,0,r),t.reduce(function(e,r){return""+e+o(r)});var n=e.replace(/([a-z])([A-Z])/g,"$1"+r+"$2");return e===n?""+e+r:n}function a(e){for(var r=arguments.length,t=Array(1<r?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];var a=t[0],o=t[1],i=void 0===o?a:o,u=t[2],s=void 0===u?a:u,l=t[3];return function(e,r){for(var t={},n=0;n<r.length;n+=1)(r[n]||0===r[n])&&(t[p(e,f[n])]=r[n]);return t}(e,[a,i,s,void 0===l?i:l])}function i(e,r){return e.substr(-r.length)===r}function u(e){var r=parseFloat(e);return isNaN(r)?e:r}var r=function(a){return function(e){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"16px",t=e,n=r;if("string"==typeof e){if(!i(e,"px"))throw new Error('Expected a string ending in "px" or a number passed as the first argument to '+a+'(), got "'+e+'" instead.');t=u(e)}if("string"==typeof r){if(!i(r,"px"))throw new Error('Expected a string ending in "px" or a number passed as the second argument to '+a+'(), got "'+r+'" instead.');n=u(r)}if("string"==typeof t)throw new Error('Passed invalid pixel value ("'+e+'") to '+a+'(), please pass a value like "12px" or 12.');if("string"==typeof n)throw new Error('Passed invalid base value ("'+r+'") to '+a+'(), please pass a value like "12px" or 12.');return""+t/n+a}},t=r("em"),n=/^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;function m(e){if("string"!=typeof e)return[e,""];var r=e.match(n);return r?[parseFloat(e),r[2]]:[e,void 0]}var s={minorSecond:1.067,majorSecond:1.125,minorThird:1.2,majorThird:1.25,perfectFourth:1.333,augFourth:1.414,perfectFifth:1.5,minorSixth:1.6,goldenSection:1.618,majorSixth:1.667,minorSeventh:1.778,majorSeventh:1.875,octave:2,majorTenth:2.5,majorEleventh:2.667,majorTwelfth:3,doubleOctave:4};var l=r("rem");function b(e,r){var t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"320px",n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"1200px",a=m(e),o=a[0],i=a[1],u=m(r),s=u[0],l=u[1],f=m(t),p=f[0],d=f[1],c=m(n),h=c[0],b=c[1];if("number"!=typeof p||"number"!=typeof h||!d||!b||d!==b)throw new Error("minScreen and maxScreen must be provided as stringified numbers with the same units.");if("number"!=typeof o||"number"!=typeof s||!i||!l||i!==l)throw new Error("fromSize and toSize must be provided as stringified numbers with the same units.");var g=(o-s)/(p-h);return"calc("+(s-g*h)+i+" + "+100*g+"vw)"}var g=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e};function d(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1.3;return"\n @media only screen and (-webkit-min-device-pixel-ratio: "+e+"),\n only screen and (min--moz-device-pixel-ratio: "+e+"),\n only screen and (-o-min-device-pixel-ratio: "+e+"/1),\n only screen and (min-resolution: "+Math.round(96*e)+"dpi),\n only screen and (min-resolution: "+e+"dppx)\n "}var c=function(e,r){return e.raw=r,e}(["radial-gradient(","","","",")"],["radial-gradient(","","","",")"]);var h={easeInBack:"cubic-bezier(0.600, -0.280, 0.735, 0.045)",easeInCirc:"cubic-bezier(0.600, 0.040, 0.980, 0.335)",easeInCubic:"cubic-bezier(0.550, 0.055, 0.675, 0.190)",easeInExpo:"cubic-bezier(0.950, 0.050, 0.795, 0.035)",easeInQuad:"cubic-bezier(0.550, 0.085, 0.680, 0.530)",easeInQuart:"cubic-bezier(0.895, 0.030, 0.685, 0.220)",easeInQuint:"cubic-bezier(0.755, 0.050, 0.855, 0.060)",easeInSine:"cubic-bezier(0.470, 0.000, 0.745, 0.715)",easeOutBack:"cubic-bezier(0.175, 0.885, 0.320, 1.275)",easeOutCubic:"cubic-bezier(0.215, 0.610, 0.355, 1.000)",easeOutCirc:"cubic-bezier(0.075, 0.820, 0.165, 1.000)",easeOutExpo:"cubic-bezier(0.190, 1.000, 0.220, 1.000)",easeOutQuad:"cubic-bezier(0.250, 0.460, 0.450, 0.940)",easeOutQuart:"cubic-bezier(0.165, 0.840, 0.440, 1.000)",easeOutQuint:"cubic-bezier(0.230, 1.000, 0.320, 1.000)",easeOutSine:"cubic-bezier(0.390, 0.575, 0.565, 1.000)",easeInOutBack:"cubic-bezier(0.680, -0.550, 0.265, 1.550)",easeInOutCirc:"cubic-bezier(0.785, 0.135, 0.150, 0.860)",easeInOutCubic:"cubic-bezier(0.645, 0.045, 0.355, 1.000)",easeInOutExpo:"cubic-bezier(1.000, 0.000, 0.000, 1.000)",easeInOutQuad:"cubic-bezier(0.455, 0.030, 0.515, 0.955)",easeInOutQuart:"cubic-bezier(0.770, 0.000, 0.175, 1.000)",easeInOutQuint:"cubic-bezier(0.860, 0.000, 0.070, 1.000)",easeInOutSine:"cubic-bezier(0.445, 0.050, 0.550, 0.950)"};function v(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return a.apply(void 0,["borderColor"].concat(r))}var y=["bottom","left","top","right"];function w(e){return Math.round(255*e)}function x(e,r,t){return w(e)+","+w(r)+","+w(t)}function k(e,r,t){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:x;if(0===r)return n(t,t,t);var a=e%360/60,o=(1-Math.abs(2*t-1))*r,i=o*(1-Math.abs(a%2-1)),u=0,s=0,l=0;0<=a&&a<1?(u=o,s=i):1<=a&&a<2?(u=i,s=o):2<=a&&a<3?(s=o,l=i):3<=a&&a<4?(s=i,l=o):4<=a&&a<5?(u=i,l=o):5<=a&&a<6&&(u=o,l=i);var f=t-o/2;return n(u+f,s+f,l+f)}var S={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var z=/^#[a-fA-F0-9]{6}$/,I=/^#[a-fA-F0-9]{8}$/,A=/^#[a-fA-F0-9]{3}$/,F=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/,E=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/,j=/^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/,O=/^hsla\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/;function C(e){if("string"!=typeof e)throw new Error("Passed an incorrect argument to a color function, please pass a string representation of a color.");var r=function(e){if("string"!=typeof e)return e;var r=e.toLowerCase();return S[r]?"#"+S[r]:e}(e);if(r.match(z))return{red:parseInt(""+r[1]+r[2],16),green:parseInt(""+r[3]+r[4],16),blue:parseInt(""+r[5]+r[6],16)};if(r.match(I)){var t=parseFloat((parseInt(""+r[7]+r[8],16)/255).toFixed(2));return{red:parseInt(""+r[1]+r[2],16),green:parseInt(""+r[3]+r[4],16),blue:parseInt(""+r[5]+r[6],16),alpha:t}}if(r.match(A))return{red:parseInt(""+r[1]+r[1],16),green:parseInt(""+r[2]+r[2],16),blue:parseInt(""+r[3]+r[3],16)};var n=F.exec(r);if(n)return{red:parseInt(""+n[1],10),green:parseInt(""+n[2],10),blue:parseInt(""+n[3],10)};var a=E.exec(r);if(a)return{red:parseInt(""+a[1],10),green:parseInt(""+a[2],10),blue:parseInt(""+a[3],10),alpha:parseFloat(""+a[4])};var o=j.exec(r);if(o){var i="rgb("+k(parseInt(""+o[1],10),parseInt(""+o[2],10)/100,parseInt(""+o[3],10)/100)+")",u=F.exec(i);if(!u)throw new Error("Couldn't generate valid rgb string from "+r+", it returned "+i+".");return{red:parseInt(""+u[1],10),green:parseInt(""+u[2],10),blue:parseInt(""+u[3],10)}}var s=O.exec(r);if(s){var l="rgb("+k(parseInt(""+s[1],10),parseInt(""+s[2],10)/100,parseInt(""+s[3],10)/100)+")",f=F.exec(l);if(!f)throw new Error("Couldn't generate valid rgb string from "+r+", it returned "+l+".");return{red:parseInt(""+f[1],10),green:parseInt(""+f[2],10),blue:parseInt(""+f[3],10),alpha:parseFloat(""+s[4])}}throw new Error("Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.")}function P(e){return function(e){var r=e.red/255,t=e.green/255,n=e.blue/255,a=Math.max(r,t,n),o=Math.min(r,t,n),i=(a+o)/2;if(a===o)return void 0!==e.alpha?{hue:0,saturation:0,lightness:i,alpha:e.alpha}:{hue:0,saturation:0,lightness:i};var u=void 0,s=a-o,l=.5<i?s/(2-a-o):s/(a+o);switch(a){case r:u=(t-n)/s+(t<n?6:0);break;case t:u=(n-r)/s+2;break;default:u=(r-t)/s+4}return u*=60,void 0!==e.alpha?{hue:u,saturation:l,lightness:i,alpha:e.alpha}:{hue:u,saturation:l,lightness:i}}(C(e))}var W=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function R(e){var r=e.toString(16);return 1===r.length?"0"+r:r}function T(e){return R(Math.round(255*e))}function M(e,r,t){return W("#"+T(e)+T(r)+T(t))}function q(e,r,t){return k(e,r,t,M)}function $(e,r,t){if("number"==typeof e&&"number"==typeof r&&"number"==typeof t)return q(e,r,t);if("object"==typeof e&&void 0===r&&void 0===t)return q(e.hue,e.saturation,e.lightness);throw new Error("Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).")}function B(e,r,t,n){if("number"==typeof e&&"number"==typeof r&&"number"==typeof t&&"number"==typeof n)return 1<=n?q(e,r,t):"rgba("+k(e,r,t)+","+n+")";if("object"==typeof e&&void 0===r&&void 0===t&&void 0===n)return 1<=e.alpha?q(e.hue,e.saturation,e.lightness):"rgba("+k(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new Error("Passed invalid arguments to hsla, please pass multiple numbers e.g. hsl(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).")}function Q(e,r,t){if("number"==typeof e&&"number"==typeof r&&"number"==typeof t)return W("#"+R(e)+R(r)+R(t));if("object"==typeof e&&void 0===r&&void 0===t)return W("#"+R(e.red)+R(e.green)+R(e.blue));throw new Error("Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).")}function H(e,r,t,n){if("string"==typeof e&&"number"==typeof r){var a=C(e);return"rgba("+a.red+","+a.green+","+a.blue+","+r+")"}if("number"==typeof e&&"number"==typeof r&&"number"==typeof t&&"number"==typeof n)return 1<=n?Q(e,r,t):"rgba("+e+","+r+","+t+","+n+")";if("object"==typeof e&&void 0===r&&void 0===t&&void 0===n)return 1<=e.alpha?Q(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new Error("Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).")}var N=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)},D=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha},L=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)},V=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha},U="Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.";function _(e){if("object"!=typeof e)throw new Error(U);if(D(e))return H(e);if(N(e))return Q(e);if(V(e))return B(e);if(L(e))return $(e);throw new Error(U)}function G(e){return function r(t,n,a){return function(){var e=a.concat(Array.prototype.slice.call(arguments));return e.length>=n?t.apply(this,e):r(t,n,e)}}(e,e.length,[])}function J(e,r){var t=P(r);return _(g({},t,{hue:(t.hue+parseFloat(e))%360}))}var Y=G(J);function Z(e,r,t){return Math.max(e,Math.min(r,t))}function K(e,r){var t=P(r);return _(g({},t,{lightness:Z(0,1,t.lightness-parseFloat(e))}))}var X=G(K);function ee(e,r){var t=P(r);return _(g({},t,{saturation:Z(0,1,t.saturation-parseFloat(e))}))}var re=G(ee);function te(e){var t=C(e),r=Object.keys(t).map(function(e){var r=t[e]/255;return r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4)});return.2126*r[0]+.7152*r[1]+.0722*r[2]}function ne(e,r){var t=P(r);return _(g({},t,{lightness:Z(0,1,t.lightness+parseFloat(e))}))}var ae=G(ne);function oe(e,r,t){var n=C(r),a=g({},n,{alpha:"number"==typeof n.alpha?n.alpha:1}),o=C(t),i=g({},o,{alpha:"number"==typeof o.alpha?o.alpha:1}),u=a.alpha-i.alpha,s=2*parseFloat(e)-1,l=((s*u==-1?s:s+u)/(1+s*u)+1)/2,f=1-l;return H({red:Math.floor(a.red*l+i.red*f),green:Math.floor(a.green*l+i.green*f),blue:Math.floor(a.blue*l+i.blue*f),alpha:a.alpha+(i.alpha-a.alpha)*(parseFloat(e)/1)})}var ie=G(oe);function ue(e,r){var t=C(r),n="number"==typeof t.alpha?t.alpha:1;return H(g({},t,{alpha:Z(0,1,(100*n+100*parseFloat(e))/100)}))}var se=G(ue);function le(e){return.179<te(e)?"#000":"#fff"}var fe=G(le);function pe(e,r){var t=P(r);return _(g({},t,{saturation:Z(0,1,t.saturation+parseFloat(e))}))}var de=G(pe);function ce(e,r){return _(g({},P(r),{hue:parseFloat(e)}))}var he=G(ce);function be(e,r){return _(g({},P(r),{lightness:parseFloat(e)}))}var ge=G(be);function me(e,r){return _(g({},P(r),{saturation:parseFloat(e)}))}var ve=G(me);function ye(e,r){return ie(parseFloat(e),r,"rgb(0, 0, 0)")}var we=G(ye);function xe(e,r){return ie(parseFloat(e),r,"rgb(255, 255, 255)")}var ke=G(xe);function Se(e,r){var t=C(r),n="number"==typeof t.alpha?t.alpha:1;return H(g({},t,{alpha:Z(0,1,(100*n-100*parseFloat(e))/100)}))}var ze=G(Se);var Ie=["top","right","bottom","left"];function Ae(e,r){return e(r?":"+r:"")}function Fe(e,r,t){if(!r)throw new Error("You must provide a template to this method.");if(0===e.length)return Ae(r,null);for(var n=[],a=0;a<e.length;a+=1){if(t&&t.indexOf(e[a])<0)throw new Error("You passed an unsupported selector state to this method.");n.push(Ae(r,e[a]))}return n=n.join(",")}var Ee=[void 0,null,"active","focus","hover"];function je(e){return"button"+e+',\n input[type="button"]'+e+',\n input[type="reset"]'+e+',\n input[type="submit"]'+e}var Oe=["absolute","fixed","relative","static","sticky"];var Ce=[void 0,null,"active","focus","hover"];function Pe(e){return'input[type="color"]'+e+',\n input[type="date"]'+e+',\n input[type="datetime"]'+e+',\n input[type="datetime-local"]'+e+',\n input[type="email"]'+e+',\n input[type="month"]'+e+',\n input[type="number"]'+e+',\n input[type="password"]'+e+',\n input[type="search"]'+e+',\n input[type="tel"]'+e+',\n input[type="text"]'+e+',\n input[type="time"]'+e+',\n input[type="url"]'+e+',\n input[type="week"]'+e+",\n input:not([type])"+e+",\n textarea"+e}e.adjustHue=Y,e.animation=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];var n=Array.isArray(r[0]);if(!n&&8<r.length)throw new Error("The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation");return{animation:r.map(function(e){if(n&&!Array.isArray(e)||!n&&Array.isArray(e))throw new Error("To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')");if(Array.isArray(e)&&8<e.length)throw new Error("The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation");return Array.isArray(e)?e.join(" "):e}).join(", ")}},e.backgroundImages=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return{backgroundImage:r.join(", ")}},e.backgrounds=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return{background:r.join(", ")}},e.between=b,e.border=function(e){for(var r=arguments.length,t=Array(1<r?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];var a;return"string"==typeof e&&0<=Ie.indexOf(e)?((a={})["border"+o(e)+"Width"]=t[0],a["border"+o(e)+"Style"]=t[1],a["border"+o(e)+"Color"]=t[2],a):(t.unshift(e),{borderWidth:t[0],borderStyle:t[1],borderColor:t[2]})},e.borderColor=v,e.borderRadius=function(e,r){var t,n,a=o(e);if(!r&&0!==r)throw new Error("borderRadius expects a radius value as a string or number as the second argument.");if("Top"===a||"Bottom"===a)return(t={})["border"+a+"RightRadius"]=r,t["border"+a+"LeftRadius"]=r,t;if("Left"===a||"Right"===a)return(n={})["borderTop"+a+"Radius"]=r,n["borderBottom"+a+"Radius"]=r,n;throw new Error('borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.')},e.borderStyle=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return a.apply(void 0,["borderStyle"].concat(r))},e.borderWidth=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return a.apply(void 0,["borderWidth"].concat(r))},e.buttons=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return Fe(r,je,Ee)},e.clearFix=function(){var e;return(e={})[(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"&")+"::after"]={clear:"both",content:'""',display:"table"},e},e.complement=function(e){var r=P(e);return _(g({},r,{hue:(r.hue+180)%360}))},e.cover=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0;return{position:"absolute",top:e,right:e,bottom:e,left:e}},e.darken=X,e.desaturate=re,e.directionalProperty=a,e.ellipsis=function(){return[{display:"inline-block",maxWidth:0<arguments.length&&void 0!==arguments[0]?arguments[0]:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",wordWrap:"normal"},{display:"inline-flex"}]},e.em=t,e.fluidRange=function(e){var r,t,n,a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"320px",o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"1200px";if(!Array.isArray(e)&&"object"!=typeof e||null===e)throw new Error("expects either an array of objects or a single object with the properties prop, fromSize, and toSize.");if(Array.isArray(e)){var i={},u={},s=e,l=Array.isArray(s),f=0;for(s=l?s:s[Symbol.iterator]();;){var p,d,c;if(l){if(f>=s.length)break;c=s[f++]}else{if((f=s.next()).done)break;c=f.value}var h=c;if(!h.prop||!h.fromSize||!h.toSize)throw new Error("expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.");u[h.prop]=h.fromSize,i["@media (min-width: "+a+")"]=g({},i["@media (min-width: "+a+")"],((p={})[h.prop]=b(h.fromSize,h.toSize,a,o),p)),i["@media (min-width: "+o+")"]=g({},i["@media (min-width: "+o+")"],((d={})[h.prop]=h.toSize,d))}return g({},u,i)}if(!e.prop||!e.fromSize||!e.toSize)throw new Error("expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.");return(n={})[e.prop]=e.fromSize,n["@media (min-width: "+a+")"]=((r={})[e.prop]=b(e.fromSize,e.toSize,a,o),r),n["@media (min-width: "+o+")"]=((t={})[e.prop]=e.toSize,t),n},e.fontFace=function(e){var r=e.fontFamily,t=e.fontFilePath,n=e.fontStretch,a=e.fontStyle,o=e.fontVariant,i=e.fontWeight,u=e.fileFormats,s=void 0===u?["eot","woff2","woff","ttf","svg"]:u,l=e.localFonts,f=e.unicodeRange,p=e.fontDisplay,d=e.fontVariationSettings,c=e.fontFeatureSettings;if(!r)throw new Error("fontFace expects a name of a font-family.");if(!t&&!l)throw new Error("fontFace expects either the path to the font file(s) or a name of a local copy.");if(l&&!Array.isArray(l))throw new Error("fontFace expects localFonts to be an array.");if(!Array.isArray(s))throw new Error("fontFace expects fileFormats to be an array.");var h,b,g,m,v,y={"@font-face":{fontFamily:r,src:(h=t,b=l,g=s,v=[],b&&v.push(b.map(function(e){return'local("'+e+'")'}).join(", ")),h&&v.push((m=h,g.map(function(e){return'url("'+m+"."+e+'")'}).join(", "))),v.join(", ")),unicodeRange:f,fontStretch:n,fontStyle:a,fontVariant:o,fontWeight:i,fontDisplay:p,fontVariationSettings:d,fontFeatureSettings:c}};return JSON.parse(JSON.stringify(y))},e.getLuminance=te,e.getValueAndUnit=m,e.grayscale=function(e){return _(g({},P(e),{saturation:0}))},e.invert=function(e){var r=C(e);return _(g({},r,{red:255-r.red,green:255-r.green,blue:255-r.blue}))},e.hideText=function(){return{textIndent:"101%",overflow:"hidden",whiteSpace:"nowrap"}},e.hideVisually=function(){return{border:"0",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",whiteSpace:"nowrap",width:"1px"}},e.hiDPI=d,e.hsl=$,e.hsla=B,e.lighten=ae,e.margin=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return a.apply(void 0,["margin"].concat(r))},e.mix=ie,e.modularScale=function(e){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"1em",t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"perfectFourth";if("number"!=typeof e)throw new Error("Please provide a number of steps to the modularScale helper.");if("string"==typeof t&&!s[t])throw new Error("Please pass a number or one of the predefined scales to the modularScale helper as the ratio.");var n="string"==typeof r?u(r):r,a="string"==typeof t?s[t]:t;if("string"==typeof n)throw new Error('Invalid value passed as base to modularScale, expected number or em string but got "'+r+'"');return n*Math.pow(a,e)+"em"},e.normalize=function(e){return{html:{lineHeight:"1.15",textSizeAdjust:"100%"},body:{margin:"0"},h1:{fontSize:"2em",margin:"0.67em 0"},hr:{boxSizing:"content-box",height:"0",overflow:"visible"},pre:{fontFamily:"monospace, monospace",fontSize:"1em"},a:{"background-color":"transparent"},"abbr[title]":[{borderBottom:"none",textDecoration:"underline"},{textDecoration:"underline dotted"}],"b,\n strong":{fontWeight:"bolder"},"code,\n kbd,\n samp":{fontFamily:"monospace, monospace",fontSize:"1em"},small:{fontSize:"80%"},"sub,\n sup":{fontSize:"75%",lineHeight:"0",position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},img:{borderStyle:"none"},"button,\n input,\n optgroup,\n select,\n textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"1.15",margin:"0"},"button,\n input":{overflow:"visible"},"button,\n select":{textTransform:"none"},'button,\n html [type="button"],\n [type="reset"],\n [type="submit"]':{WebkitAppearance:"button"},'button::-moz-focus-inner,\n [type="button"]::-moz-focus-inner,\n [type="reset"]::-moz-focus-inner,\n [type="submit"]::-moz-focus-inner':{borderStyle:"none",padding:"0"},'button:-moz-focusring,\n [type="button"]:-moz-focusring,\n [type="reset"]:-moz-focusring,\n [type="submit"]:-moz-focusring':{outline:"1px dotted ButtonText"},fieldset:{padding:"0.35em 0.625em 0.75em"},legend:{boxSizing:"border-box",color:"inherit",display:"table",maxWidth:"100%",padding:"0",whiteSpace:"normal"},progress:{verticalAlign:"baseline"},textarea:{overflow:"auto"},'[type="checkbox"],\n [type="radio"]':{boxSizing:"border-box",padding:"0"},'[type="number"]::-webkit-inner-spin-button,\n [type="number"]::-webkit-outer-spin-button':{height:"auto"},'[type="search"]':{WebkitAppearance:"textfield",outlineOffset:"-2px"},'[type="search"]::-webkit-search-decoration':{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},details:{display:"block"},summary:{display:"list-item"},template:{display:"none"},"[hidden]":{display:"none"}}},e.opacify=se,e.padding=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return a.apply(void 0,["padding"].concat(r))},e.parseToHsl=P,e.parseToRgb=C,e.placeholder=function(e){var r,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"&";return(r={})[t+"::-webkit-input-placeholder"]=g({},e),r[t+":-moz-placeholder"]=g({},e),r[t+"::-moz-placeholder"]=g({},e),r[t+":-ms-input-placeholder"]=g({},e),r},e.position=function(e){for(var r=arguments.length,t=Array(1<r?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return 0<=Oe.indexOf(e)?g({position:e},a.apply(void 0,[""].concat(t))):a.apply(void 0,["",e].concat(t))},e.radialGradient=function(e){var r,t=e.colorStops,n=e.extent,a=e.fallback,o=e.position,i=e.shape;if(!t||t.length<2)throw new Error("radialGradient requries at least 2 color-stops to properly render.");return{backgroundColor:a||(r=t,r[0].split(" ")[0]),backgroundImage:function(e){for(var r="",t=0;t<e.length;t+=1)r+=e[t],3===t&&(arguments.length<=t+1?void 0:arguments[t+1])&&((arguments.length<=1?void 0:arguments[1])||(arguments.length<=2?void 0:arguments[2])||(arguments.length<=3?void 0:arguments[3]))?(r=r.slice(0,-1),r+=", "+(arguments.length<=t+1?void 0:arguments[t+1])):3!==t||arguments.length<=t+1||!arguments[t+1]||(arguments.length<=1?void 0:arguments[1])||(arguments.length<=2?void 0:arguments[2])||(arguments.length<=3?void 0:arguments[3])?(arguments.length<=t+1?void 0:arguments[t+1])&&(r+=(arguments.length<=t+1?void 0:arguments[t+1])+" "):r+=""+(arguments.length<=t+1?void 0:arguments[t+1]);return r.trim()}(c,o,i,n,t.join(", "))}},e.readableColor=fe,e.rem=l,e.retinaImage=function(e,r){var t,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"png",a=arguments[3],o=4<arguments.length&&void 0!==arguments[4]?arguments[4]:"_2x";if(!e)throw new Error("Please supply a filename to retinaImage() as the first argument.");var i=n.replace(/^\./,""),u=a?a+"."+i:""+e+o+"."+i;return(t={backgroundImage:"url("+e+"."+i+")"})[d()]={backgroundImage:"url("+u+")",backgroundSize:r},t},e.rgb=Q,e.rgba=H,e.saturate=de,e.selection=function(e){var r,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";return(r={})[t+"::-moz-selection"]=g({},e),r[t+"::selection"]=g({},e),r},e.setHue=he,e.setLightness=ge,e.setSaturation=ve,e.shade=we,e.size=function(e){return{height:e,width:1<arguments.length&&void 0!==arguments[1]?arguments[1]:e}},e.stripUnit=u,e.textInputs=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return Fe(r,Pe,Ce)},e.timingFunctions=function(e){return h[e]},e.tint=ke,e.toColorString=_,e.transitions=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(Array.isArray(r[0])&&2===r.length){var n=r[1];if("string"!=typeof n)throw new Error("Property must be a string value.");return{transition:r[0].map(function(e){return e+" "+n}).join(", ")}}return{transition:r.join(", ")}},e.transparentize=ze,e.triangle=function(e){var r=e.pointingDirection,t=e.height,n=e.width,a=e.foregroundColor,o=e.backgroundColor,i=void 0===o?"transparent":o,u=[parseFloat(n),String(n).replace(/\d+/g,"")||"px"],s=[parseFloat(t),String(t).replace(/\d+/g,"")||"px"];if(isNaN(s[0])||isNaN(u[0]))throw new Error("Passed an invalid value to `height` or `width`. Please provide a pixel based unit");var l=y.indexOf(r);return g({width:"0",height:"0",borderWidth:function(e,r,t){switch(e){case"top":return"0 "+t[0]/2+t[1]+" "+r[0]+r[1]+" "+t[0]/2+t[1];case"left":return""+r[0]/2+r[1]+" "+t[0]+t[1]+" "+r[0]/2+r[1]+" 0";case"bottom":return""+r[0]+r[1]+" "+t[0]/2+t[1]+" 0 "+t[0]/2+t[1];case"right":return""+r[0]/2+r[1]+" 0 "+r[0]/2+r[1]+" "+t[0]+t[1];default:throw new Error("Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.")}}(r,s,u),borderStyle:"solid"},v.apply(void 0,Array.from({length:4}).map(function(e,r){return r===l?a:i})))},e.wordWrap=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"break-word";return{overflowWrap:e,wordWrap:e,wordBreak:"break-word"===e?"break-all":e}},Object.defineProperty(e,"__esModule",{value:!0})}); |
declare function curriedAdjustHueWith1(color: string): string; | ||
declare function curriedAdjustHue(degree: number): typeof curriedAdjustHueWith1; | ||
declare function curriedAdjustHue(degree: number, color: string): string; | ||
declare function curriedAdjustHue( | ||
degree: number | string, | ||
): typeof curriedAdjustHueWith1; | ||
declare function curriedAdjustHue( | ||
degree: number | string, | ||
color: string, | ||
): string; | ||
export default curriedAdjustHue; |
@@ -32,3 +32,3 @@ 'use strict'; | ||
* background: adjustHue(180, '#448'), | ||
* background: adjustHue(180, 'rgba(101,100,205,0.7)'), | ||
* background: adjustHue('180', 'rgba(101,100,205,0.7)'), | ||
* } | ||
@@ -39,3 +39,3 @@ * | ||
* background: ${adjustHue(180, '#448')}; | ||
* background: ${adjustHue(180, 'rgba(101,100,205,0.7)')}; | ||
* background: ${adjustHue('180', 'rgba(101,100,205,0.7)')}; | ||
* ` | ||
@@ -52,3 +52,3 @@ * | ||
return (0, _toColorString2.default)(_extends({}, hslColor, { | ||
hue: (hslColor.hue + degree) % 360 | ||
hue: (hslColor.hue + parseFloat(degree)) % 360 | ||
})); | ||
@@ -55,0 +55,0 @@ } |
declare function curriedDarkenWith1(color: string): string; | ||
declare function curriedDarken(amount: number): typeof curriedDarkenWith1; | ||
declare function curriedDarken(amount: number, color: string): string; | ||
declare function curriedDarken( | ||
amount: number | string, | ||
): typeof curriedDarkenWith1; | ||
declare function curriedDarken(amount: number | string, color: string): string; | ||
export default curriedDarken; |
@@ -9,2 +9,10 @@ 'use strict'; | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
var _guard = /*#__PURE__*/require('../internalHelpers/_guard'); | ||
var _guard2 = /*#__PURE__*/_interopRequireDefault(_guard); | ||
var _parseToHsl = /*#__PURE__*/require('./parseToHsl'); | ||
@@ -18,10 +26,2 @@ | ||
var _guard = /*#__PURE__*/require('../internalHelpers/_guard'); | ||
var _guard2 = /*#__PURE__*/_interopRequireDefault(_guard); | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -36,3 +36,3 @@ | ||
* background: darken(0.2, '#FFCD64'), | ||
* background: darken(0.2, 'rgba(255,205,100,0.7)'), | ||
* background: darken('0.2', 'rgba(255,205,100,0.7)'), | ||
* } | ||
@@ -43,3 +43,3 @@ * | ||
* background: ${darken(0.2, '#FFCD64')}; | ||
* background: ${darken(0.2, 'rgba(255,205,100,0.7)')}; | ||
* background: ${darken('0.2', 'rgba(255,205,100,0.7)')}; | ||
* ` | ||
@@ -57,3 +57,3 @@ * | ||
return (0, _toColorString2.default)(_extends({}, hslColor, { | ||
lightness: (0, _guard2.default)(0, 1, hslColor.lightness - amount) | ||
lightness: (0, _guard2.default)(0, 1, hslColor.lightness - parseFloat(amount)) | ||
})); | ||
@@ -60,0 +60,0 @@ } |
declare function curriedDesaturateWith1(color: string): string; | ||
declare function curriedDesaturate( | ||
amount: number, | ||
amount: number | string, | ||
): typeof curriedDesaturateWith1; | ||
declare function curriedDesaturate(amount: number, color: string): string; | ||
declare function curriedDesaturate( | ||
amount: number | string, | ||
color: string, | ||
): string; | ||
export default curriedDesaturate; |
@@ -9,2 +9,10 @@ 'use strict'; | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
var _guard = /*#__PURE__*/require('../internalHelpers/_guard'); | ||
var _guard2 = /*#__PURE__*/_interopRequireDefault(_guard); | ||
var _parseToHsl = /*#__PURE__*/require('./parseToHsl'); | ||
@@ -18,10 +26,2 @@ | ||
var _guard = /*#__PURE__*/require('../internalHelpers/_guard'); | ||
var _guard2 = /*#__PURE__*/_interopRequireDefault(_guard); | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -38,3 +38,3 @@ | ||
* background: desaturate(0.2, '#CCCD64'), | ||
* background: desaturate(0.2, 'rgba(204,205,100,0.7)'), | ||
* background: desaturate('0.2', 'rgba(204,205,100,0.7)'), | ||
* } | ||
@@ -45,3 +45,3 @@ * | ||
* background: ${desaturate(0.2, '#CCCD64')}; | ||
* background: ${desaturate(0.2, 'rgba(204,205,100,0.7)')}; | ||
* background: ${desaturate('0.2', 'rgba(204,205,100,0.7)')}; | ||
* ` | ||
@@ -58,3 +58,3 @@ * | ||
return (0, _toColorString2.default)(_extends({}, hslColor, { | ||
saturation: (0, _guard2.default)(0, 1, hslColor.saturation - amount) | ||
saturation: (0, _guard2.default)(0, 1, hslColor.saturation - parseFloat(amount)) | ||
})); | ||
@@ -61,0 +61,0 @@ } |
@@ -45,4 +45,3 @@ 'use strict'; | ||
} | ||
exports.default = hsl; | ||
module.exports = exports['default']; |
declare function curriedLightenWith1(color: string): string; | ||
declare function curriedLighten(amount: number): typeof curriedLightenWith1; | ||
declare function curriedLighten(amount: number, color: string): string; | ||
declare function curriedLighten( | ||
amount: number | string, | ||
): typeof curriedLightenWith1; | ||
declare function curriedLighten(amount: number | string, color: string): string; | ||
export default curriedLighten; |
@@ -9,2 +9,10 @@ 'use strict'; | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
var _guard = /*#__PURE__*/require('../internalHelpers/_guard'); | ||
var _guard2 = /*#__PURE__*/_interopRequireDefault(_guard); | ||
var _parseToHsl = /*#__PURE__*/require('./parseToHsl'); | ||
@@ -18,10 +26,2 @@ | ||
var _guard = /*#__PURE__*/require('../internalHelpers/_guard'); | ||
var _guard2 = /*#__PURE__*/_interopRequireDefault(_guard); | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -36,3 +36,3 @@ | ||
* background: lighten(0.2, '#CCCD64'), | ||
* background: lighten(0.2, 'rgba(204,205,100,0.7)'), | ||
* background: lighten('0.2', 'rgba(204,205,100,0.7)'), | ||
* } | ||
@@ -43,3 +43,3 @@ * | ||
* background: ${lighten(0.2, '#FFCD64')}; | ||
* background: ${lighten(0.2, 'rgba(204,205,100,0.7)')}; | ||
* background: ${lighten('0.2', 'rgba(204,205,100,0.7)')}; | ||
* ` | ||
@@ -57,3 +57,3 @@ * | ||
return (0, _toColorString2.default)(_extends({}, hslColor, { | ||
lightness: (0, _guard2.default)(0, 1, hslColor.lightness + amount) | ||
lightness: (0, _guard2.default)(0, 1, hslColor.lightness + parseFloat(amount)) | ||
})); | ||
@@ -60,0 +60,0 @@ } |
declare function curriedMixWith2(otherColor: string): string; | ||
declare function curriedMixWith1(color: string): typeof curriedMixWith2; | ||
declare function curriedMixWith1(color: string, otherColor: string): string; | ||
declare function curriedMix(weight?: number): typeof curriedMixWith1; | ||
declare function curriedMix(weight: number | string): typeof curriedMixWith1; | ||
declare function curriedMix( | ||
weight: number, | ||
weight: number | string, | ||
color: string, | ||
): typeof curriedMixWith2; | ||
declare function curriedMix( | ||
weight: number, | ||
weight: number | string, | ||
color: string, | ||
@@ -12,0 +12,0 @@ otherColor: string, |
@@ -9,2 +9,6 @@ 'use strict'; | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
var _rgba = /*#__PURE__*/require('./rgba'); | ||
@@ -18,16 +22,7 @@ | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
* Mixes two colors together by calculating the average of each of the RGB components. | ||
* Mixes the two provided colors together by calculating the average of each of the RGB components weighted to the first color by the provided weight. | ||
* | ||
* By default the weight is 0.5 meaning that half of the first color and half the second | ||
* color should be used. Optionally the weight can be modified by providing a number | ||
* as the first argument. 0.25 means that a quarter of the first color and three quarters | ||
* of the second color should be used. | ||
* | ||
* @example | ||
@@ -38,3 +33,3 @@ * // Styles as object usage | ||
* background: mix(0.25, '#f00', '#00f') | ||
* background: mix(0.5, 'rgba(255, 0, 0, 0.5)', '#00f') | ||
* background: mix('0.5', 'rgba(255, 0, 0, 0.5)', '#00f') | ||
* } | ||
@@ -46,3 +41,3 @@ * | ||
* background: ${mix(0.25, '#f00', '#00f')}; | ||
* background: ${mix(0.5, 'rgba(255, 0, 0, 0.5)', '#00f')}; | ||
* background: ${mix('0.5', 'rgba(255, 0, 0, 0.5)', '#00f')}; | ||
* ` | ||
@@ -58,7 +53,3 @@ * | ||
*/ | ||
function mix() { | ||
var weight = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.5; | ||
var color = arguments[1]; | ||
var otherColor = arguments[2]; | ||
function mix(weight, color, otherColor) { | ||
var parsedColor1 = (0, _parseToRgb2.default)(color); | ||
@@ -76,3 +67,3 @@ var color1 = _extends({}, parsedColor1, { | ||
});var alphaDelta = color1.alpha - color2.alpha; | ||
var x = weight * 2 - 1; | ||
var x = parseFloat(weight) * 2 - 1; | ||
var y = x * alphaDelta === -1 ? x : x + alphaDelta; | ||
@@ -87,3 +78,3 @@ var z = 1 + x * alphaDelta; | ||
blue: Math.floor(color1.blue * weight1 + color2.blue * weight2), | ||
alpha: color1.alpha + (color2.alpha - color1.alpha) * (weight / 1.0) | ||
alpha: color1.alpha + (color2.alpha - color1.alpha) * (parseFloat(weight) / 1.0) | ||
}; | ||
@@ -90,0 +81,0 @@ |
declare function curriedOpacifyWith1(color: string): string; | ||
declare function curriedOpacify(amount: number): typeof curriedOpacifyWith1; | ||
declare function curriedOpacify(amount: number, color: string): string; | ||
declare function curriedOpacify( | ||
amount: number | string, | ||
): typeof curriedOpacifyWith1; | ||
declare function curriedOpacify(amount: number | string, color: string): string; | ||
export default curriedOpacify; |
@@ -9,2 +9,10 @@ 'use strict'; | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
var _guard = /*#__PURE__*/require('../internalHelpers/_guard'); | ||
var _guard2 = /*#__PURE__*/_interopRequireDefault(_guard); | ||
var _rgba = /*#__PURE__*/require('./rgba'); | ||
@@ -18,10 +26,2 @@ | ||
var _guard = /*#__PURE__*/require('../internalHelpers/_guard'); | ||
var _guard2 = /*#__PURE__*/_interopRequireDefault(_guard); | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -38,3 +38,3 @@ | ||
* background: opacify(0.2, 'hsla(0, 0%, 100%, 0.5)'), | ||
* background: opacify(0.5, 'rgba(255, 0, 0, 0.2)'), | ||
* background: opacify('0.5', 'rgba(255, 0, 0, 0.2)'), | ||
* } | ||
@@ -46,3 +46,3 @@ * | ||
* background: ${opacify(0.2, 'hsla(0, 0%, 100%, 0.5)')}, | ||
* background: ${opacify(0.5, 'rgba(255, 0, 0, 0.2)')}, | ||
* background: ${opacify('0.5', 'rgba(255, 0, 0, 0.2)')}, | ||
* ` | ||
@@ -62,3 +62,3 @@ * | ||
var colorWithAlpha = _extends({}, parsedColor, { | ||
alpha: (0, _guard2.default)(0, 1, (alpha * 100 + amount * 100) / 100) | ||
alpha: (0, _guard2.default)(0, 1, (alpha * 100 + parseFloat(amount) * 100) / 100) | ||
}); | ||
@@ -65,0 +65,0 @@ return (0, _rgba2.default)(colorWithAlpha); |
@@ -18,2 +18,3 @@ 'use strict'; | ||
var hexRegex = /^#[a-fA-F0-9]{6}$/; | ||
var hexRgbaRegex = /^#[a-fA-F0-9]{8}$/; | ||
var reducedHexRegex = /^#[a-fA-F0-9]{3}$/; | ||
@@ -48,2 +49,11 @@ var rgbRegex = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/; | ||
} | ||
if (normalizedColor.match(hexRgbaRegex)) { | ||
var alpha = parseFloat((parseInt('' + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2)); | ||
return { | ||
red: parseInt('' + normalizedColor[1] + normalizedColor[2], 16), | ||
green: parseInt('' + normalizedColor[3] + normalizedColor[4], 16), | ||
blue: parseInt('' + normalizedColor[5] + normalizedColor[6], 16), | ||
alpha: alpha | ||
}; | ||
} | ||
if (normalizedColor.match(reducedHexRegex)) { | ||
@@ -50,0 +60,0 @@ return { |
@@ -7,2 +7,6 @@ 'use strict'; | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
var _getLuminance = /*#__PURE__*/require('./getLuminance'); | ||
@@ -12,10 +16,6 @@ | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/** | ||
* Selects black or white for best contrast depending on the luminosity of the given color. | ||
* Returns black or white for best contrast depending on the luminosity of the given color. | ||
* Follows W3C specs for readability at https://www.w3.org/TR/WCAG20-TECHS/G18.html | ||
@@ -22,0 +22,0 @@ * |
@@ -7,2 +7,6 @@ 'use strict'; | ||
var _parseToRgb = /*#__PURE__*/require('./parseToRgb'); | ||
var _parseToRgb2 = /*#__PURE__*/_interopRequireDefault(_parseToRgb); | ||
var _rgb = /*#__PURE__*/require('./rgb'); | ||
@@ -12,6 +16,2 @@ | ||
var _parseToRgb = /*#__PURE__*/require('./parseToRgb'); | ||
var _parseToRgb2 = /*#__PURE__*/_interopRequireDefault(_parseToRgb); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -18,0 +18,0 @@ |
declare function curriedSaturateWith1(color: string): string; | ||
declare function curriedSaturate(amount: number): typeof curriedSaturateWith1; | ||
declare function curriedSaturate(amount: number, color: string): string; | ||
declare function curriedSaturate( | ||
amount: number | string, | ||
): typeof curriedSaturateWith1; | ||
declare function curriedSaturate( | ||
amount: number | string, | ||
color: string, | ||
): string; | ||
export default curriedSaturate; |
@@ -9,2 +9,10 @@ 'use strict'; | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
var _guard = /*#__PURE__*/require('../internalHelpers/_guard'); | ||
var _guard2 = /*#__PURE__*/_interopRequireDefault(_guard); | ||
var _parseToHsl = /*#__PURE__*/require('./parseToHsl'); | ||
@@ -18,10 +26,2 @@ | ||
var _guard = /*#__PURE__*/require('../internalHelpers/_guard'); | ||
var _guard2 = /*#__PURE__*/_interopRequireDefault(_guard); | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -38,3 +38,3 @@ | ||
* background: saturate(0.2, '#CCCD64'), | ||
* background: saturate(0.2, 'rgba(204,205,100,0.7)'), | ||
* background: saturate('0.2', 'rgba(204,205,100,0.7)'), | ||
* } | ||
@@ -45,3 +45,3 @@ * | ||
* background: ${saturate(0.2, '#FFCD64')}; | ||
* background: ${saturate(0.2, 'rgba(204,205,100,0.7)')}; | ||
* background: ${saturate('0.2', 'rgba(204,205,100,0.7)')}; | ||
* ` | ||
@@ -59,3 +59,3 @@ * | ||
return (0, _toColorString2.default)(_extends({}, hslColor, { | ||
saturation: (0, _guard2.default)(0, 1, hslColor.saturation + amount) | ||
saturation: (0, _guard2.default)(0, 1, hslColor.saturation + parseFloat(amount)) | ||
})); | ||
@@ -62,0 +62,0 @@ } |
declare function curriedSetHueWith1(color: string): string; | ||
declare function curriedSetHue(hue: number): typeof curriedSetHueWith1; | ||
declare function curriedSetHue(hue: number, color: string): string; | ||
declare function curriedSetHue(hue: number | string): typeof curriedSetHueWith1; | ||
declare function curriedSetHue(hue: number | string, color: string): string; | ||
export default curriedSetHue; |
@@ -9,2 +9,6 @@ 'use strict'; | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
var _parseToHsl = /*#__PURE__*/require('./parseToHsl'); | ||
@@ -18,6 +22,2 @@ | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -33,3 +33,3 @@ | ||
* background: setHue(42, '#CCCD64'), | ||
* background: setHue(244, 'rgba(204,205,100,0.7)'), | ||
* background: setHue('244', 'rgba(204,205,100,0.7)'), | ||
* } | ||
@@ -40,3 +40,3 @@ * | ||
* background: ${setHue(42, '#CCCD64')}; | ||
* background: ${setHue(244, 'rgba(204,205,100,0.7)')}; | ||
* background: ${setHue('244', 'rgba(204,205,100,0.7)')}; | ||
* ` | ||
@@ -52,3 +52,3 @@ * | ||
return (0, _toColorString2.default)(_extends({}, (0, _parseToHsl2.default)(color), { | ||
hue: hue | ||
hue: parseFloat(hue) | ||
})); | ||
@@ -55,0 +55,0 @@ } |
declare function curriedSetLightnessWith1(color: string): string; | ||
declare function curriedSetLightness( | ||
lightness: number, | ||
lightness: number | string, | ||
): typeof curriedSetLightnessWith1; | ||
declare function curriedSetLightness(lightness: number, color: string): string; | ||
declare function curriedSetLightness( | ||
lightness: number | string, | ||
color: string, | ||
): string; | ||
export default curriedSetLightness; |
@@ -9,2 +9,6 @@ 'use strict'; | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
var _parseToHsl = /*#__PURE__*/require('./parseToHsl'); | ||
@@ -18,6 +22,2 @@ | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -33,3 +33,3 @@ | ||
* background: setLightness(0.2, '#CCCD64'), | ||
* background: setLightness(0.75, 'rgba(204,205,100,0.7)'), | ||
* background: setLightness('0.75', 'rgba(204,205,100,0.7)'), | ||
* } | ||
@@ -40,3 +40,3 @@ * | ||
* background: ${setLightness(0.2, '#CCCD64')}; | ||
* background: ${setLightness(0.75, 'rgba(204,205,100,0.7)')}; | ||
* background: ${setLightness('0.75', 'rgba(204,205,100,0.7)')}; | ||
* ` | ||
@@ -52,3 +52,3 @@ * | ||
return (0, _toColorString2.default)(_extends({}, (0, _parseToHsl2.default)(color), { | ||
lightness: lightness | ||
lightness: parseFloat(lightness) | ||
})); | ||
@@ -55,0 +55,0 @@ } |
declare function curriedSetSaturationWith1(color: string): string; | ||
declare function curriedSetSaturation( | ||
saturation: number, | ||
saturation: number | string, | ||
): typeof curriedSetSaturationWith1; | ||
declare function curriedSetSaturation( | ||
saturation: number, | ||
saturation: number | string, | ||
color: string, | ||
@@ -8,0 +8,0 @@ ): string; |
@@ -9,2 +9,6 @@ 'use strict'; | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
var _parseToHsl = /*#__PURE__*/require('./parseToHsl'); | ||
@@ -18,6 +22,2 @@ | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -33,3 +33,3 @@ | ||
* background: setSaturation(0.2, '#CCCD64'), | ||
* background: setSaturation(0.75, 'rgba(204,205,100,0.7)'), | ||
* background: setSaturation('0.75', 'rgba(204,205,100,0.7)'), | ||
* } | ||
@@ -40,3 +40,3 @@ * | ||
* background: ${setSaturation(0.2, '#CCCD64')}; | ||
* background: ${setSaturation(0.75, 'rgba(204,205,100,0.7)')}; | ||
* background: ${setSaturation('0.75', 'rgba(204,205,100,0.7)')}; | ||
* ` | ||
@@ -52,3 +52,3 @@ * | ||
return (0, _toColorString2.default)(_extends({}, (0, _parseToHsl2.default)(color), { | ||
saturation: saturation | ||
saturation: parseFloat(saturation) | ||
})); | ||
@@ -55,0 +55,0 @@ } |
declare function curriedShadeWith1(color: string): string; | ||
declare function curriedShade(percentage: number): typeof curriedShadeWith1; | ||
declare function curriedShade(percentage: number, color: string): string; | ||
declare function curriedShade( | ||
percentage: number | string, | ||
): typeof curriedShadeWith1; | ||
declare function curriedShade( | ||
percentage: number | string, | ||
color: string, | ||
): string; | ||
export default curriedShade; |
@@ -7,2 +7,6 @@ 'use strict'; | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
var _mix = /*#__PURE__*/require('./mix'); | ||
@@ -12,6 +16,2 @@ | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -43,9 +43,3 @@ | ||
function shade(percentage, color) { | ||
if (typeof percentage !== 'number' || percentage > 1 || percentage < -1) { | ||
throw new Error('Passed an incorrect argument to shade, please pass a percentage less than or equal to 1 and larger than or equal to -1.'); | ||
} | ||
if (typeof color !== 'string') { | ||
throw new Error('Passed an incorrect argument to a color function, please pass a string representation of a color.'); | ||
} | ||
return (0, _mix2.default)(percentage, color, 'rgb(0, 0, 0)'); | ||
return (0, _mix2.default)(parseFloat(percentage), color, 'rgb(0, 0, 0)'); | ||
} | ||
@@ -52,0 +46,0 @@ |
declare function curriedTintWith1(color: string): string; | ||
declare function curriedTint(percentage: number): typeof curriedTintWith1; | ||
declare function curriedTint(percentage: number, color: string): string; | ||
declare function curriedTint( | ||
percentage: number | string, | ||
): typeof curriedTintWith1; | ||
declare function curriedTint( | ||
percentage: number | string, | ||
color: string, | ||
): string; | ||
export default curriedTint; |
@@ -7,2 +7,6 @@ 'use strict'; | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
var _mix = /*#__PURE__*/require('./mix'); | ||
@@ -12,6 +16,2 @@ | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -43,9 +43,3 @@ | ||
function tint(percentage, color) { | ||
if (typeof percentage !== 'number' || percentage > 1 || percentage < -1) { | ||
throw new Error('Passed an incorrect argument to tint, please pass a percentage less than or equal to 1 and larger than or equal to -1.'); | ||
} | ||
if (typeof color !== 'string') { | ||
throw new Error('Passed an incorrect argument to a color function, please pass a string representation of a color.'); | ||
} | ||
return (0, _mix2.default)(percentage, color, 'rgb(255, 255, 255)'); | ||
return (0, _mix2.default)(parseFloat(percentage), color, 'rgb(255, 255, 255)'); | ||
} | ||
@@ -52,0 +46,0 @@ |
@@ -7,2 +7,10 @@ 'use strict'; | ||
var _hsl = /*#__PURE__*/require('./hsl'); | ||
var _hsl2 = /*#__PURE__*/_interopRequireDefault(_hsl); | ||
var _hsla = /*#__PURE__*/require('./hsla'); | ||
var _hsla2 = /*#__PURE__*/_interopRequireDefault(_hsla); | ||
var _rgb = /*#__PURE__*/require('./rgb'); | ||
@@ -16,10 +24,2 @@ | ||
var _hsl = /*#__PURE__*/require('./hsl'); | ||
var _hsl2 = /*#__PURE__*/_interopRequireDefault(_hsl); | ||
var _hsla = /*#__PURE__*/require('./hsla'); | ||
var _hsla2 = /*#__PURE__*/_interopRequireDefault(_hsla); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -26,0 +26,0 @@ |
declare function curriedTransparentizeWith1(color: string): string; | ||
declare function curriedTransparentize( | ||
amount: number, | ||
amount: number | string, | ||
): typeof curriedTransparentizeWith1; | ||
declare function curriedTransparentize(amount: number, color: string): string; | ||
declare function curriedTransparentize( | ||
amount: number | string, | ||
color: string, | ||
): string; | ||
export default curriedTransparentize; |
@@ -9,2 +9,10 @@ 'use strict'; | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
var _guard = /*#__PURE__*/require('../internalHelpers/_guard'); | ||
var _guard2 = /*#__PURE__*/_interopRequireDefault(_guard); | ||
var _rgba = /*#__PURE__*/require('./rgba'); | ||
@@ -18,10 +26,2 @@ | ||
var _guard = /*#__PURE__*/require('../internalHelpers/_guard'); | ||
var _guard2 = /*#__PURE__*/_interopRequireDefault(_guard); | ||
var _curry = /*#__PURE__*/require('../internalHelpers/_curry'); | ||
var _curry2 = /*#__PURE__*/_interopRequireDefault(_curry); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -38,3 +38,3 @@ | ||
* background: transparentize(0.2, 'hsl(0, 0%, 100%)'), | ||
* background: transparentize(0.5, 'rgba(255, 0, 0, 0.8)'), | ||
* background: transparentize('0.5', 'rgba(255, 0, 0, 0.8)'), | ||
* } | ||
@@ -46,3 +46,3 @@ * | ||
* background: ${transparentize(0.2, 'hsl(0, 0%, 100%)')}, | ||
* background: ${transparentize(0.5, 'rgba(255, 0, 0, 0.8)')}, | ||
* background: ${transparentize('0.5', 'rgba(255, 0, 0, 0.8)')}, | ||
* ` | ||
@@ -62,3 +62,3 @@ * | ||
var colorWithAlpha = _extends({}, parsedColor, { | ||
alpha: (0, _guard2.default)(0, 1, (alpha * 100 - amount * 100) / 100) | ||
alpha: (0, _guard2.default)(0, 1, (alpha * 100 - parseFloat(amount) * 100) / 100) | ||
}); | ||
@@ -65,0 +65,0 @@ return (0, _rgba2.default)(colorWithAlpha); |
@@ -0,6 +1,8 @@ | ||
import { Styles } from '../types/style'; | ||
declare function directionalProperty( | ||
property: string, | ||
...values: Array<null | void | string | null | void | number> | ||
): Object; | ||
): Styles; | ||
export default directionalProperty; |
@@ -40,3 +40,3 @@ 'use strict'; | ||
/** | ||
* A helper that enables shorthand for direction based properties. It accepts a property (hyphenated or camelCased) and up to four values that map to top, right, bottom, and left, respectively. You can optionally pass an empty string to get only the directional values as properties. You can also optionally pass a null argument for a directional value to ignore it. | ||
* Enables shorthand for direction-based properties. It accepts a property (hyphenated or camelCased) and up to four values that map to top, right, bottom, and left, respectively. You can optionally pass an empty string to get only the directional values as properties. You can also optionally pass a null argument for a directional value to ignore it. | ||
* @example | ||
@@ -62,3 +62,2 @@ * // Styles as object usage | ||
*/ | ||
function directionalProperty(property) { | ||
@@ -65,0 +64,0 @@ for (var _len = arguments.length, values = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { |
@@ -36,5 +36,4 @@ 'use strict'; | ||
*/ | ||
var em = /*#__PURE__*/(0, _pxto2.default)('em'); | ||
exports.default = em; | ||
module.exports = exports['default']; |
@@ -0,1 +1,3 @@ | ||
import { ModularScaleRatio } from '../types/modularScaleRatio'; | ||
declare const ratioNames: { | ||
@@ -20,25 +22,6 @@ minorSecond: 1.067; | ||
}; | ||
export type Ratio = | ||
| number | ||
| 'minorSecond' | ||
| 'majorSecond' | ||
| 'minorThird' | ||
| 'majorThird' | ||
| 'perfectFourth' | ||
| 'augFourth' | ||
| 'perfectFifth' | ||
| 'minorSixth' | ||
| 'goldenSection' | ||
| 'majorSixth' | ||
| 'minorSeventh' | ||
| 'majorSeventh' | ||
| 'octave' | ||
| 'majorTenth' | ||
| 'majorEleventh' | ||
| 'majorTwelfth' | ||
| 'doubleOctave'; | ||
declare function modularScale( | ||
steps: number, | ||
base?: number | string, | ||
ratio?: Ratio, | ||
ratio?: ModularScaleRatio, | ||
): string; | ||
@@ -45,0 +28,0 @@ |
@@ -32,8 +32,11 @@ 'use strict'; | ||
doubleOctave: 4 | ||
/** */ | ||
}; | ||
function getRatio(ratioName) { | ||
return ratioNames[ratioName]; | ||
} | ||
/** | ||
* Establish consistent measurements and spacial relationships throughout your projects by incrementing up or down a defined scale. We provide a list of commonly used scales as pre-defined variables, see below. | ||
* Establish consistent measurements and spacial relationships throughout your projects by incrementing up or down a defined scale. We provide a list of commonly used scales as pre-defined variables. | ||
* @example | ||
@@ -70,3 +73,3 @@ * // Styles as object usage | ||
var realBase = typeof base === 'string' ? (0, _stripUnit2.default)(base) : base; | ||
var realRatio = typeof ratio === 'string' ? ratioNames[ratio] : ratio; | ||
var realRatio = typeof ratio === 'string' ? getRatio(ratio) : ratio; | ||
@@ -73,0 +76,0 @@ if (typeof realBase === 'string') { |
@@ -36,6 +36,4 @@ 'use strict'; | ||
*/ | ||
var rem = /*#__PURE__*/(0, _pxto2.default)('rem'); | ||
exports.default = rem; | ||
module.exports = exports['default']; |
@@ -9,3 +9,3 @@ "use strict"; | ||
/** | ||
* Strip the unit from a given CSS value, returning just the number. (or the original value if an invalid string was passed) | ||
* Returns a given CSS value minus its unit (or the original value if an invalid string is passed). | ||
* | ||
@@ -29,3 +29,2 @@ * @example | ||
*/ | ||
function stripUnit(value) { | ||
@@ -32,0 +31,0 @@ var unitlessValue = parseFloat(value); |
@@ -5,2 +5,4 @@ import adjustHue from './color/adjustHue'; | ||
import backgrounds from './shorthands/backgrounds'; | ||
import between from './mixins/between'; | ||
import border from './shorthands/border'; | ||
import borderColor from './shorthands/borderColor'; | ||
@@ -13,2 +15,3 @@ import borderRadius from './shorthands/borderRadius'; | ||
import complement from './color/complement'; | ||
import cover from './mixins/cover'; | ||
import darken from './color/darken'; | ||
@@ -19,4 +22,6 @@ import desaturate from './color/desaturate'; | ||
import em from './helpers/em'; | ||
import fluidRange from './mixins/fluidRange'; | ||
import fontFace from './mixins/fontFace'; | ||
import getLuminance from './color/getLuminance'; | ||
import getValueAndUnit from './helpers/getValueAndUnit'; | ||
import grayscale from './color/grayscale'; | ||
@@ -67,2 +72,4 @@ import invert from './color/invert'; | ||
export { backgrounds }; | ||
export { between }; | ||
export { border }; | ||
export { borderColor }; | ||
@@ -75,2 +82,3 @@ export { borderRadius }; | ||
export { complement }; | ||
export { cover }; | ||
export { darken }; | ||
@@ -81,4 +89,6 @@ export { desaturate }; | ||
export { em }; | ||
export { fluidRange }; | ||
export { fontFace }; | ||
export { getLuminance }; | ||
export { getValueAndUnit }; | ||
export { grayscale }; | ||
@@ -85,0 +95,0 @@ export { invert }; |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.wordWrap = exports.triangle = exports.transparentize = exports.transitions = exports.toColorString = exports.tint = exports.timingFunctions = exports.textInputs = exports.stripUnit = exports.size = exports.shade = exports.setSaturation = exports.setLightness = exports.setHue = exports.selection = exports.saturate = exports.rgba = exports.rgb = exports.retinaImage = exports.rem = exports.readableColor = exports.radialGradient = exports.position = exports.placeholder = exports.parseToRgb = exports.parseToHsl = exports.padding = exports.opacify = exports.normalize = exports.modularScale = exports.mix = exports.margin = exports.lighten = exports.hsla = exports.hsl = exports.hiDPI = exports.hideVisually = exports.hideText = exports.invert = exports.grayscale = exports.getLuminance = exports.fontFace = exports.em = exports.ellipsis = exports.directionalProperty = exports.desaturate = exports.darken = exports.complement = exports.clearFix = exports.buttons = exports.borderWidth = exports.borderStyle = exports.borderRadius = exports.borderColor = exports.backgrounds = exports.backgroundImages = exports.animation = exports.adjustHue = undefined; | ||
exports.wordWrap = exports.triangle = exports.transparentize = exports.transitions = exports.toColorString = exports.tint = exports.timingFunctions = exports.textInputs = exports.stripUnit = exports.size = exports.shade = exports.setSaturation = exports.setLightness = exports.setHue = exports.selection = exports.saturate = exports.rgba = exports.rgb = exports.retinaImage = exports.rem = exports.readableColor = exports.radialGradient = exports.position = exports.placeholder = exports.parseToRgb = exports.parseToHsl = exports.padding = exports.opacify = exports.normalize = exports.modularScale = exports.mix = exports.margin = exports.lighten = exports.hsla = exports.hsl = exports.hiDPI = exports.hideVisually = exports.hideText = exports.invert = exports.grayscale = exports.getValueAndUnit = exports.getLuminance = exports.fontFace = exports.fluidRange = exports.em = exports.ellipsis = exports.directionalProperty = exports.desaturate = exports.darken = exports.cover = exports.complement = exports.clearFix = exports.buttons = exports.borderWidth = exports.borderStyle = exports.borderRadius = exports.borderColor = exports.border = exports.between = exports.backgrounds = exports.backgroundImages = exports.animation = exports.adjustHue = undefined; | ||
@@ -17,2 +17,6 @@ var _directionalProperty = /*#__PURE__*/require('./helpers/directionalProperty'); | ||
var _getValueAndUnit = /*#__PURE__*/require('./helpers/getValueAndUnit'); | ||
var _getValueAndUnit2 = /*#__PURE__*/_interopRequireDefault(_getValueAndUnit); | ||
var _modularScale = /*#__PURE__*/require('./helpers/modularScale'); | ||
@@ -30,2 +34,6 @@ | ||
var _between = /*#__PURE__*/require('./mixins/between'); | ||
var _between2 = /*#__PURE__*/_interopRequireDefault(_between); | ||
var _clearFix = /*#__PURE__*/require('./mixins/clearFix'); | ||
@@ -35,2 +43,6 @@ | ||
var _cover = /*#__PURE__*/require('./mixins/cover'); | ||
var _cover2 = /*#__PURE__*/_interopRequireDefault(_cover); | ||
var _ellipsis = /*#__PURE__*/require('./mixins/ellipsis'); | ||
@@ -40,2 +52,6 @@ | ||
var _fluidRange = /*#__PURE__*/require('./mixins/fluidRange'); | ||
var _fluidRange2 = /*#__PURE__*/_interopRequireDefault(_fluidRange); | ||
var _fontFace = /*#__PURE__*/require('./mixins/fontFace'); | ||
@@ -201,2 +217,6 @@ | ||
var _border = /*#__PURE__*/require('./shorthands/border'); | ||
var _border2 = /*#__PURE__*/_interopRequireDefault(_border); | ||
var _borderColor = /*#__PURE__*/require('./shorthands/borderColor'); | ||
@@ -248,5 +268,3 @@ | ||
// Shorthands | ||
// Helpers | ||
// Color | ||
exports.adjustHue = _adjustHue2.default; | ||
@@ -256,2 +274,4 @@ exports.animation = _animation2.default; | ||
exports.backgrounds = _backgrounds2.default; | ||
exports.between = _between2.default; | ||
exports.border = _border2.default; | ||
exports.borderColor = _borderColor2.default; | ||
@@ -264,2 +284,3 @@ exports.borderRadius = _borderRadius2.default; | ||
exports.complement = _complement2.default; | ||
exports.cover = _cover2.default; | ||
exports.darken = _darken2.default; | ||
@@ -270,4 +291,6 @@ exports.desaturate = _desaturate2.default; | ||
exports.em = _em2.default; | ||
exports.fluidRange = _fluidRange2.default; | ||
exports.fontFace = _fontFace2.default; | ||
exports.getLuminance = _getLuminance2.default; | ||
exports.getValueAndUnit = _getValueAndUnit2.default; | ||
exports.grayscale = _grayscale2.default; | ||
@@ -314,5 +337,7 @@ exports.invert = _invert2.default; | ||
// Color | ||
// Shorthands | ||
// Mixins | ||
// Mixins | ||
// Helpers |
@@ -7,3 +7,3 @@ 'use strict'; | ||
var _endsWith = /*#__PURE__*/require('../internalHelpers/_endsWith'); | ||
var _endsWith = /*#__PURE__*/require('./_endsWith'); | ||
@@ -10,0 +10,0 @@ var _endsWith2 = /*#__PURE__*/_interopRequireDefault(_endsWith); |
@@ -1,3 +0,5 @@ | ||
declare function clearFix(parent?: string): Object; | ||
import { Styles } from '../types/style'; | ||
declare function clearFix(parent?: string): Styles; | ||
export default clearFix; |
@@ -30,3 +30,2 @@ 'use strict'; | ||
*/ | ||
function clearFix() { | ||
@@ -44,4 +43,3 @@ var _ref; | ||
} | ||
exports.default = clearFix; | ||
module.exports = exports['default']; |
@@ -1,3 +0,5 @@ | ||
declare function ellipsis(width?: string | number): Object; | ||
import { Styles } from '../types/style'; | ||
declare function ellipsis(width?: string | number): Array<Styles>; | ||
export default ellipsis; |
@@ -26,2 +26,3 @@ 'use strict'; | ||
* 'display': 'inline-block', | ||
* 'display': 'inline-flex', | ||
* 'maxWidth': '250px', | ||
@@ -34,7 +35,6 @@ * 'overflow': 'hidden', | ||
*/ | ||
function ellipsis() { | ||
var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '100%'; | ||
return { | ||
return [{ | ||
display: 'inline-block', | ||
@@ -46,6 +46,7 @@ maxWidth: width, | ||
wordWrap: 'normal' | ||
}; | ||
}, { | ||
display: 'inline-flex' | ||
}]; | ||
} | ||
exports.default = ellipsis; | ||
module.exports = exports['default']; |
@@ -1,13 +0,4 @@ | ||
declare interface FontFaceConfiguration { | ||
fontFamily: string; | ||
fontFilePath: string; | ||
fontStretch: string; | ||
fontStyle: string; | ||
fontVariant: string; | ||
fontWeight: string; | ||
fileFormats: Array<string>; | ||
localFonts: Array<string>; | ||
unicodeRange: string; | ||
} | ||
export { FontFaceConfiguration }; | ||
import { FontFaceConfiguration } from '../types/fontFaceConfiguration'; | ||
import { Styles } from '../types/style'; | ||
declare function fontFace({ | ||
@@ -23,4 +14,7 @@ fontFamily, | ||
unicodeRange, | ||
}: FontFaceConfiguration): Object; | ||
fontDisplay, | ||
fontVariationSettings, | ||
fontFeatureSettings, | ||
}: FontFaceConfiguration): Styles; | ||
export default fontFace; |
@@ -6,4 +6,2 @@ 'use strict'; | ||
}); | ||
function generateFileReferences(fontFilePath, fileFormats) { | ||
@@ -16,5 +14,2 @@ var fileFontReferences = fileFormats.map(function (format) { | ||
/** */ | ||
function generateLocalReferences(localFonts) { | ||
@@ -63,3 +58,2 @@ var localFontReferences = localFonts.map(function (font) { | ||
*/ | ||
function fontFace(_ref) { | ||
@@ -75,3 +69,6 @@ var fontFamily = _ref.fontFamily, | ||
localFonts = _ref.localFonts, | ||
unicodeRange = _ref.unicodeRange; | ||
unicodeRange = _ref.unicodeRange, | ||
fontDisplay = _ref.fontDisplay, | ||
fontVariationSettings = _ref.fontVariationSettings, | ||
fontFeatureSettings = _ref.fontFeatureSettings; | ||
@@ -98,3 +95,6 @@ // Error Handling | ||
fontVariant: fontVariant, | ||
fontWeight: fontWeight | ||
fontWeight: fontWeight, | ||
fontDisplay: fontDisplay, | ||
fontVariationSettings: fontVariationSettings, | ||
fontFeatureSettings: fontFeatureSettings | ||
} | ||
@@ -101,0 +101,0 @@ |
@@ -1,3 +0,5 @@ | ||
declare function hideText(): Object; | ||
import { Styles } from '../types/style'; | ||
declare function hideText(): Styles; | ||
export default hideText; |
@@ -41,4 +41,3 @@ 'use strict'; | ||
} | ||
exports.default = hideText; | ||
module.exports = exports['default']; |
@@ -1,3 +0,5 @@ | ||
declare function hideVisually(): Object; | ||
import { Styles } from '../types/style'; | ||
declare function hideVisually(): Styles; | ||
export default hideVisually; |
@@ -38,3 +38,2 @@ 'use strict'; | ||
*/ | ||
function hideVisually() { | ||
@@ -54,4 +53,3 @@ return { | ||
} | ||
exports.default = hideVisually; | ||
module.exports = exports['default']; |
@@ -1,3 +0,5 @@ | ||
declare function normalize(excludeOpinionated?: boolean): Object; | ||
import { Styles } from '../types/style'; | ||
declare function normalize(excludeOpinionated?: boolean): Styles; | ||
export default normalize; |
@@ -7,149 +7,6 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _messageHandler = /*#__PURE__*/require('../internalHelpers/_messageHandler'); | ||
var _opinionatedRules, _abbrTitle, _unopinionatedRules; | ||
var opinionatedRules = (_opinionatedRules = { | ||
html: { | ||
fontFamily: 'sans-serif' | ||
}, | ||
body: { | ||
margin: '0' | ||
} | ||
}, _opinionatedRules['a:active,\n a:hover'] = { | ||
outlineWidth: '0' | ||
}, _opinionatedRules['button,\n input,\n optgroup,\n select,\n textarea'] = { | ||
fontFamily: 'sans-serif', | ||
fontSize: '100%', | ||
lineHeight: '1.15' | ||
}, _opinionatedRules); | ||
var unopinionatedRules = (_unopinionatedRules = { | ||
html: { | ||
lineHeight: '1.15', | ||
textSizeAdjust: '100%' | ||
} | ||
}, _unopinionatedRules['article,\n aside,\n footer,\n header,\n nav,\n section'] = { | ||
display: 'block' | ||
}, _unopinionatedRules.h1 = { | ||
fontSize: '2em', | ||
margin: '0.67em 0' | ||
}, _unopinionatedRules['figcaption,\n figure,\n main'] = { | ||
display: 'block' | ||
}, _unopinionatedRules.figure = { | ||
margin: '1em 40px' | ||
}, _unopinionatedRules.hr = { | ||
boxSizing: 'content-box', | ||
height: '0', | ||
overflow: 'visible' | ||
}, _unopinionatedRules.pre = { | ||
fontFamily: 'monospace, monospace', | ||
fontSize: '1em' | ||
}, _unopinionatedRules.a = { | ||
'background-color': 'transparent', | ||
'-webkit-text-decoration-skip': 'objects' | ||
}, _unopinionatedRules['abbr[title]'] = (_abbrTitle = { | ||
borderBottom: 'none', | ||
textDecoration: 'underline' | ||
}, _abbrTitle['textDecoration'] = 'underline dotted', _abbrTitle), _unopinionatedRules['b,\n strong'] = { | ||
fontWeight: 'inherit' | ||
}, _unopinionatedRules['code,\n kbd,\n samp'] = { | ||
fontFamily: 'monospace, monospace', | ||
fontSize: '1em' | ||
}, _unopinionatedRules.dfn = { | ||
fontStyle: 'italic' | ||
}, _unopinionatedRules.mark = { | ||
backgroundColor: '#ff0', | ||
color: '#000' | ||
}, _unopinionatedRules.small = { | ||
fontSize: '80%' | ||
}, _unopinionatedRules['sub,\n sup'] = { | ||
fontSize: '75%', | ||
lineHeight: '0', | ||
position: 'relative', | ||
verticalAlign: 'baseline' | ||
}, _unopinionatedRules.sub = { | ||
bottom: '-0.25em' | ||
}, _unopinionatedRules.sup = { | ||
top: '-0.5em' | ||
}, _unopinionatedRules['audio,\n video'] = { | ||
display: 'inline-block' | ||
}, _unopinionatedRules['audio:not([controls])'] = { | ||
display: 'none', | ||
height: '0' | ||
}, _unopinionatedRules.img = { | ||
borderStyle: 'none' | ||
}, _unopinionatedRules['svg:not(:root)'] = { | ||
overflow: 'hidden' | ||
}, _unopinionatedRules['button,\n input,\n optgroup,\n select,\n textarea'] = { | ||
margin: '0' | ||
}, _unopinionatedRules['button,\n input'] = { | ||
overflow: 'visible' | ||
}, _unopinionatedRules['button,\n select'] = { | ||
textTransform: 'none' | ||
}, _unopinionatedRules['button,\n html [type="button"],\n [type="reset"],\n [type="submit"]'] = { | ||
'-webkit-appearance': 'button' | ||
}, _unopinionatedRules['button::-moz-focus-inner,\n [type="button"]::-moz-focus-inner,\n [type="reset"]::-moz-focus-inner,\n [type="submit"]::-moz-focus-inner'] = { | ||
borderStyle: 'none', | ||
padding: '0' | ||
}, _unopinionatedRules['button:-moz-focusring,\n [type="button"]:-moz-focusring,\n [type="reset"]:-moz-focusring,\n [type="submit"]:-moz-focusring'] = { | ||
outline: '1px dotted ButtonText' | ||
}, _unopinionatedRules.fieldset = { | ||
border: '1px solid #c0c0c0', | ||
margin: '0 2px', | ||
padding: '0.35em 0.625em 0.75em' | ||
}, _unopinionatedRules.legend = { | ||
boxSizing: 'border-box', | ||
color: 'inherit', | ||
display: 'table', | ||
maxWidth: '100%', | ||
padding: '0', | ||
whiteSpace: 'normal' | ||
}, _unopinionatedRules.progress = { | ||
display: 'inline-block', | ||
verticalAlign: 'baseline' | ||
}, _unopinionatedRules.textarea = { | ||
overflow: 'auto' | ||
}, _unopinionatedRules['[type="checkbox"],\n [type="radio"]'] = { | ||
boxSizing: 'border-box', | ||
padding: '0' | ||
}, _unopinionatedRules['[type="number"]::-webkit-inner-spin-button,\n [type="number"]::-webkit-outer-spin-button'] = { | ||
height: 'auto' | ||
}, _unopinionatedRules['[type="search"]'] = { | ||
'-webkit-appearance': 'textfield', | ||
outlineOffset: '-2px' | ||
}, _unopinionatedRules['[type="search"]::-webkit-search-cancel-button,\n [type="search"]::-webkit-search-decoration'] = { | ||
'-webkit-appearance': 'none' | ||
}, _unopinionatedRules['::-webkit-file-upload-button'] = { | ||
'-webkit-appearance': 'button', | ||
font: 'inherit' | ||
}, _unopinionatedRules['details,\n menu'] = { | ||
display: 'block' | ||
}, _unopinionatedRules.summary = { | ||
display: 'list-item' | ||
}, _unopinionatedRules.canvas = { | ||
display: 'inline-block' | ||
}, _unopinionatedRules.template = { | ||
display: 'none' | ||
}, _unopinionatedRules['[hidden]'] = { | ||
display: 'none' | ||
}, _unopinionatedRules); | ||
function mergeRules(baseRules, additionalRules) { | ||
var mergedRules = _extends({}, baseRules); | ||
Object.keys(additionalRules).forEach(function (key) { | ||
if (mergedRules[key]) { | ||
mergedRules[key] = _extends({}, mergedRules[key], additionalRules[key]); | ||
} else { | ||
mergedRules[key] = _extends({}, additionalRules[key]); | ||
} | ||
}); | ||
return mergedRules; | ||
} | ||
/** | ||
* CSS to normalize abnormalities across browsers (normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css) | ||
* CSS to normalize abnormalities across browsers (normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css) | ||
* | ||
@@ -168,3 +25,2 @@ * @example | ||
* html { | ||
* fontFamily: 'sans-serif', | ||
* lineHeight: 1.15, | ||
@@ -175,7 +31,117 @@ * textSizeAdjust: 100%, | ||
function normalize(excludeOpinionated) { | ||
if (excludeOpinionated) return unopinionatedRules; | ||
return mergeRules(unopinionatedRules, opinionatedRules); | ||
var _ref; | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (excludeOpinionated) { | ||
(0, _messageHandler.warning)('The excludeOpinionated option for normalize has been removed in polished 2.0. opinionatedRules were removed from normalize.css in 6.0 and no longer need to be explicitly excluded from normalize.'); | ||
} | ||
} | ||
return _ref = { | ||
html: { | ||
lineHeight: '1.15', | ||
textSizeAdjust: '100%' | ||
}, | ||
body: { | ||
margin: '0' | ||
}, | ||
h1: { | ||
fontSize: '2em', | ||
margin: '0.67em 0' | ||
}, | ||
hr: { | ||
boxSizing: 'content-box', | ||
height: '0', | ||
overflow: 'visible' | ||
}, | ||
pre: { | ||
fontFamily: 'monospace, monospace', | ||
fontSize: '1em' | ||
}, | ||
a: { | ||
'background-color': 'transparent' | ||
}, | ||
'abbr[title]': [{ | ||
borderBottom: 'none', | ||
textDecoration: 'underline' | ||
}, { | ||
textDecoration: 'underline dotted' | ||
}] | ||
}, _ref['b,\n strong'] = { | ||
fontWeight: 'bolder' | ||
}, _ref['code,\n kbd,\n samp'] = { | ||
fontFamily: 'monospace, monospace', | ||
fontSize: '1em' | ||
}, _ref.small = { | ||
fontSize: '80%' | ||
}, _ref['sub,\n sup'] = { | ||
fontSize: '75%', | ||
lineHeight: '0', | ||
position: 'relative', | ||
verticalAlign: 'baseline' | ||
}, _ref.sub = { | ||
bottom: '-0.25em' | ||
}, _ref.sup = { | ||
top: '-0.5em' | ||
}, _ref.img = { | ||
borderStyle: 'none' | ||
}, _ref['button,\n input,\n optgroup,\n select,\n textarea'] = { | ||
fontFamily: 'inherit', | ||
fontSize: '100%', | ||
lineHeight: '1.15', | ||
margin: '0' | ||
}, _ref['button,\n input'] = { | ||
overflow: 'visible' | ||
}, _ref['button,\n select'] = { | ||
textTransform: 'none' | ||
}, _ref['button,\n html [type="button"],\n [type="reset"],\n [type="submit"]'] = { | ||
WebkitAppearance: 'button' | ||
}, _ref['button::-moz-focus-inner,\n [type="button"]::-moz-focus-inner,\n [type="reset"]::-moz-focus-inner,\n [type="submit"]::-moz-focus-inner'] = { | ||
borderStyle: 'none', | ||
padding: '0' | ||
}, _ref['button:-moz-focusring,\n [type="button"]:-moz-focusring,\n [type="reset"]:-moz-focusring,\n [type="submit"]:-moz-focusring'] = { | ||
outline: '1px dotted ButtonText' | ||
}, _ref.fieldset = { | ||
padding: '0.35em 0.625em 0.75em' | ||
}, _ref.legend = { | ||
boxSizing: 'border-box', | ||
color: 'inherit', | ||
display: 'table', | ||
maxWidth: '100%', | ||
padding: '0', | ||
whiteSpace: 'normal' | ||
}, _ref.progress = { | ||
verticalAlign: 'baseline' | ||
}, _ref.textarea = { | ||
overflow: 'auto' | ||
}, _ref['[type="checkbox"],\n [type="radio"]'] = { | ||
boxSizing: 'border-box', | ||
padding: '0' | ||
}, _ref['[type="number"]::-webkit-inner-spin-button,\n [type="number"]::-webkit-outer-spin-button'] = { | ||
height: 'auto' | ||
}, _ref['[type="search"]'] = { | ||
WebkitAppearance: 'textfield', | ||
outlineOffset: '-2px' | ||
}, _ref['[type="search"]::-webkit-search-decoration'] = { | ||
WebkitAppearance: 'none' | ||
}, _ref['::-webkit-file-upload-button'] = { | ||
WebkitAppearance: 'button', | ||
font: 'inherit' | ||
}, _ref.details = { | ||
display: 'block' | ||
}, _ref.summary = { | ||
display: 'list-item' | ||
}, _ref.template = { | ||
display: 'none' | ||
}, _ref['[hidden]'] = { | ||
display: 'none' | ||
}, _ref; | ||
} | ||
exports.default = normalize; | ||
module.exports = exports['default']; |
@@ -1,3 +0,5 @@ | ||
declare function placeholder(styles: Object, parent?: string): Object; | ||
import { Styles } from '../types/style'; | ||
declare function placeholder(styles: Styles, parent?: string): Styles; | ||
export default placeholder; |
@@ -9,2 +9,4 @@ 'use strict'; | ||
var _messageHandler = /*#__PURE__*/require('../internalHelpers/_messageHandler'); | ||
/** | ||
@@ -41,3 +43,2 @@ * CSS to style the placeholder pseudo-element. | ||
*/ | ||
function placeholder(styles) { | ||
@@ -48,2 +49,6 @@ var _ref; | ||
/* istanbul ignore next */ | ||
if (process.env.NODE_ENV !== 'production') { | ||
(0, _messageHandler.warning)('placeholder has been marked for deprecation in polished 2.0 and will be fully deprecated in 3.0. It is no longer needed and can safely be replaced with the non-prefixed placeholder pseudo-element.'); | ||
} | ||
return _ref = {}, _ref[parent + '::-webkit-input-placeholder'] = _extends({}, styles), _ref[parent + ':-moz-placeholder'] = _extends({}, styles), _ref[parent + '::-moz-placeholder'] = _extends({}, styles), _ref[parent + ':-ms-input-placeholder'] = _extends({}, styles), _ref; | ||
@@ -50,0 +55,0 @@ } |
@@ -1,9 +0,4 @@ | ||
declare interface RadialGradientConfiguration { | ||
colorStops: Array<string>; | ||
extent: string; | ||
fallback: string; | ||
position: string; | ||
shape: string; | ||
} | ||
export { RadialGradientConfiguration }; | ||
import { RadialGradientConfiguration } from '../types/radialGradientConfiguration'; | ||
import { Styles } from '../types/style'; | ||
declare function radialGradient({ | ||
@@ -15,4 +10,4 @@ colorStops, | ||
shape, | ||
}: RadialGradientConfiguration): Object; | ||
}: RadialGradientConfiguration): Styles; | ||
export default radialGradient; |
@@ -15,5 +15,2 @@ 'use strict'; | ||
/** */ | ||
function constructGradientValue(literals) { | ||
@@ -69,3 +66,2 @@ var template = ''; | ||
*/ | ||
function radialGradient(_ref) { | ||
@@ -72,0 +68,0 @@ var colorStops = _ref.colorStops, |
@@ -0,1 +1,3 @@ | ||
import { Styles } from '../types/style'; | ||
declare function retinaImage( | ||
@@ -7,4 +9,4 @@ filename: string, | ||
retinaSuffix?: string, | ||
): Object; | ||
): Styles; | ||
export default retinaImage; |
@@ -63,4 +63,3 @@ 'use strict'; | ||
} | ||
exports.default = retinaImage; | ||
module.exports = exports['default']; |
@@ -1,3 +0,5 @@ | ||
declare function selection(styles: Object, parent?: string): Object; | ||
import { Styles } from '../types/style'; | ||
declare function selection(styles: Styles, parent?: string): Styles; | ||
export default selection; |
@@ -9,2 +9,4 @@ 'use strict'; | ||
var _messageHandler = /*#__PURE__*/require('../internalHelpers/_messageHandler'); | ||
/** | ||
@@ -37,3 +39,2 @@ * CSS to style the selection pseudo-element. | ||
*/ | ||
function selection(styles) { | ||
@@ -44,2 +45,5 @@ var _ref; | ||
if (process.env.NODE_ENV !== 'production') { | ||
(0, _messageHandler.warning)('selection has been marked for deprecation in polished 2.0 and will be fully deprecated in 3.0. It is no longer needed and can safely be replaced with the non-prefixed selection pseudo-element.'); | ||
} | ||
return _ref = {}, _ref[parent + '::-moz-selection'] = _extends({}, styles), _ref[parent + '::selection'] = _extends({}, styles), _ref; | ||
@@ -46,0 +50,0 @@ } |
@@ -1,28 +0,5 @@ | ||
export type TimingFunction = | ||
| 'easeInBack' | ||
| 'easeInCirc' | ||
| 'easeInCubic' | ||
| 'easeInExpo' | ||
| 'easeInQuad' | ||
| 'easeInQuart' | ||
| 'easeInQuint' | ||
| 'easeInSine' | ||
| 'easeOutBack' | ||
| 'easeOutCubic' | ||
| 'easeOutCirc' | ||
| 'easeOutExpo' | ||
| 'easeOutQuad' | ||
| 'easeOutQuart' | ||
| 'easeOutQuint' | ||
| 'easeOutSine' | ||
| 'easeInOutBack' | ||
| 'easeInOutCirc' | ||
| 'easeInOutCubic' | ||
| 'easeInOutExpo' | ||
| 'easeInOutQuad' | ||
| 'easeInOutQuart' | ||
| 'easeInOutQuint' | ||
| 'easeInOutSine'; | ||
import { TimingFunction } from '../types/timingFunction'; | ||
declare function timingFunctions(timingFunction: TimingFunction): string; | ||
export default timingFunctions; |
@@ -38,4 +38,6 @@ 'use strict'; | ||
/** */ | ||
}; | ||
function getTimingFunction(functionName) { | ||
return functionsMap[functionName]; | ||
} | ||
@@ -64,3 +66,3 @@ /** | ||
function timingFunctions(timingFunction) { | ||
return functionsMap[timingFunction]; | ||
return getTimingFunction(timingFunction); | ||
} | ||
@@ -67,0 +69,0 @@ |
@@ -1,10 +0,4 @@ | ||
export type PointingDirection = 'top' | 'right' | 'bottom' | 'left'; | ||
declare interface TriangleArgs { | ||
backgroundColor: string; | ||
foregroundColor: string; | ||
height: number | string; | ||
width: number | string; | ||
pointingDirection: PointingDirection; | ||
} | ||
export { TriangleArgs }; | ||
import { TriangleConfiguration } from '../types/triangleConfiguration'; | ||
import { Styles } from '../types/style'; | ||
declare function triangle({ | ||
@@ -16,4 +10,4 @@ pointingDirection, | ||
backgroundColor, | ||
}: TriangleArgs): Object; | ||
}: TriangleConfiguration): Styles; | ||
export default triangle; |
@@ -7,14 +7,20 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
/** */ | ||
var _borderColor = /*#__PURE__*/require('../shorthands/borderColor'); | ||
var _borderColor2 = /*#__PURE__*/_interopRequireDefault(_borderColor); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var getBorderWidth = function getBorderWidth(pointingDirection, height, width) { | ||
switch (pointingDirection) { | ||
case 'top': | ||
return '0 ' + width / 2 + 'px ' + height + 'px ' + width / 2 + 'px'; | ||
return '0 ' + width[0] / 2 + width[1] + ' ' + height[0] + height[1] + ' ' + width[0] / 2 + width[1]; | ||
case 'left': | ||
return height / 2 + 'px ' + width + 'px ' + height / 2 + 'px 0'; | ||
return '' + height[0] / 2 + height[1] + ' ' + width[0] + width[1] + ' ' + height[0] / 2 + height[1] + ' 0'; | ||
case 'bottom': | ||
return height + 'px ' + width / 2 + 'px 0 ' + width / 2 + 'px'; | ||
return '' + height[0] + height[1] + ' ' + width[0] / 2 + width[1] + ' 0 ' + width[0] / 2 + width[1]; | ||
case 'right': | ||
return height / 2 + 'px 0 ' + height / 2 + 'px ' + width + 'px'; | ||
return '' + height[0] / 2 + height[1] + ' 0 ' + height[0] / 2 + height[1] + ' ' + width[0] + width[1]; | ||
@@ -27,39 +33,32 @@ default: | ||
// needed for border-color | ||
var reverseDirection = { | ||
left: 'Right', | ||
right: 'Left', | ||
top: 'Bottom', | ||
bottom: 'Top' | ||
var reverseDirection = ['bottom', 'left', 'top', 'right']; | ||
/** | ||
* CSS to represent triangle with any pointing direction with an optional background color. Accepts number or px values for height and width. | ||
* | ||
* @example | ||
* // Styles as object usage | ||
* | ||
* const styles = { | ||
* ...triangle({ pointingDirection: 'right', width: '100px', height: '100px', foregroundColor: 'red' }) | ||
* } | ||
* | ||
* | ||
* // styled-components usage | ||
* const div = styled.div` | ||
* ${triangle({ pointingDirection: 'right', width: '100px', height: '100px', foregroundColor: 'red' })} | ||
* | ||
* | ||
* // CSS as JS Output | ||
* | ||
* div: { | ||
* 'borderColor': 'transparent', | ||
* 'borderLeftColor': 'red !important', | ||
* 'borderStyle': 'solid', | ||
* 'borderWidth': '50px 0 50px 100px', | ||
* 'height': '0', | ||
* 'width': '0', | ||
* } | ||
*/ | ||
};function triangle(_ref) { | ||
var _ref2; | ||
/** | ||
* CSS to represent triangle with any pointing direction with an optional background color. Accepts number or px values for height and width. | ||
* | ||
* @example | ||
* // Styles as object usage | ||
* | ||
* const styles = { | ||
* ...triangle({ pointingDirection: 'right', width: '100px', height: '100px', foregroundColor: 'red' }) | ||
* } | ||
* | ||
* | ||
* // styled-components usage | ||
* const div = styled.div` | ||
* ${triangle({ pointingDirection: 'right', width: '100px', height: '100px', foregroundColor: 'red' })} | ||
* | ||
* | ||
* // CSS as JS Output | ||
* | ||
* div: { | ||
* 'borderColor': 'transparent', | ||
* 'borderLeftColor': 'red !important', | ||
* 'borderStyle': 'solid', | ||
* 'borderWidth': '50px 0 50px 100px', | ||
* 'height': '0', | ||
* 'width': '0', | ||
* } | ||
*/ | ||
function triangle(_ref) { | ||
var pointingDirection = _ref.pointingDirection, | ||
@@ -72,15 +71,17 @@ height = _ref.height, | ||
var unitlessHeight = parseFloat(height); | ||
var unitlessWidth = parseFloat(width); | ||
if (isNaN(unitlessHeight) || isNaN(unitlessWidth)) { | ||
var widthAndUnit = [parseFloat(width), String(width).replace(/\d+/g, '') || 'px']; | ||
var heightAndUnit = [parseFloat(height), String(height).replace(/\d+/g, '') || 'px']; | ||
if (isNaN(heightAndUnit[0]) || isNaN(widthAndUnit[0])) { | ||
throw new Error('Passed an invalid value to `height` or `width`. Please provide a pixel based unit'); | ||
} | ||
return _ref2 = { | ||
borderColor: backgroundColor, | ||
var reverseDirectionIndex = reverseDirection.indexOf(pointingDirection); | ||
return _extends({ | ||
width: '0', | ||
height: '0', | ||
borderWidth: getBorderWidth(pointingDirection, unitlessHeight, unitlessWidth), | ||
borderWidth: getBorderWidth(pointingDirection, heightAndUnit, widthAndUnit), | ||
borderStyle: 'solid' | ||
}, _ref2['border' + reverseDirection[pointingDirection] + 'Color'] = foregroundColor + ' !important', _ref2; | ||
}, _borderColor2.default.apply(undefined, Array.from({ length: 4 }).map(function (_, index) { | ||
return index === reverseDirectionIndex ? foregroundColor : backgroundColor; | ||
}))); | ||
} | ||
@@ -87,0 +88,0 @@ |
@@ -1,3 +0,5 @@ | ||
declare function wordWrap(wrap?: string): Object; | ||
import { Styles } from '../types/style'; | ||
declare function wordWrap(wrap?: string): Styles; | ||
export default wordWrap; |
@@ -30,3 +30,2 @@ 'use strict'; | ||
*/ | ||
function wordWrap() { | ||
@@ -42,4 +41,3 @@ var wrap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'break-word'; | ||
} | ||
exports.default = wordWrap; | ||
module.exports = exports['default']; |
@@ -1,6 +0,7 @@ | ||
export type AnimationProperty = string | number; | ||
import { Styles } from '../types/style'; | ||
declare function animation( | ||
...args: Array<Array<AnimationProperty> | AnimationProperty> | ||
): Object; | ||
...args: Array<Array<string | number> | string | number> | ||
): Styles; | ||
export default animation; |
@@ -69,5 +69,3 @@ 'use strict'; | ||
} | ||
/** */ | ||
exports.default = animation; | ||
module.exports = exports['default']; |
@@ -1,3 +0,5 @@ | ||
declare function backgroundImages(...properties: Array<string>): Object; | ||
import { Styles } from '../types/style'; | ||
declare function backgroundImages(...properties: Array<string>): Styles; | ||
export default backgroundImages; |
@@ -27,3 +27,2 @@ 'use strict'; | ||
*/ | ||
function backgroundImages() { | ||
@@ -38,4 +37,3 @@ for (var _len = arguments.length, properties = Array(_len), _key = 0; _key < _len; _key++) { | ||
} | ||
exports.default = backgroundImages; | ||
module.exports = exports['default']; |
@@ -1,3 +0,5 @@ | ||
declare function backgrounds(...properties: Array<string>): Object; | ||
import { Styles } from '../types/style'; | ||
declare function backgrounds(...properties: Array<string>): Styles; | ||
export default backgrounds; |
@@ -36,4 +36,3 @@ 'use strict'; | ||
} | ||
exports.default = backgrounds; | ||
module.exports = exports['default']; |
@@ -1,3 +0,5 @@ | ||
declare function borderColor(...values: Array<null | void | string>): Object; | ||
import { Styles } from '../types/style'; | ||
declare function borderColor(...values: Array<null | void | string>): Styles; | ||
export default borderColor; |
@@ -35,3 +35,2 @@ 'use strict'; | ||
*/ | ||
function borderColor() { | ||
@@ -38,0 +37,0 @@ for (var _len = arguments.length, values = Array(_len), _key = 0; _key < _len; _key++) { |
@@ -1,3 +0,5 @@ | ||
declare function borderRadius(side: string, radius: string | number): Object; | ||
import { Styles } from '../types/style'; | ||
declare function borderRadius(side: string, radius: string | number): Styles; | ||
export default borderRadius; |
@@ -33,3 +33,2 @@ 'use strict'; | ||
*/ | ||
function borderRadius(side, radius) { | ||
@@ -36,0 +35,0 @@ var uppercaseSide = (0, _capitalizeString2.default)(side); |
@@ -1,3 +0,5 @@ | ||
declare function borderStyle(...values: Array<null | void | string>): Object; | ||
import { Styles } from '../types/style'; | ||
declare function borderStyle(...values: Array<null | void | string>): Styles; | ||
export default borderStyle; |
@@ -35,3 +35,2 @@ 'use strict'; | ||
*/ | ||
function borderStyle() { | ||
@@ -38,0 +37,0 @@ for (var _len = arguments.length, values = Array(_len), _key = 0; _key < _len; _key++) { |
@@ -0,5 +1,7 @@ | ||
import { Styles } from '../types/style'; | ||
declare function borderWidth( | ||
...values: Array<null | void | string | null | void | number> | ||
): Object; | ||
): Styles; | ||
export default borderWidth; |
@@ -46,3 +46,2 @@ 'use strict'; | ||
*/ | ||
function buttons() { | ||
@@ -49,0 +48,0 @@ for (var _len = arguments.length, states = Array(_len), _key = 0; _key < _len; _key++) { |
@@ -0,5 +1,7 @@ | ||
import { Styles } from '../types/style'; | ||
declare function margin( | ||
...values: Array<null | void | string | null | void | number> | ||
): Object; | ||
): Styles; | ||
export default margin; |
@@ -35,3 +35,2 @@ 'use strict'; | ||
*/ | ||
function margin() { | ||
@@ -38,0 +37,0 @@ for (var _len = arguments.length, values = Array(_len), _key = 0; _key < _len; _key++) { |
@@ -0,5 +1,7 @@ | ||
import { Styles } from '../types/style'; | ||
declare function padding( | ||
...values: Array<null | void | string | null | void | number> | ||
): Object; | ||
): Styles; | ||
export default padding; |
@@ -35,3 +35,2 @@ 'use strict'; | ||
*/ | ||
function padding() { | ||
@@ -38,0 +37,0 @@ for (var _len = arguments.length, values = Array(_len), _key = 0; _key < _len; _key++) { |
@@ -0,6 +1,8 @@ | ||
import { Styles } from '../types/style'; | ||
declare function position( | ||
positionKeyword: string | null, | ||
...values: Array<null | void | string | null | void | number> | ||
): Object; | ||
): Styles; | ||
export default position; |
@@ -59,3 +59,2 @@ 'use strict'; | ||
*/ | ||
function position(positionKeyword) { | ||
@@ -62,0 +61,0 @@ for (var _len = arguments.length, values = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { |
@@ -1,3 +0,5 @@ | ||
declare function size(height: string | number, width?: string | number): Object; | ||
import { Styles } from '../types/style'; | ||
declare function size(height: string | number, width?: string | number): Styles; | ||
export default size; |
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -28,3 +28,2 @@ Object.defineProperty(exports, "__esModule", { | ||
*/ | ||
function size(height) { | ||
@@ -38,4 +37,3 @@ var width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : height; | ||
} | ||
exports.default = size; | ||
module.exports = exports["default"]; | ||
module.exports = exports['default']; |
@@ -58,3 +58,2 @@ 'use strict'; | ||
*/ | ||
function textInputs() { | ||
@@ -61,0 +60,0 @@ for (var _len = arguments.length, states = Array(_len), _key = 0; _key < _len; _key++) { |
@@ -1,3 +0,7 @@ | ||
declare function transitions(...properties: Array<string>): Object; | ||
import { Styles } from '../types/style'; | ||
declare function transitions( | ||
...properties: Array<string | Array<string>> | ||
): Styles; | ||
export default transitions; |
@@ -9,7 +9,8 @@ 'use strict'; | ||
/** | ||
* Shorthand that accepts any number of transition values as parameters for creating a single transition statement. | ||
* Accepts any number of transition values as parameters for creating a single transition statement. You may also pass an array of properties as the first parameter that you would like to apply the same tranisition values to (second parameter). | ||
* @example | ||
* // Styles as object usage | ||
* const styles = { | ||
* ...transitions('opacity 1.0s ease-in 0s', 'width 2.0s ease-in 2s') | ||
* ...transitions('opacity 1.0s ease-in 0s', 'width 2.0s ease-in 2s'), | ||
* ...transitions(['color', 'background-color'], '2.0s ease-in 2s') | ||
* } | ||
@@ -19,3 +20,4 @@ * | ||
* const div = styled.div` | ||
* ${transitions('opacity 1.0s ease-in 0s', 'width 2.0s ease-in 2s')} | ||
* ${transitions('opacity 1.0s ease-in 0s', 'width 2.0s ease-in 2s')}; | ||
* ${transitions(['color', 'background-color'], '2.0s ease-in 2s'),}; | ||
* ` | ||
@@ -27,5 +29,5 @@ * | ||
* 'transition': 'opacity 1.0s ease-in 0s, width 2.0s ease-in 2s' | ||
* 'transition': 'color 2.0s ease-in 2s, background-color 2.0s ease-in 2s', | ||
* } | ||
*/ | ||
function transitions() { | ||
@@ -36,8 +38,20 @@ for (var _len = arguments.length, properties = Array(_len), _key = 0; _key < _len; _key++) { | ||
return { | ||
transition: properties.join(', ') | ||
}; | ||
if (Array.isArray(properties[0]) && properties.length === 2) { | ||
var value = properties[1]; | ||
if (typeof value !== 'string') { | ||
throw new Error('Property must be a string value.'); | ||
} | ||
var transitionsString = properties[0].map(function (property) { | ||
return property + ' ' + value; | ||
}).join(', '); | ||
return { | ||
transition: transitionsString | ||
}; | ||
} else { | ||
return { | ||
transition: properties.join(', ') | ||
}; | ||
} | ||
} | ||
exports.default = transitions; | ||
module.exports = exports['default']; |
MIT License | ||
Copyright (c) 2016 Glen Maddern and Maximilian Stoiber | ||
Copyright (c) 2016 - 2018 Brian Hough and Maximilian Stoiber | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
@@ -8,5 +8,5 @@ { | ||
"types": "lib/index.d.ts", | ||
"version": "1.9.3", | ||
"version": "2.0.0-alpha.0", | ||
"scripts": { | ||
"build": "npm run build:lib && npm run build:dist && npm run build:flow && npm run build:docs && npm run build:typescript", | ||
"build": "yarn build:lib && yarn build:dist && yarn build:flow && yarn build:docs && yarn build:typescript", | ||
"prebuild:lib": "shx rm -rf lib/*", | ||
@@ -17,3 +17,3 @@ "build:lib": "cross-env BABEL_ENV=cjs babel --out-dir lib src --ignore test.js", | ||
"build:dist": "rollup -c && rollup -c --environment PRODUCTION", | ||
"build:docs": "npm run build:docs:site", | ||
"build:docs": "yarn build:docs:site", | ||
"prebuild:docs:site": "shx rm -rf docs/*", | ||
@@ -32,3 +32,3 @@ "build:docs:site": "documentation build src/** -t docs-theme --github -o docs -f html -c ./.documentation.json", | ||
"docs": "pushstate-server docs", | ||
"prepublish": "npm run build && npm run typescript", | ||
"prepublish": "yarn build && yarn typescript", | ||
"semantic-release": "semantic-release" | ||
@@ -61,8 +61,8 @@ }, | ||
"polished", | ||
"glamorous", | ||
"motion", | ||
"emotion", | ||
"glamor", | ||
"css-in-js", | ||
"inline-styles", | ||
"react" | ||
"react", | ||
"typescript" | ||
], | ||
@@ -76,7 +76,7 @@ "bugs": { | ||
"babel-core": "^6.26.0", | ||
"babel-eslint": "^8.2.1", | ||
"babel-jest": "^22.1.0", | ||
"babel-loader": "^7.1.2", | ||
"babel-eslint": "^8.2.6", | ||
"babel-jest": "^23.4.0", | ||
"babel-loader": "^7.1.5", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-plugin-annotate-pure-calls": "^0.2.2", | ||
"babel-plugin-annotate-pure-calls": "^0.3.0", | ||
"babel-plugin-external-helpers": "^6.18.0", | ||
@@ -89,36 +89,34 @@ "babel-plugin-syntax-trailing-function-commas": "^6.22.0", | ||
"concat-stream": "^1.5.2", | ||
"cross-env": "^5.1.3", | ||
"cross-env": "^5.2.0", | ||
"cz-conventional-changelog": "^2.1.0", | ||
"documentation": "4.0.0-beta.18", | ||
"eslint": "^4.17.0", | ||
"eslint-config-airbnb-base": "^12.1.0", | ||
"eslint-plugin-import": "^2.8.0", | ||
"flow-bin": "^0.75.0", | ||
"flow-copy-source": "^1.2.2", | ||
"flow-coverage-report": "^0.4.1", | ||
"github-slugger": "^1.2.0", | ||
"highlight.js": "^9.12.0", | ||
"documentation": "8.0.2", | ||
"eslint": "^5.2.0", | ||
"eslint-config-airbnb-base": "^13.0.0", | ||
"eslint-plugin-import": "^2.13.0", | ||
"flow-bin": "0.77.0", | ||
"flow-copy-source": "^2.0.2", | ||
"flow-coverage-report": "^0.5.0", | ||
"husky": "^0.14.3", | ||
"jest": "^22.1.4", | ||
"lint-staged": "^6.1.0", | ||
"jest": "^23.4.1", | ||
"lint-staged": "^7.2.0", | ||
"lodash": "^4.17.5", | ||
"npm-watch": "^0.3.0", | ||
"prettier": "^1.10.2", | ||
"pushstate-server": "^3.0.1", | ||
"prettier": "^1.13.7", | ||
"pushstate-server": "3.0.1", | ||
"ramda": "^0.25.0", | ||
"rollup": "^0.55.3", | ||
"rollup-plugin-babel": "^3.0.3", | ||
"rollup-plugin-commonjs": "8.2.1", | ||
"rollup": "^0.63.4", | ||
"rollup-plugin-babel": "^3.0.7", | ||
"rollup-plugin-commonjs": "9.1.3", | ||
"rollup-plugin-flow": "^1.1.1", | ||
"rollup-plugin-inject": "^2.0.0", | ||
"rollup-plugin-json": "^2.3.0", | ||
"rollup-plugin-inject": "^2.2.0", | ||
"rollup-plugin-json": "^3.0.0", | ||
"rollup-plugin-node-resolve": "^3.0.2", | ||
"rollup-plugin-replace": "^2.0.0", | ||
"rollup-plugin-uglify": "^3.0.0", | ||
"semantic-release": "^12.4.1", | ||
"shx": "^0.2.2", | ||
"tsgen": "^1.0.0", | ||
"typescript": "^2.7.1", | ||
"rollup-plugin-uglify": "^4.0.0", | ||
"semantic-release": "^15.8.1", | ||
"shx": "^0.3.2", | ||
"tsgen": "1.3.0", | ||
"typescript": "2.9.2", | ||
"validate-commit-msg": "^2.14.0", | ||
"vinyl": "^2.1.0", | ||
"vinyl": "^2.2.0", | ||
"vinyl-fs": "^3.0.2" | ||
@@ -133,3 +131,5 @@ }, | ||
"coverageDirectory": "./coverage/", | ||
"collectCoverage": true | ||
"collectCoverage": true, | ||
"testURL": "http://localhost/", | ||
"verbose": true | ||
}, | ||
@@ -136,0 +136,0 @@ "collective": { |
@@ -9,3 +9,3 @@ <a href="https://github.com/styled-components/polished"> | ||
[![Build Status](https://travis-ci.org/styled-components/polished.svg?branch=master)](https://travis-ci.org/styled-components/polished) [![codecov](https://codecov.io/gh/styled-components/polished/branch/master/graph/badge.svg)](https://codecov.io/gh/styled-components/polished) [![Dependency Status](https://david-dm.org/styled-components/polished/status.svg)](https://david-dm.org/styled-components/polished) [![Supported by Thinkmill](https://thinkmill.github.io/badge/heart.svg)](http://thinkmill.com.au/?utm_source=github&utm_medium=badge&utm_campaign=polished) | ||
[![Backers on Open Collective](https://opencollective.com/polished/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/polished/sponsors/badge.svg)](#sponsors) | ||
[![Backers on Open Collective](https://opencollective.com/polished/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/polished/sponsors/badge.svg)](#sponsors) | ||
@@ -74,3 +74,3 @@ ```sh | ||
// Create tone() helper | ||
const tone = compose(lighten(10), desaturate(10)) | ||
const tone = compose(lighten(0.1), desaturate(0.1)) | ||
``` | ||
@@ -124,2 +124,2 @@ | ||
Copyright © 2016 Maximilian Stoiber. Licensed under the MIT License, see [LICENSE.md](LICENSE.md) for more information! | ||
Copyright © 2016-2018 Brian Hough & Maximilian Stoiber. Licensed under the MIT License, see [LICENSE.md](LICENSE.md) for more information! |
import * as polished from "./lib/index"; | ||
import { ENGINE_METHOD_NONE } from "constants"; | ||
@@ -6,8 +7,47 @@ /* | ||
*/ | ||
let between: string = polished.between("20px", "100px", "400px", "1000px"); | ||
between = polished.between("20px", "100px"); | ||
let clearFix: object = polished.clearFix(); | ||
clearFix = polished.clearFix("&"); | ||
let cover: object = polished.cover(); | ||
cover = polished.cover("100px"); | ||
let ellipsis: object = polished.ellipsis(); | ||
ellipsis = polished.ellipsis("250px"); | ||
let fluidRange: object = polished.fluidRange( | ||
{ | ||
prop: 'padding', | ||
fromSize: '20px', | ||
toSize: '100px', | ||
}, | ||
'400px', | ||
'1000px', | ||
); | ||
fluidRange = polished.fluidRange( | ||
[ | ||
{ | ||
prop: 'padding', | ||
fromSize: '20px', | ||
toSize: '100px', | ||
}, | ||
{ | ||
prop: 'margin', | ||
fromSize: '5px', | ||
toSize: '25px', | ||
}, | ||
], | ||
'400px', | ||
'1000px', | ||
); | ||
fluidRange = polished.fluidRange({ | ||
prop: 'padding', | ||
fromSize: '20px', | ||
toSize: '100px', | ||
}); | ||
const fontFace: object = polished.fontFace({ | ||
@@ -74,2 +114,3 @@ fontFamily: "Sans-Pro", | ||
const desaturate: string = polished.desaturate(0.2, "#CCCD64"); | ||
const getLuminance: number = polished.getLuminance('#6564CDB3'); | ||
const grayscale: string = polished.grayscale("#CCCD64"); | ||
@@ -115,4 +156,5 @@ | ||
const animation: object = polished.animation(["rotate", 1, "ease-in-out"], ["colorchange", "2s"]); | ||
const backgroundImages: object = polished.backgroundImages("url('/image/background.jpg')", "linear-gradient(red, green)"); | ||
const backgrounds: object = polished.backgrounds("url('/image/background.jpg')", "linear-gradient(red, green)", "center no-repeat"); | ||
const backgroundImages: object = polished.backgroundImages('url("/image/background.jpg")', 'linear-gradient(red, green)'); | ||
const backgrounds: object = polished.backgrounds('url("/image/background.jpg")', "linear-gradient(red, green)", "center no-repeat"); | ||
const border: object = polished.border('top', '1px', 'solid', 'red'); | ||
const borderColor: object = polished.borderColor("red", null, undefined, "green"); | ||
@@ -145,4 +187,3 @@ const borderRadius: object = polished.borderRadius("top", "5px"); | ||
let rem: string = polished.rem("12px"); | ||
rem = polished.rem(12); | ||
const getValueAndUnit: [number | string, string | void] = polished.getValueAndUnit('100px'); | ||
@@ -155,2 +196,5 @@ let modularScale: string = polished.modularScale(2); | ||
let rem: string = polished.rem("12px"); | ||
rem = polished.rem(12); | ||
const stripUnit: number | string = polished.stripUnit("100px"); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
2503320
47
290
15002
0
1
3