Skip to content

Commit e8870e2

Browse files
committed
1 parent 1ca33a5 commit e8870e2

3 files changed

Lines changed: 31 additions & 0 deletions

File tree

website/docusaurus.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export type EditUrlButton = {
3030
};
3131

3232
const commonDocsOptions: PluginContentDocs.Options = {
33+
admonitions: {keywords: ['important'], extendDefaults: true},
3334
breadcrumbs: false,
3435
showLastUpdateAuthor: false,
3536
showLastUpdateTime: true,

website/src/css/customTheme.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,13 @@ html[data-theme="dark"] article .badge {
664664
--ifm-alert-background-color-highlight: rgba(225, 227, 230, 0.7);
665665
}
666666

667+
.alert--important {
668+
--ifm-alert-background-color: #8250df2a;
669+
--ifm-alert-background-color-highlight: #e0cfff;
670+
--ifm-alert-foreground-color: #281846;
671+
--ifm-alert-border-color: #e0cfff;
672+
}
673+
667674
html[data-theme="dark"] {
668675
span[class^="admonitionIcon"] svg {
669676
fill: hsl(from var(--ifm-alert-border-color) h calc(s + 10) calc(l + 10));
@@ -679,6 +686,11 @@ html[data-theme="dark"] {
679686
);
680687
--ifm-alert-background-color-highlight: rgba(225, 227, 230, 0.15);
681688
}
689+
.alert--important {
690+
--ifm-alert-background-color-highlight: #442f6b;
691+
--ifm-alert-foreground-color: #c0b1dc;
692+
--ifm-alert-border-color: #8250df;
693+
}
682694
}
683695

684696
/* Home page */
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React from 'react';
2+
import clsx from 'clsx';
3+
import DefaultAdmonitionTypes from '@theme-original/Admonition/Types';
4+
5+
const {info: Info} = DefaultAdmonitionTypes;
6+
7+
function MyCustomAdmonition(props) {
8+
return (
9+
<Info className={clsx(props.className, 'alert--important')} {...props} />
10+
);
11+
}
12+
13+
const AdmonitionTypes = {
14+
...DefaultAdmonitionTypes,
15+
important: MyCustomAdmonition,
16+
};
17+
18+
export default AdmonitionTypes;

0 commit comments

Comments
 (0)