From eef5e25a00a3deff4c5c69c05bfd423ca53cdc49 Mon Sep 17 00:00:00 2001 From: Gabe Date: Thu, 25 Sep 2025 01:02:38 +0800 Subject: [PATCH] fix: text styles --- src/config/rules.js | 8 ++++---- src/libs/style.js | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/config/rules.js b/src/config/rules.js index a499a26..1f058f0 100644 --- a/src/config/rules.js +++ b/src/config/rules.js @@ -57,7 +57,7 @@ export const OPT_TIMING_ALL = [ OPT_TIMING_ALT, ]; -const DEFAULT_DIY_STYLE = `color: #666; +const DEFAULT_DIY_STYLE = `color: #333; background: linear-gradient( 45deg, LightGreen 20%, @@ -67,7 +67,7 @@ background: linear-gradient( LightSkyBlue 80% ); &:hover { - color: #333; + color: #111; };`; export const DEFAULT_SELECTOR = @@ -86,7 +86,7 @@ export const DEFAULT_RULE = { textStyle: GLOBAL_KEY, // 译文样式 transOpen: GLOBAL_KEY, // 开启翻译 bgColor: "", // 译文颜色 - textDiyStyle: DEFAULT_DIY_STYLE, // 自定义译文样式 + textDiyStyle: "", // 自定义译文样式 selectStyle: "", // 选择器节点样式 parentStyle: "", // 选择器父节点样式 injectJs: "", // 注入JS @@ -122,7 +122,7 @@ export const GLOBLA_RULE = { textStyle: OPT_STYLE_NONE, // 译文样式 transOpen: "false", // 开启翻译 bgColor: "", // 译文颜色 - textDiyStyle: "", // 自定义译文样式 + textDiyStyle: DEFAULT_DIY_STYLE, // 自定义译文样式 selectStyle: DEFAULT_SELECT_STYLE, // 选择器节点样式 parentStyle: DEFAULT_SELECT_STYLE, // 选择器父节点样式 injectJs: "", // 注入JS diff --git a/src/libs/style.js b/src/libs/style.js index c5d9e92..a5869b5 100644 --- a/src/libs/style.js +++ b/src/libs/style.js @@ -14,8 +14,8 @@ import { } from "../config"; const genLineStyle = (style, color) => ` - opacity: 0.6; - -webkit-opacity: 0.6; + opacity: 0.8; + -webkit-opacity: 0.8; text-decoration-line: underline; text-decoration-style: ${style}; text-decoration-color: ${color}; @@ -45,7 +45,6 @@ const genStyles = ({ textDiyStyle, bgColor = DEFAULT_COLOR }) => ({ [OPT_STYLE_WAVYLINE]: genLineStyle("wavy", bgColor), // 虚线框 [OPT_STYLE_DASHBOX]: ` - color: ${bgColor || DEFAULT_COLOR}; border: 1px dashed ${bgColor || DEFAULT_COLOR}; background: transparent; display: block; @@ -68,11 +67,12 @@ const genStyles = ({ textDiyStyle, bgColor = DEFAULT_COLOR }) => ({ `, // 引用 [OPT_STYLE_BLOCKQUOTE]: ` - opacity: 0.6; - -webkit-opacity: 0.6; + opacity: 0.8; + -webkit-opacity: 0.8; display: block; - padding: 0 0.75em; - border-left: 0.25em solid ${bgColor || DEFAULT_COLOR}; + padding: 0.25em 0.75em; + border-left: 0.5em solid ${bgColor || DEFAULT_COLOR}; + background: rgb(32, 156, 238, 0.2); &:hover { opacity: 1; -webkit-opacity: 1;