@just-web/css 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/convertors/px_2_rem.d.ts +1 -1
- package/cjs/convertors/px_2_rem.js +1 -1
- package/cjs/convertors/rem_2_px.d.ts +1 -1
- package/cjs/convertors/rem_2_px.js +1 -1
- package/esm/convertors/px_2_rem.d.ts +1 -1
- package/esm/convertors/px_2_rem.d.ts.map +1 -1
- package/esm/convertors/px_2_rem.js +1 -1
- package/esm/convertors/px_2_rem.js.map +1 -1
- package/esm/convertors/rem_2_px.d.ts +1 -1
- package/esm/convertors/rem_2_px.d.ts.map +1 -1
- package/esm/convertors/rem_2_px.js +1 -1
- package/esm/convertors/rem_2_px.js.map +1 -1
- package/package.json +1 -1
- package/src/convertors/px_2_rem.ts +5 -2
- package/src/convertors/rem_2_px.ts +5 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"px_2_rem.d.ts","sourceRoot":"","sources":["../../src/convertors/px_2_rem.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,
|
|
1
|
+
{"version":3,"file":"px_2_rem.d.ts","sourceRoot":"","sources":["../../src/convertors/px_2_rem.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CACrB,EAAE,EAAE,MAAM,GAAG,MAAM,EACnB,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GACrE,MAAM,CASR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"px_2_rem.js","sourceRoot":"","sources":["../../src/convertors/px_2_rem.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"px_2_rem.js","sourceRoot":"","sources":["../../src/convertors/px_2_rem.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,MAAM,CACrB,EAAmB,EACnB,OAAuE;IAEvE,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,SAAS,GAAG,CAAC,EAAE,GAAG,OAAO,IAAI,EAAE,CAAA;IAElD,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;QAC5B,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;QAC1B,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;IAC3B,CAAC;IAED,OAAO,MAAM,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAA;AAC9C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rem_2_px.d.ts","sourceRoot":"","sources":["../../src/convertors/rem_2_px.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,
|
|
1
|
+
{"version":3,"file":"rem_2_px.d.ts","sourceRoot":"","sources":["../../src/convertors/rem_2_px.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CACrB,GAAG,EAAE,MAAM,GAAG,MAAM,EACpB,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GACrE,MAAM,CASR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rem_2_px.js","sourceRoot":"","sources":["../../src/convertors/rem_2_px.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"rem_2_px.js","sourceRoot":"","sources":["../../src/convertors/rem_2_px.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,MAAM,CACrB,GAAoB,EACpB,OAAuE;IAEvE,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,SAAS,GAAG,CAAC,EAAE,GAAG,OAAO,IAAI,EAAE,CAAA;IAElD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC7B,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;QAC7B,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;IAC7B,CAAC;IAED,OAAO,MAAM,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAA;AAC/C,CAAC"}
|
package/package.json
CHANGED
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
* px2rem(13, { precision: 2 }) // '0.81'
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
export function px2rem(
|
|
18
|
+
export function px2rem(
|
|
19
|
+
px: number | string,
|
|
20
|
+
options?: { base?: number | undefined; precision?: number | undefined },
|
|
21
|
+
): number {
|
|
19
22
|
const { base = 16, precision = 4 } = options ?? {}
|
|
20
23
|
|
|
21
24
|
if (typeof px === 'string') {
|
|
@@ -23,5 +26,5 @@ export function px2rem(px: number | string, options?: { base?: number | undefine
|
|
|
23
26
|
px = Number.parseFloat(px)
|
|
24
27
|
}
|
|
25
28
|
|
|
26
|
-
return (px / base).toFixed(precision)
|
|
29
|
+
return Number((px / base).toFixed(precision))
|
|
27
30
|
}
|
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
* rem2px(0.8125, { precision: 2 }) // '13.00'
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
export function rem2px(
|
|
18
|
+
export function rem2px(
|
|
19
|
+
rem: number | string,
|
|
20
|
+
options?: { base?: number | undefined; precision?: number | undefined },
|
|
21
|
+
): number {
|
|
19
22
|
const { base = 16, precision = 4 } = options ?? {}
|
|
20
23
|
|
|
21
24
|
if (typeof rem === 'string') {
|
|
@@ -23,5 +26,5 @@ export function rem2px(rem: number | string, options?: { base?: number | undefin
|
|
|
23
26
|
rem = Number.parseFloat(rem)
|
|
24
27
|
}
|
|
25
28
|
|
|
26
|
-
return (rem * base).toFixed(precision)
|
|
29
|
+
return Number((rem * base).toFixed(precision))
|
|
27
30
|
}
|