Skip to content

Commit

Permalink
chore: prep
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Nov 15, 2023
1 parent 55ac3c9 commit ac100a0
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions mknodes/basenodes/mkcompactadmonition/metadata.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,67 @@ name = "MkCompactAdmonition"

[[resources.css]]
filename = "compactadmonition.css"
content = """
{% set admon = file.admonitions[node.typ] %}
:root {
--md-badge-fg--{{ node.typ }}: {{ admon.header_color }};
--md-badge-bg--{{ node.typ }}: {{ admon.header_color }}1a;
--badge-icon--{{ node.typ }}: {{ admon.icon | get_icon_svg | svg_to_data_uri }};
}
.mdx-grid-wrapper {
display: grid;
grid-template-columns: .5fr 9fr;
gap: 1rem;
border: .075rem solid #448aff;
border-radius: .2rem;
}
.mdx-grid-child {
align-self: center;
font-size: .64rem;
}
.mdx-grid-child.mdx-grid-child--icon {
background-color: "#448aff1a";
}
.mdx-grid-child.mdx-grid-child--icon::before {
content: "";
background-color: "#448aff";
mask-position: center;
mask-repeat: no-repeat;
mask-size: contain;
height: 1rem;
width: 1rem;
margin: .4rem;
display: block;
-webkit-mask-image: var(--badge-icon--note);
mask-image: var(--badge-icon--note);
}
.mdx-admo--{{ node.typ }} {
border-color: var(--md-badge-fg--{{ node.typ }});
}
.mdx-admo--{{ node.typ }} .mdx-grid-child--icon {
background-color: var(--md-badge-bg--{{ node.typ }});
}
.mdx-admo--{{ node.typ }} .mdx-grid-child--icon::before {
background-color: var(--md-badge-fg--{{ node.typ }});
-webkit-mask-image: var(--badge-icon--{{ node.typ }});
mask-image: var(--badge-icon--{{ node.typ }});
}
"""

[examples.types]
title = "Types"
Expand All @@ -22,3 +82,17 @@ template = """
<div class="mdx-grid-child">{{ node.text }}</div>
</div>
"""

[admonitions]
note = {icon="mdi:pencil-circle", header_color="#448aff"}
abstract = {icon="mdi:clipboard-text", header_color="#00b0ff"}
info = {icon="mdi:information", header_color="#00b8d4"}
tip = {icon="mdi:fire", header_color="#00bfa5"}
success = {icon="mdi:check", header_color="#00c853"}
question = {icon="mdi:help-circle", header_color="#64dd17"}
warning = {icon="mdi:alert", header_color="#ff9100"}
failure = {icon="mdi:close", header_color="#ff5252"}
danger = {icon="mdi:lightning-bolt-circle", header_color="#ff1744"}
bug = {icon="mdi:shield-bug", header_color="#f50057"}
example = {icon="mdi:test-tube", header_color="#7c4dff"}
quote = {icon="mdi:format-quote-close", header_color="#9e9e9e"}

0 comments on commit ac100a0

Please sign in to comment.