((props
if (skipHtml) {
rehypePlugins.push(raw);
}
- const remarkPlugins = [...(other.remarkPlugins || []), gfm];
+ const remarkPlugins = [remarkAlert, ...(other.remarkPlugins || []), gfm];
const wrapperProps = { ...warpperElement, ...wrapperElement };
return (
diff --git a/core/src/rehypePlugins.tsx b/core/src/rehypePlugins.tsx
index 0f631d5a..680ce6aa 100644
--- a/core/src/rehypePlugins.tsx
+++ b/core/src/rehypePlugins.tsx
@@ -1,11 +1,11 @@
-import { PluggableList } from 'unified';
+import type { PluggableList } from 'unified';
import slug from 'rehype-slug';
import headings from 'rehype-autolink-headings';
import rehypeIgnore from 'rehype-ignore';
-import { getCodeString, RehypeRewriteOptions } from 'rehype-rewrite';
+import { getCodeString, type RehypeRewriteOptions } from 'rehype-rewrite';
+import type { Root, Element, RootContent } from 'hast';
import { octiconLink } from './nodes/octiconLink';
import { copyElement } from './nodes/copy';
-import { Root, Element, RootContent } from 'hast';
export const rehypeRewriteHandle =
(disableCopy: boolean, rewrite?: RehypeRewriteOptions['rewrite']) =>
diff --git a/core/src/styles/markdown.less b/core/src/styles/markdown.less
index 3d3fd0dc..cf111f35 100644
--- a/core/src/styles/markdown.less
+++ b/core/src/styles/markdown.less
@@ -44,6 +44,13 @@
--color-accent-emphasis: #1f6feb;
--color-attention-subtle: rgba(187, 128, 9, 0.15);
--color-danger-fg: #f85149;
+ --color-danger-emphasis: #da3633;
+ --color-attention-fg: #d29922;
+ --color-attention-emphasis: #9e6a03;
+ --color-done-fg: #a371f7;
+ --color-done-emphasis: #8957e5;
+ --color-success-fg: #3fb950;
+ --color-success-emphasis: #238636;
--color-copied-active-bg: #2e9b33;
}
}
@@ -93,7 +100,14 @@
--color-accent-fg: #0969da;
--color-accent-emphasis: #0969da;
--color-attention-subtle: #fff8c5;
- --color-danger-fg: #cf222e;
+ --color-danger-fg: #d1242f;
+ --color-danger-emphasis: #cf222e;
+ --color-attention-fg: #9a6700;
+ --color-attention-emphasis: #9a6700;
+ --color-done-fg: #8250df;
+ --color-done-emphasis: #8250df;
+ --color-success-fg: #1a7f37;
+ --color-success-emphasis: #1f883d;
--color-copied-active-bg: #2e9b33;
}
}
@@ -1053,6 +1067,59 @@ body[data-color-mode*='light'] {
}
}
+.wmde-markdown {
+ .markdown-alert {
+ padding: 0.5rem 1em;
+ color: inherit;
+ margin-bottom: 16px;
+ border-left: 0.25em solid var(--borderColor-default, var(--color-border-default));
+ > :last-child {
+ margin-bottom: 0 !important;
+ }
+ .markdown-alert-title {
+ display: flex;
+ align-items: center;
+ line-height: 1;
+ font-weight: 600;
+ font-family: initial;
+ font-size: 14px;
+ svg.octicon {
+ margin-right: var(--base-size-8, 8px) !important;
+ }
+ }
+ &.markdown-alert-note {
+ border-left-color: var(--borderColor-accent-emphasis, var(--color-accent-emphasis));
+ .markdown-alert-title {
+ color: var(--fgColor-accent, var(--color-accent-fg));
+ }
+ }
+ &.markdown-alert-tip {
+ border-left-color: var(--borderColor-success-emphasis, var(--color-success-emphasis));
+ .markdown-alert-title {
+ color: var(--fgColor-success, var(--color-success-fg));
+ }
+ }
+ &.markdown-alert-important {
+ border-left-color: var(--borderColor-done-emphasis, var(--color-done-emphasis));
+ .markdown-alert-title {
+ color: var(--fgColor-done, var(--color-done-fg));
+ }
+ }
+ &.markdown-alert-warning {
+ border-left-color: var(--borderColor-attention-emphasis, var(--color-attention-emphasis));
+ .markdown-alert-title {
+ color: var(--fgColor-attention, var(--color-attention-fg));
+ }
+ }
+ &.markdown-alert-caution {
+ border-left-color: var(--borderColor-danger-emphasis, var(--color-danger-emphasis));
+ .markdown-alert-title {
+ color: var(--fgColor-danger, var(--color-danger-fg));
+ }
+ }
+ }
+}
+
.wmde-markdown {
.highlight-line {
background-color: var(--color-neutral-muted);
diff --git a/lerna.json b/lerna.json
index 7632bad7..2159daaf 100644
--- a/lerna.json
+++ b/lerna.json
@@ -1,4 +1,4 @@
{
- "version": "5.0.10",
+ "version": "5.1.0",
"packages": ["core", "website"]
}