From 080d1347439e62a3ea522c5c1a56b84ccba55c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=8C=E5=A0=86=E5=B0=8F=E9=80=8F=E6=98=8E?= Date: Mon, 11 Aug 2025 14:40:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=81=E8=AE=B8=E4=BB=85=E9=80=9A?= =?UTF-8?q?=E8=BF=87b-[pos]-[size]=E6=9D=A5=E5=90=91=E5=85=83=E7=B4=A0?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BE=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/style/index.scss | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/style/index.scss b/src/style/index.scss index e1d33c5..1c98204 100644 --- a/src/style/index.scss +++ b/src/style/index.scss @@ -17,3 +17,18 @@ page { // 修改按钮背景色 // --wot-button-primary-bg-color: green; } + +/* +由于uniapp中无法使用*选择器,使用魔法代替*,加上此规则可以简化border与divide的使用,并提升布局的兼容性 +1. 防止padding和border影响元素宽度。 (https://github.com/mozdevs/cssremedy/issues/4) +2. 允许仅通过添加边框宽度来向元素添加边框。 (https://github.com/tailwindcss/tailwindcss/pull/116) +3. [UnoCSS]: 允许使用css变量'--un-default-border-color'覆盖默认边框颜色 +*/ +:not(not), +::before, +::after { + box-sizing: border-box; /* 1 */ + border-width: 0; /* 2 */ + border-style: solid; /* 2 */ + border-color: var(--un-default-border-color, #e5e7eb); /* 3 */ +}