Skip to content

Commit

Permalink
fix: update to new obsidian customCss definition
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Apr 12, 2023
1 parent c291e59 commit 518b3d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/callout/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@ export default class CalloutManager extends Component {
addAdmonition(admonition: Admonition) {
if (!admonition.icon) return;
let rule: string;
const color = admonition.injectColor ?? this.plugin.data.injectColor ? `--callout-color: ${admonition.color};` : '';
const color =
admonition.injectColor ?? this.plugin.data.injectColor
? `--callout-color: ${admonition.color};`
: "";
if (admonition.icon.type == "obsidian") {
rule = `.callout[data-callout="${admonition.type}"] {
${color}
Expand Down Expand Up @@ -270,6 +273,6 @@ export default class CalloutManager extends Component {
this.plugin.data.snippetPath,
true
);
this.plugin.app.customCss.readCssFolders();
this.plugin.app.customCss.readSnippets();
}
}
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ declare module "obsidian" {
};
customCss: {
getSnippetPath(file: string): string;
readCssFolders(): void;
readSnippets(): void;
setCssEnabledStatus(snippet: string, enabled: boolean): void;
};
plugins: {
Expand Down

0 comments on commit 518b3d3

Please sign in to comment.