styled-breakpoints
Advanced tools
Comparing version 0.0.1-alpha.14 to 0.0.1-alpha.15
@@ -59,3 +59,3 @@ 'use strict'; | ||
var toEm = function toEm(inPx) { | ||
return parseFloat(inPx) / BROWSER_DEFAULT_FONT_SIZE; | ||
return parseFloat(inPx) / BROWSER_DEFAULT_FONT_SIZE + 'em'; | ||
}; | ||
@@ -62,0 +62,0 @@ |
@@ -55,3 +55,3 @@ import { css } from 'styled-components'; | ||
var toEm = function toEm(inPx) { | ||
return parseFloat(inPx) / BROWSER_DEFAULT_FONT_SIZE; | ||
return parseFloat(inPx) / BROWSER_DEFAULT_FONT_SIZE + 'em'; | ||
}; | ||
@@ -58,0 +58,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=r(["\n @media screen and (min-width: ",") {\n ",";\n }\n "],["\n @media screen and (min-width: ",") {\n ",";\n }\n "]),o=r(["\n @media screen and (max-width: ",") {\n ",";\n }\n "],["\n @media screen and (max-width: ",") {\n ",";\n }\n "]),a=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=function(n){return parseFloat(n)/16},d={mobile:"576px",tablet:"768px",desktop:"992px",lgDesktop:"1200px"},c=function(n,e){var t=Object.keys(e),r=t[t.length-2],i=t.indexOf(n);try{if(i<t.length-1)return t[""+(i+1)];throw new Error('"styled-breakpoints: '+n+'" is incorrect value. Use '+r+".")}catch(n){console.warn(n)}},u=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=null;try{var r=c(n,e);if(e[n])t=parseFloat(e[r])-.02+"px";else{if(!parseInt(n,10))throw new Error("styled-breakpoints: "+n+" no valid breakpoint or size specified for media.");t=""+(Number(n)-.02)}}catch(n){console.warn(n)}return t},l=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=null;try{if(e[n])t=e[n];else{if(!parseInt(n,10))throw new Error("styled-breakpoints: No valid breakpoint or size specified for media.");t=n}}catch(n){console.warn(n)}return t},f=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d;return{below:function(t){return function(){return e.css(o,u(t,n),e.css.apply(void 0,arguments))}},above:function(t){return function(){return e.css(i,s(l(t,n)),e.css.apply(void 0,arguments))}},only:function(t){return function(){return e.css(a,l(t,n),u(t,n),e.css.apply(void 0,arguments))}},between:function(t,r){return function(){return e.css(a,l(t,n),u(r,n),e.css.apply(void 0,arguments))}}}},p=f();n.toRem=function(n){return t(n,arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,"rem")},n.defaultBreakpoints=d,n._getBreakValue=l,n.generateMedia=f,n.default=p,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=r(["\n @media screen and (min-width: ",") {\n ",";\n }\n "],["\n @media screen and (min-width: ",") {\n ",";\n }\n "]),o=r(["\n @media screen and (max-width: ",") {\n ",";\n }\n "],["\n @media screen and (max-width: ",") {\n ",";\n }\n "]),a=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=function(n){return parseFloat(n)/16+"em"},d={mobile:"576px",tablet:"768px",desktop:"992px",lgDesktop:"1200px"},c=function(n,e){var t=Object.keys(e),r=t[t.length-2],i=t.indexOf(n);try{if(i<t.length-1)return t[""+(i+1)];throw new Error('"styled-breakpoints: '+n+'" is incorrect value. Use '+r+".")}catch(n){console.warn(n)}},u=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=null;try{var r=c(n,e);if(e[n])t=parseFloat(e[r])-.02+"px";else{if(!parseInt(n,10))throw new Error("styled-breakpoints: "+n+" no valid breakpoint or size specified for media.");t=""+(Number(n)-.02)}}catch(n){console.warn(n)}return t},l=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=null;try{if(e[n])t=e[n];else{if(!parseInt(n,10))throw new Error("styled-breakpoints: No valid breakpoint or size specified for media.");t=n}}catch(n){console.warn(n)}return t},f=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d;return{below:function(t){return function(){return e.css(o,u(t,n),e.css.apply(void 0,arguments))}},above:function(t){return function(){return e.css(i,s(l(t,n)),e.css.apply(void 0,arguments))}},only:function(t){return function(){return e.css(a,l(t,n),u(t,n),e.css.apply(void 0,arguments))}},between:function(t,r){return function(){return e.css(a,l(t,n),u(r,n),e.css.apply(void 0,arguments))}}}},p=f();n.toRem=function(n){return t(n,arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,"rem")},n.defaultBreakpoints=d,n._getBreakValue=l,n.generateMedia=f,n.default=p,Object.defineProperty(n,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=styled-breakpoints.umd.js.map |
{ | ||
"name": "styled-breakpoints", | ||
"version": "0.0.1-alpha.14", | ||
"version": "0.0.1-alpha.15", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/styled-breakpoints.common.js", |
@@ -7,3 +7,3 @@ import { css } from 'styled-components'; | ||
const BROWSER_DEFAULT_FONT_SIZE = 16; | ||
const toEm = inPx => parseFloat(inPx) / BROWSER_DEFAULT_FONT_SIZE; | ||
const toEm = inPx => `${parseFloat(inPx) / BROWSER_DEFAULT_FONT_SIZE}em`; | ||
@@ -10,0 +10,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
45269