mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-30 15:15:24 +00:00
fix: keep rounded-full circular in production builds
This commit is contained in:
1 parent
2770f14a25
commit
26d52c7631
1 file changed
+17
-4
+17
-4
@@ -7,9 +7,22 @@
|
|||||||
* queries (breakpoints follow the window, not the text size), the root size
|
* queries (breakpoints follow the window, not the text size), the root size
|
||||||
* rules themselves, and third-party CSS such as xterm's, which measures in px.
|
* rules themselves, and third-party CSS such as xterm's, which measures in px.
|
||||||
*/
|
*/
|
||||||
|
const pxtorem = require("postcss-pxtorem");
|
||||||
|
|
||||||
|
// Production builds minify rounded-full to 3.40282e38px, and pxtorem reads
|
||||||
|
// the "38px" tail as its own length, leaving an oval radius behind.
|
||||||
|
const EXPONENT_PX = /\d*\.?\d+e[+-]?\d+px\b/gi;
|
||||||
|
const keepExponentPx = {
|
||||||
|
postcssPlugin: "termix-keep-exponent-px",
|
||||||
|
Declaration(decl) {
|
||||||
|
decl.value = decl.value.replace(EXPONENT_PX, "calc(infinity * 1px)");
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
plugins: {
|
plugins: [
|
||||||
"postcss-pxtorem": {
|
keepExponentPx,
|
||||||
|
pxtorem({
|
||||||
rootValue: 14,
|
rootValue: 14,
|
||||||
unitPrecision: 5,
|
unitPrecision: 5,
|
||||||
propList: ["*"],
|
propList: ["*"],
|
||||||
@@ -18,6 +31,6 @@ module.exports = {
|
|||||||
mediaQuery: false,
|
mediaQuery: false,
|
||||||
minPixelValue: 2,
|
minPixelValue: 2,
|
||||||
exclude: /node_modules/i,
|
exclude: /node_modules/i,
|
||||||
},
|
}),
|
||||||
},
|
],
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user