Skip to content

Commit

Permalink
fix: typo in variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
YangFong committed Aug 18, 2024
1 parent 0ff7a1e commit 3266d07
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ export function addPrefix(str) {
return `${prefix}__${str}`
}

function createCustomTheme(theme, color, isDefalut = true) {
function createCustomTheme(theme, color, isDefault = true) {
const customTheme = JSON.parse(JSON.stringify(theme))
customTheme.block.h1[`border-bottom`] = `2px solid ${color}`
customTheme.block.h2.background = color
customTheme.block.h3[`border-left`] = `3px solid ${color}`
customTheme.block.h4.color = color
customTheme.inline.strong.color = color

if (!isDefalut) {
if (!isDefault) {
customTheme.block.h3[`border-bottom`] = `1px dashed ${color}`
customTheme.block.blockquote[`border-left`] = `4px solid ${color}`
}
Expand All @@ -32,15 +32,15 @@ export function setColorWithTemplate(theme) {
}
}

export function setColorWithCustomTemplate(theme, color, isDefalut = true) {
return createCustomTheme(theme, color, isDefalut)
export function setColorWithCustomTemplate(theme, color, isDefault = true) {
return createCustomTheme(theme, color, isDefault)
}

// 设置自定义字体大小
export function setFontSizeWithTemplate(template) {
return function (fontSize, isDefalut = true) {
return function (fontSize, isDefault = true) {
const customTheme = JSON.parse(JSON.stringify(template))
if (isDefalut) {
if (isDefault) {
customTheme.block.h1[`font-size`] = `${fontSize * 1.2}px`
customTheme.block.h2[`font-size`] = `${fontSize * 1.2}px`
customTheme.block.h3[`font-size`] = `${fontSize * 1.1}px`
Expand All @@ -57,8 +57,8 @@ export function setFontSizeWithTemplate(template) {
}
}

export function setTheme(theme, fontSize, color, isDefalut) {
return setColorWithCustomTemplate(setFontSizeWithTemplate(theme)(fontSize, isDefalut), color, isDefalut)
export function setTheme(theme, fontSize, color, isDefault) {
return setColorWithCustomTemplate(setFontSizeWithTemplate(theme)(fontSize, isDefault), color, isDefault)
}

export function customCssWithTemplate(jsonString, color, theme) {
Expand Down

0 comments on commit 3266d07

Please sign in to comment.