@unocss/preset-rem-to-px 0.58.9 → 0.59.0
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/package.json +6 -6
- package/dist/index.cjs +0 -25
- package/dist/index.d.cts +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-rem-to-px",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.59.0",
|
|
4
5
|
"description": "Convert all rem to px in utils",
|
|
5
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
7
|
"license": "MIT",
|
|
@@ -21,19 +22,18 @@
|
|
|
21
22
|
"sideEffects": false,
|
|
22
23
|
"exports": {
|
|
23
24
|
".": {
|
|
24
|
-
"types": "./dist/index.d.
|
|
25
|
-
"
|
|
26
|
-
"require": "./dist/index.cjs"
|
|
25
|
+
"types": "./dist/index.d.mts",
|
|
26
|
+
"default": "./dist/index.mjs"
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
|
-
"main": "./dist/index.
|
|
29
|
+
"main": "./dist/index.mjs",
|
|
30
30
|
"module": "./dist/index.mjs",
|
|
31
31
|
"types": "./dist/index.d.ts",
|
|
32
32
|
"files": [
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@unocss/core": "0.
|
|
36
|
+
"@unocss/core": "0.59.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "unbuild",
|
package/dist/index.cjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const core = require('@unocss/core');
|
|
6
|
-
|
|
7
|
-
const remRE = /(-?[\.\d]+)rem/g;
|
|
8
|
-
const presetRemToPx = core.definePreset((options = {}) => {
|
|
9
|
-
const {
|
|
10
|
-
baseFontSize = 16
|
|
11
|
-
} = options;
|
|
12
|
-
return {
|
|
13
|
-
name: "@unocss/preset-rem-to-px",
|
|
14
|
-
postprocess: (util) => {
|
|
15
|
-
util.entries.forEach((i) => {
|
|
16
|
-
const value = i[1];
|
|
17
|
-
if (typeof value === "string" && remRE.test(value))
|
|
18
|
-
i[1] = value.replace(remRE, (_, p1) => `${p1 * baseFontSize}px`);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
exports.default = presetRemToPx;
|
|
25
|
-
exports.presetRemToPx = presetRemToPx;
|
package/dist/index.d.cts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as _unocss_core from '@unocss/core';
|
|
2
|
-
|
|
3
|
-
interface RemToPxOptions {
|
|
4
|
-
/**
|
|
5
|
-
* 1rem = n px
|
|
6
|
-
* @default 16
|
|
7
|
-
*/
|
|
8
|
-
baseFontSize?: number;
|
|
9
|
-
}
|
|
10
|
-
declare const presetRemToPx: _unocss_core.PresetFactory<object, RemToPxOptions>;
|
|
11
|
-
|
|
12
|
-
export { type RemToPxOptions, presetRemToPx as default, presetRemToPx };
|