mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 05:14:06 -06:00
Fix code style
This commit is contained in:
parent
02b8c1db95
commit
da13359e5a
@ -99,7 +99,7 @@ const REGEXP = /\[!!([^\]]+)\]/gm
|
||||
const CODEREGEX = /`([^`\n]+)`/g
|
||||
|
||||
export interface Options {
|
||||
customBadges: Array<[string, string, [number, number, number, number], number]>, // Write in format [ [icon,name,[RED,GREEN,BLUE,ALPHA],TEXT_ALPHA], [icon,name,[RED,GREEN,BLUE,ALPHA],TEXT_ALPHA] ]
|
||||
customBadges: Array<[string, string, [number, number, number, number], number]> // Write in format [ [icon,name,[RED,GREEN,BLUE,ALPHA],TEXT_ALPHA], [icon,name,[RED,GREEN,BLUE,ALPHA],TEXT_ALPHA] ]
|
||||
useObsidianCSS: boolean
|
||||
}
|
||||
|
||||
@ -115,8 +115,8 @@ export const InlineBadges: QuartzTransformerPlugin<Partial<Options>> = (userOpts
|
||||
name: "InlineBadges",
|
||||
textTransform(_ctx, src) {
|
||||
// Append custom badges.
|
||||
for (let badge of opts.customBadges){
|
||||
allBadges.push([badge[1],badge[1],badge[0]]) // Pushes it to the array in the format [icon,icon,name].
|
||||
for (let badge of opts.customBadges) {
|
||||
allBadges.push([badge[1], badge[1], badge[0]]) // Pushes it to the array in the format [icon,icon,name].
|
||||
}
|
||||
|
||||
var srcReplacement: string = src //Start by assuming there are no badges.
|
||||
@ -142,25 +142,25 @@ export const InlineBadges: QuartzTransformerPlugin<Partial<Options>> = (userOpts
|
||||
inline: true,
|
||||
})
|
||||
// Sets the colour of custom badges.
|
||||
for (let badgeDef of opts.customBadges){
|
||||
let badgeColor: string = `${badgeDef[2][0]},${badgeDef[2][1]},${badgeDef[2][2]}`
|
||||
let textColor: string = `rgba(var(--badge-color),${badgeDef[3]})`
|
||||
let badgeName: string = badgeDef[1] // Removes the "" from the name.
|
||||
for (let badgeDef of opts.customBadges) {
|
||||
let badgeColor: string = `${badgeDef[2][0]},${badgeDef[2][1]},${badgeDef[2][2]}`
|
||||
let textColor: string = `rgba(var(--badge-color),${badgeDef[3]})`
|
||||
let badgeName: string = badgeDef[1] // Removes the "" from the name.
|
||||
css.push({
|
||||
content: `.inline-badge[data-inline-badge=${badgeName}] {
|
||||
content: `.inline-badge[data-inline-badge=${badgeName}] {
|
||||
--badge-color: ${badgeColor};
|
||||
color: rgba(var(--badge-color), ${badgeDef[2][3]});
|
||||
background-color: ${textColor};
|
||||
}`,
|
||||
inline: true,
|
||||
})
|
||||
|
||||
if (opts.useObsidianCSS){
|
||||
css.push({
|
||||
content: obsidianOptionalCSS,
|
||||
inline: true
|
||||
inline: true,
|
||||
})
|
||||
}
|
||||
|
||||
if (opts.useObsidianCSS) {
|
||||
css.push({
|
||||
content: obsidianOptionalCSS,
|
||||
inline: true,
|
||||
})
|
||||
}
|
||||
}
|
||||
return { js, css }
|
||||
},
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
// This CSS is required to render badges properly.
|
||||
// WinnerWind.
|
||||
:root{
|
||||
body{
|
||||
--radius-l: 12px;
|
||||
--radius-m: 8px;
|
||||
--radius-s: 4px;
|
||||
a.external .external-icon {
|
||||
height:0px;
|
||||
margin:0em;
|
||||
display:none;
|
||||
}
|
||||
:root {
|
||||
body {
|
||||
--radius-l: 12px;
|
||||
--radius-m: 8px;
|
||||
--radius-s: 4px;
|
||||
a.external .external-icon {
|
||||
height: 0px;
|
||||
margin: 0em;
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
:root[saved-theme="dark"] {
|
||||
--chalk-grey: #dddddd;
|
||||
@ -58,9 +58,11 @@
|
||||
--interactive-accent: var(--color-accent);
|
||||
--interactive-accent-hover: var(--color-accent-1);
|
||||
--mono-rgb-100: 255, 255, 255;
|
||||
--shadow-l: 0px 1.8px 7.3px rgba(0, 0, 0, 0.071), 0px 6.3px 24.7px rgba(0, 0, 0, 0.112),
|
||||
--shadow-l:
|
||||
0px 1.8px 7.3px rgba(0, 0, 0, 0.071), 0px 6.3px 24.7px rgba(0, 0, 0, 0.112),
|
||||
0px 30px 90px rgba(0, 0, 0, 0.2);
|
||||
--shadow-s: 0px 1px 2px rgba(0, 0, 0, 0.121), 0px 3.4px 6.7px rgba(0, 0, 0, 0.179),
|
||||
--shadow-s:
|
||||
0px 1px 2px rgba(0, 0, 0, 0.121), 0px 3.4px 6.7px rgba(0, 0, 0, 0.179),
|
||||
0px 15px 30px rgba(0, 0, 0, 0.3);
|
||||
--text-accent: var(--color-accent-1);
|
||||
color-scheme: dark;
|
||||
@ -114,9 +116,11 @@
|
||||
--h5-color: var(--chalk-grey);
|
||||
--h6-color: var(--chalk-grey);
|
||||
--mono-rgb-100: 0, 0, 0;
|
||||
--shadow-l: 0px 1.8px 7.3px rgba(0, 0, 0, 0.071), 0px 6.3px 24.7px rgba(0, 0, 0, 0.112),
|
||||
--shadow-l:
|
||||
0px 1.8px 7.3px rgba(0, 0, 0, 0.071), 0px 6.3px 24.7px rgba(0, 0, 0, 0.112),
|
||||
0px 30px 90px rgba(0, 0, 0, 0.2);
|
||||
--shadow-s: 0px 1px 2px rgba(0, 0, 0, 0.028), 0px 3.4px 6.7px rgba(0, 0, 0, 0.042),
|
||||
--shadow-s:
|
||||
0px 1px 2px rgba(0, 0, 0, 0.028), 0px 3.4px 6.7px rgba(0, 0, 0, 0.042),
|
||||
0px 15px 30px rgba(0, 0, 0, 0.07);
|
||||
color-scheme: light;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user