fix: text styles

This commit is contained in:
Gabe
2025-09-25 01:02:38 +08:00
parent 261f29c185
commit eef5e25a00
2 changed files with 11 additions and 11 deletions

View File

@@ -57,7 +57,7 @@ export const OPT_TIMING_ALL = [
OPT_TIMING_ALT, OPT_TIMING_ALT,
]; ];
const DEFAULT_DIY_STYLE = `color: #666; const DEFAULT_DIY_STYLE = `color: #333;
background: linear-gradient( background: linear-gradient(
45deg, 45deg,
LightGreen 20%, LightGreen 20%,
@@ -67,7 +67,7 @@ background: linear-gradient(
LightSkyBlue 80% LightSkyBlue 80%
); );
&:hover { &:hover {
color: #333; color: #111;
};`; };`;
export const DEFAULT_SELECTOR = export const DEFAULT_SELECTOR =
@@ -86,7 +86,7 @@ export const DEFAULT_RULE = {
textStyle: GLOBAL_KEY, // 译文样式 textStyle: GLOBAL_KEY, // 译文样式
transOpen: GLOBAL_KEY, // 开启翻译 transOpen: GLOBAL_KEY, // 开启翻译
bgColor: "", // 译文颜色 bgColor: "", // 译文颜色
textDiyStyle: DEFAULT_DIY_STYLE, // 自定义译文样式 textDiyStyle: "", // 自定义译文样式
selectStyle: "", // 选择器节点样式 selectStyle: "", // 选择器节点样式
parentStyle: "", // 选择器父节点样式 parentStyle: "", // 选择器父节点样式
injectJs: "", // 注入JS injectJs: "", // 注入JS
@@ -122,7 +122,7 @@ export const GLOBLA_RULE = {
textStyle: OPT_STYLE_NONE, // 译文样式 textStyle: OPT_STYLE_NONE, // 译文样式
transOpen: "false", // 开启翻译 transOpen: "false", // 开启翻译
bgColor: "", // 译文颜色 bgColor: "", // 译文颜色
textDiyStyle: "", // 自定义译文样式 textDiyStyle: DEFAULT_DIY_STYLE, // 自定义译文样式
selectStyle: DEFAULT_SELECT_STYLE, // 选择器节点样式 selectStyle: DEFAULT_SELECT_STYLE, // 选择器节点样式
parentStyle: DEFAULT_SELECT_STYLE, // 选择器父节点样式 parentStyle: DEFAULT_SELECT_STYLE, // 选择器父节点样式
injectJs: "", // 注入JS injectJs: "", // 注入JS

View File

@@ -14,8 +14,8 @@ import {
} from "../config"; } from "../config";
const genLineStyle = (style, color) => ` const genLineStyle = (style, color) => `
opacity: 0.6; opacity: 0.8;
-webkit-opacity: 0.6; -webkit-opacity: 0.8;
text-decoration-line: underline; text-decoration-line: underline;
text-decoration-style: ${style}; text-decoration-style: ${style};
text-decoration-color: ${color}; text-decoration-color: ${color};
@@ -45,7 +45,6 @@ const genStyles = ({ textDiyStyle, bgColor = DEFAULT_COLOR }) => ({
[OPT_STYLE_WAVYLINE]: genLineStyle("wavy", bgColor), [OPT_STYLE_WAVYLINE]: genLineStyle("wavy", bgColor),
// 虚线框 // 虚线框
[OPT_STYLE_DASHBOX]: ` [OPT_STYLE_DASHBOX]: `
color: ${bgColor || DEFAULT_COLOR};
border: 1px dashed ${bgColor || DEFAULT_COLOR}; border: 1px dashed ${bgColor || DEFAULT_COLOR};
background: transparent; background: transparent;
display: block; display: block;
@@ -68,11 +67,12 @@ const genStyles = ({ textDiyStyle, bgColor = DEFAULT_COLOR }) => ({
`, `,
// 引用 // 引用
[OPT_STYLE_BLOCKQUOTE]: ` [OPT_STYLE_BLOCKQUOTE]: `
opacity: 0.6; opacity: 0.8;
-webkit-opacity: 0.6; -webkit-opacity: 0.8;
display: block; display: block;
padding: 0 0.75em; padding: 0.25em 0.75em;
border-left: 0.25em solid ${bgColor || DEFAULT_COLOR}; border-left: 0.5em solid ${bgColor || DEFAULT_COLOR};
background: rgb(32, 156, 238, 0.2);
&:hover { &:hover {
opacity: 1; opacity: 1;
-webkit-opacity: 1; -webkit-opacity: 1;