feat: add default styles example

This commit is contained in:
Gabe
2025-10-11 12:01:36 +08:00
parent 96dfee90ab
commit 359206630d
3 changed files with 41 additions and 4 deletions

View File

@@ -33,10 +33,10 @@ const genLineStyle = (style, color) => `
}
`;
export const genStyles = ({
const genStyles = ({
textDiyStyle = DEFAULT_DIY_STYLE,
bgColor = DEFAULT_COLOR,
}) => ({
} = {}) => ({
// 无样式
[OPT_STYLE_NONE]: ``,
// 下划线
@@ -82,7 +82,9 @@ export const genStyles = ({
}
`,
// 自定义
[OPT_STYLE_DIY]: textDiyStyle,
[OPT_STYLE_DIY]: `
${textDiyStyle}
`,
});
export const genTextClass = ({ textDiyStyle, bgColor = DEFAULT_COLOR }) => {
@@ -103,3 +105,5 @@ export const genTextClass = ({ textDiyStyle, bgColor = DEFAULT_COLOR }) => {
});
return [textClass, textStyles];
};
export const defaultStyles = genStyles();