From 1cff43268bf31590850aaa142597f15b61d2feb9 Mon Sep 17 00:00:00 2001 From: dos1in Date: Fri, 13 Mar 2026 17:53:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=20text-decoration?= =?UTF-8?q?-style=20=E6=94=AF=E6=8C=81=E6=83=85=E5=86=B5=20for=20Android?= =?UTF-8?q?=20and=20Harmony?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/platform/style/wx/index.js | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/webpack-plugin/lib/platform/style/wx/index.js b/packages/webpack-plugin/lib/platform/style/wx/index.js index 4dbbc9224e..06ab6f9b11 100644 --- a/packages/webpack-plugin/lib/platform/style/wx/index.js +++ b/packages/webpack-plugin/lib/platform/style/wx/index.js @@ -8,9 +8,9 @@ module.exports = function getSpec({ warn, error }) { // React Native ios 不支持的 CSS property ios: /^(vertical-align)$/, // React Native android 不支持的 CSS property - android: /^(text-decoration-style|text-decoration-color|shadow-offset|shadow-opacity|shadow-radius)$/, + android: /^(text-decoration-color|shadow-offset|shadow-opacity|shadow-radius)$/, // TODO: rnoh 文档暂未找到 css 属性支持说明,暂时同步 android,同时需要注意此处校验是否有缺失,类似 will-change 之类属性 - harmony: /^(text-decoration-style|text-decoration-color|shadow-offset|shadow-opacity|shadow-radius)$/ + harmony: /^(text-decoration-color|shadow-offset|shadow-opacity|shadow-radius)$/ } // var(xx) const cssVariableExp = /var\(/ @@ -596,6 +596,16 @@ module.exports = function getSpec({ warn, error }) { } } + // Android/Harmony 平台的 text-decoration-style 只支持 solid + const formatTextDecorationStyle = ({ prop, value, selector }, { mode }) => { + value = value.trim() + if ((mode === 'android' || mode === 'harmony') && value !== 'solid' && !cssVariableExp.test(value)) { + warn(`Property [text-decoration-style] on ${selector} only supports value "solid" in ${mode} environment, received [${value}], will use "solid" instead!`) + return { prop, value: 'solid' } + } + return verifyValues({ prop, value, selector }) && { prop, value } + } + return { supportedModes: ['ios', 'android', 'harmony'], rules: [ @@ -647,6 +657,12 @@ module.exports = function getSpec({ warn, error }) { android: formatBorder, harmony: formatBorder }, + { + test: 'text-decoration-style', + ios: formatTextDecorationStyle, + android: formatTextDecorationStyle, + harmony: formatTextDecorationStyle + }, // 通用的简写格式匹配 { test: new RegExp('^(' + Object.keys(AbbreviationMap).join('|') + ')$'), From 8c8db7582825811696eb93b7000e53e614785165 Mon Sep 17 00:00:00 2001 From: dos1in Date: Tue, 17 Mar 2026 14:16:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(rn):=20=E6=B7=BB=E5=8A=A0=20harmony=20?= =?UTF-8?q?=E4=B8=8D=E6=94=AF=E6=8C=81=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/webpack-plugin/lib/platform/style/wx/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/webpack-plugin/lib/platform/style/wx/index.js b/packages/webpack-plugin/lib/platform/style/wx/index.js index 06ab6f9b11..90945c244c 100644 --- a/packages/webpack-plugin/lib/platform/style/wx/index.js +++ b/packages/webpack-plugin/lib/platform/style/wx/index.js @@ -10,7 +10,7 @@ module.exports = function getSpec({ warn, error }) { // React Native android 不支持的 CSS property android: /^(text-decoration-color|shadow-offset|shadow-opacity|shadow-radius)$/, // TODO: rnoh 文档暂未找到 css 属性支持说明,暂时同步 android,同时需要注意此处校验是否有缺失,类似 will-change 之类属性 - harmony: /^(text-decoration-color|shadow-offset|shadow-opacity|shadow-radius)$/ + harmony: /^(text-decoration-color|shadow-offset|shadow-opacity|shadow-radius|box-shadow)$/ } // var(xx) const cssVariableExp = /var\(/