styled-breakpoints
Advanced tools
Comparing version 0.0.1-alpha.6 to 0.0.1-alpha.7
@@ -107,3 +107,3 @@ 'use strict'; | ||
} catch (err) { | ||
console.error(err); | ||
console.warn(err); | ||
} | ||
@@ -123,3 +123,3 @@ | ||
} else { | ||
console.error('styled-breakpoints: No valid breakpoint or size specified for media.'); | ||
console.warn('styled-breakpoints: No valid breakpoint or size specified for media.'); | ||
result = '0'; | ||
@@ -126,0 +126,0 @@ } |
@@ -103,3 +103,3 @@ import { css } from 'styled-components'; | ||
} catch (err) { | ||
console.error(err); | ||
console.warn(err); | ||
} | ||
@@ -119,3 +119,3 @@ | ||
} else { | ||
console.error('styled-breakpoints: No valid breakpoint or size specified for media.'); | ||
console.warn('styled-breakpoints: No valid breakpoint or size specified for media.'); | ||
result = '0'; | ||
@@ -122,0 +122,0 @@ } |
@@ -1,2 +0,2 @@ | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("styled-components")):"function"==typeof define&&define.amd?define(["exports","styled-components"],e):e(n["styled-breakpoints"]={},n.styledComponents)}(this,function(n,e){"use strict";function t(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,t=arguments[2],r={};for(var i in n){var o=n[i];String(o).includes("px")?r[i]=+parseInt(o,10)/e+t:r[i]=o}return r}function r(n,e){return n.raw=e,n}var i=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},o=r(["\n @media screen and (min-width: ",") {\n ",";\n }\n "],["\n @media screen and (min-width: ",") {\n ",";\n }\n "]),a=r(["\n @media screen and (max-width: ",") {\n ",";\n }\n "],["\n @media screen and (max-width: ",") {\n ",";\n }\n "]),d=r(["\n @media screen and (min-width: ",") and (max-width: ",") {\n ",";\n }\n "],["\n @media screen and (min-width: ",") and (max-width: ",") {\n ",";\n }\n "]),s=r(["\n @media (max-width: ",") {\n ",";\n }\n "],["\n @media (max-width: ",") {\n ",";\n }\n "]),c=r(["\n @media (min-width: ",") {\n ",";\n }\n "],["\n @media (min-width: ",") {\n ",";\n }\n "]),l={mobile:"576px",tablet:"768px",desktop:"992px",lgDesktop:"1200px"},u=function(n,e){var t=Object.keys(e),r=t[t.length-2],i=t.indexOf(n);if(!(i<t.length-1))throw new Error('"'+n+'" is incorrect value. Use '+r);return t[""+(i+1)]},p=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=null,r=u(n,e);try{if(e[n])t=parseFloat(e[r])-.02+"px";else{if(!parseInt(n,10))throw t="0",new Error("styled-breakpoints: No valid breakpoint or size specified for media.");t=""+(Number(n)-.02)}}catch(n){console.error(n)}return t},f=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=null;return e[n]?t=e[n]:parseInt(n,10)?t=n:(console.error("styled-breakpoints: No valid breakpoint or size specified for media."),t="0"),t},m=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=Object.keys(n).reduce(function(t,r){var i=n[r];return t.to[r]=function(){return console.warn("styled-breakpoints: Use media.below('"+r+"') instead of old media.to."+r+" (Probably we'll deprecate it)"),e.css(s,i,e.css.apply(void 0,arguments))},t.from[r]=function(){return console.warn("styled-breakpoints: Use media.above('"+r+"') instead of old media.from."+r+" (Probably we'll deprecate it)"),e.css(c,i,e.css.apply(void 0,arguments))},t},{to:{},from:{}});return i({},t,{below:function(t){return function(){return e.css(a,p(t,n),e.css.apply(void 0,arguments))}},above:function(t){return function(){return e.css(o,f(t,n),e.css.apply(void 0,arguments))}},between:function(t,r){return function(){return e.css(d,f(t,n),p(r,n),e.css.apply(void 0,arguments))}}})},v=m();n.toEm=function(n){return t(n,arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,"em")},n.toRem=function(n){return t(n,arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,"rem")},n.defaultBreakpoints=l,n._getSizeFromBreakpoint=f,n.generateMedia=m,n.default=v,Object.defineProperty(n,"__esModule",{value:!0})}); | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("styled-components")):"function"==typeof define&&define.amd?define(["exports","styled-components"],e):e(n["styled-breakpoints"]={},n.styledComponents)}(this,function(n,e){"use strict";function t(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,t=arguments[2],r={};for(var i in n){var o=n[i];String(o).includes("px")?r[i]=+parseInt(o,10)/e+t:r[i]=o}return r}function r(n,e){return n.raw=e,n}var i=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},o=r(["\n @media screen and (min-width: ",") {\n ",";\n }\n "],["\n @media screen and (min-width: ",") {\n ",";\n }\n "]),a=r(["\n @media screen and (max-width: ",") {\n ",";\n }\n "],["\n @media screen and (max-width: ",") {\n ",";\n }\n "]),d=r(["\n @media screen and (min-width: ",") and (max-width: ",") {\n ",";\n }\n "],["\n @media screen and (min-width: ",") and (max-width: ",") {\n ",";\n }\n "]),s=r(["\n @media (max-width: ",") {\n ",";\n }\n "],["\n @media (max-width: ",") {\n ",";\n }\n "]),c=r(["\n @media (min-width: ",") {\n ",";\n }\n "],["\n @media (min-width: ",") {\n ",";\n }\n "]),l={mobile:"576px",tablet:"768px",desktop:"992px",lgDesktop:"1200px"},u=function(n,e){var t=Object.keys(e),r=t[t.length-2],i=t.indexOf(n);if(!(i<t.length-1))throw new Error('"'+n+'" is incorrect value. Use '+r);return t[""+(i+1)]},p=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=null,r=u(n,e);try{if(e[n])t=parseFloat(e[r])-.02+"px";else{if(!parseInt(n,10))throw t="0",new Error("styled-breakpoints: No valid breakpoint or size specified for media.");t=""+(Number(n)-.02)}}catch(n){console.warn(n)}return t},f=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=null;return e[n]?t=e[n]:parseInt(n,10)?t=n:(console.warn("styled-breakpoints: No valid breakpoint or size specified for media."),t="0"),t},m=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=Object.keys(n).reduce(function(t,r){var i=n[r];return t.to[r]=function(){return console.warn("styled-breakpoints: Use media.below('"+r+"') instead of old media.to."+r+" (Probably we'll deprecate it)"),e.css(s,i,e.css.apply(void 0,arguments))},t.from[r]=function(){return console.warn("styled-breakpoints: Use media.above('"+r+"') instead of old media.from."+r+" (Probably we'll deprecate it)"),e.css(c,i,e.css.apply(void 0,arguments))},t},{to:{},from:{}});return i({},t,{below:function(t){return function(){return e.css(a,p(t,n),e.css.apply(void 0,arguments))}},above:function(t){return function(){return e.css(o,f(t,n),e.css.apply(void 0,arguments))}},between:function(t,r){return function(){return e.css(d,f(t,n),p(r,n),e.css.apply(void 0,arguments))}}})},v=m();n.toEm=function(n){return t(n,arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,"em")},n.toRem=function(n){return t(n,arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,"rem")},n.defaultBreakpoints=l,n._getSizeFromBreakpoint=f,n.generateMedia=m,n.default=v,Object.defineProperty(n,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=styled-breakpoints.umd.js.map |
{ | ||
"name": "styled-breakpoints", | ||
"version": "0.0.1-alpha.6", | ||
"version": "0.0.1-alpha.7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/styled-breakpoints.common.js", |
@@ -50,3 +50,3 @@ import { css } from 'styled-components'; | ||
} catch (err) { | ||
console.error(err); | ||
console.warn(err); | ||
} | ||
@@ -64,3 +64,3 @@ | ||
} else { | ||
console.error( | ||
console.warn( | ||
'styled-breakpoints: No valid breakpoint or size specified for media.', | ||
@@ -67,0 +67,0 @@ ); |
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
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
51050