1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-12-21 03:45:57 +01:00
mkdocs-material/docs/reference/admonitions.md

506 lines
19 KiB
Markdown
Raw Normal View History

2020-07-20 17:40:48 +02:00
---
2021-12-16 17:08:57 +01:00
icon: material/alert-outline
2020-07-20 17:40:48 +02:00
---
# Admonitions
Admonitions, also known as _call-outs_, are an excellent choice for including
2020-07-20 19:28:13 +02:00
side content without significantly interrupting the document flow. Material for
MkDocs provides several different types of admonitions and allows for the
inclusion and nesting of arbitrary content.
2020-07-20 17:40:48 +02:00
## Configuration
2021-10-03 18:02:59 +02:00
This configuration enables admonitions, allows to make them collapsible and to
2021-10-04 23:36:31 +02:00
nest arbitrary content inside admonitions. Add the following lines to
2021-10-03 18:02:59 +02:00
`mkdocs.yml`:
2020-07-20 17:40:48 +02:00
``` yaml
markdown_extensions:
- admonition
- pymdownx.details
2021-10-03 15:32:50 +02:00
- pymdownx.superfences
2020-07-20 17:40:48 +02:00
```
2021-10-03 15:32:50 +02:00
See additional configuration options:
2020-07-20 17:40:48 +02:00
- [Admonition]
- [Details]
- [SuperFences]
2020-07-20 17:40:48 +02:00
2021-10-03 15:32:50 +02:00
[Admonition]: ../setup/extensions/python-markdown.md#admonition
[Details]: ../setup/extensions/python-markdown-extensions.md#details
[SuperFences]: ../setup/extensions/python-markdown-extensions.md#superfences
2020-07-20 17:40:48 +02:00
### Admonition icons
2023-09-14 19:09:18 +02:00
<!-- md:version 8.3.0 -->
Each of the supported admonition types has a distinct icon, which can be changed
2021-10-10 17:39:53 +02:00
to any icon bundled with the theme, or even a [custom icon]. Add the following
lines to `mkdocs.yml`:
2021-10-04 23:36:31 +02:00
``` yaml
theme:
icon:
admonition:
2021-12-11 14:30:07 +01:00
<type>: <icon> # (1)!
2021-10-04 23:36:31 +02:00
```
1. Enter a few keywords to find the perfect icon using our [icon search] and
click on the shortcode to copy it to your clipboard:
<div class="mdx-iconsearch" data-mdx-component="iconsearch">
<input class="md-input md-input--stretch mdx-iconsearch__input" placeholder="Search icon" data-mdx-component="iconsearch-query" value="alert" />
<div class="mdx-iconsearch-result" data-mdx-component="iconsearch-result" data-mdx-mode="file">
<div class="mdx-iconsearch-result__meta"></div>
<ol class="mdx-iconsearch-result__list"></ol>
</div>
</div>
2021-10-04 23:36:31 +02:00
??? example "Expand to show alternate icon sets"
2021-10-04 23:36:31 +02:00
=== ":octicons-mark-github-16: Octicons"
2022-04-24 22:43:22 +02:00
``` yaml
2021-10-04 23:36:31 +02:00
theme:
icon:
admonition:
note: octicons/tag-16
abstract: octicons/checklist-16
info: octicons/info-16
tip: octicons/squirrel-16
success: octicons/check-16
question: octicons/question-16
warning: octicons/alert-16
failure: octicons/x-circle-16
danger: octicons/zap-16
bug: octicons/bug-16
example: octicons/beaker-16
quote: octicons/quote-16
```
=== ":fontawesome-brands-font-awesome: FontAwesome"
2021-10-04 23:36:31 +02:00
2022-04-24 22:43:22 +02:00
``` yaml
2021-10-04 23:36:31 +02:00
theme:
icon:
admonition:
note: fontawesome/solid/note-sticky
2021-10-04 23:36:31 +02:00
abstract: fontawesome/solid/book
info: fontawesome/solid/circle-info
2021-10-04 23:36:31 +02:00
tip: fontawesome/solid/bullhorn
success: fontawesome/solid/check
question: fontawesome/solid/circle-question
warning: fontawesome/solid/triangle-exclamation
2021-10-04 23:36:31 +02:00
failure: fontawesome/solid/bomb
danger: fontawesome/solid/skull
bug: fontawesome/solid/robot
example: fontawesome/solid/flask
quote: fontawesome/solid/quote-left
```
2022-04-24 22:43:22 +02:00
[custom icon]: ../setup/changing-the-logo-and-icons.md#additional-icons
2021-10-04 23:36:31 +02:00
[supported types]: #supported-types
[icon search]: icons-emojis.md#search
2020-07-20 17:40:48 +02:00
## Usage
2021-10-03 15:32:50 +02:00
Admonitions follow a simple syntax: a block starts with `!!!`, followed by a
single keyword used as a [type qualifier]. The content of the block follows on
the next line, indented by four spaces:
2020-07-20 17:40:48 +02:00
``` markdown title="Admonition"
2020-07-20 17:40:48 +02:00
!!! note
2021-10-03 15:32:50 +02:00
2020-07-20 17:40:48 +02:00
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.
```
<div class="result" markdown>
2020-07-20 17:40:48 +02:00
!!! note
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.
</div>
2021-10-03 15:32:50 +02:00
[type qualifier]: #supported-types
2020-07-20 17:40:48 +02:00
### Changing the title
By default, the title will equal the type qualifier in titlecase. However, it
can be changed by adding a quoted string containing valid Markdown (including
links, formatting, ...) after the type qualifier:
2020-07-20 17:40:48 +02:00
``` markdown title="Admonition with custom title"
2020-07-20 17:40:48 +02:00
!!! note "Phasellus posuere in sem ut cursus"
2021-10-03 15:32:50 +02:00
2020-07-20 17:40:48 +02:00
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.
```
<div class="result" markdown>
2020-07-20 17:40:48 +02:00
!!! note "Phasellus posuere in sem ut cursus"
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.
</div>
2020-07-20 17:40:48 +02:00
### Removing the title
2021-10-03 15:32:50 +02:00
Similar to [changing the title], the icon and title can be omitted entirely by
adding an empty string directly after the type qualifier. Note that this will
not work for [collapsible blocks]:
2020-07-20 17:40:48 +02:00
``` markdown title="Admonition without title"
2020-07-20 17:40:48 +02:00
!!! note ""
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.
```
<div class="result" markdown>
2020-07-20 17:40:48 +02:00
2021-10-03 15:32:50 +02:00
!!! note ""
2020-07-20 17:40:48 +02:00
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.
</div>
2021-10-03 15:32:50 +02:00
[changing the title]: #changing-the-title
[collapsible blocks]: #collapsible-blocks
2020-07-20 17:40:48 +02:00
### Collapsible blocks
2021-10-03 18:02:59 +02:00
When [Details] is enabled and an admonition block is started with `???` instead
of `!!!`, the admonition is rendered as a collapsible block with a small toggle
on the right side:
2020-07-20 17:40:48 +02:00
``` markdown title="Admonition, collapsible"
2020-07-20 17:40:48 +02:00
??? note
2021-10-03 15:32:50 +02:00
2020-07-20 17:40:48 +02:00
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.
```
<div class="result" markdown>
2020-07-20 17:40:48 +02:00
??? note
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.
</div>
2020-07-20 17:40:48 +02:00
Adding a `+` after the `???` token renders the block expanded:
2020-07-20 17:40:48 +02:00
``` markdown title="Admonition, collapsible and initially expanded"
2020-07-20 17:40:48 +02:00
???+ note
2021-10-03 15:32:50 +02:00
2020-07-20 17:40:48 +02:00
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.
```
<div class="result" markdown>
2020-07-20 17:40:48 +02:00
???+ note
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.
</div>
### Inline blocks
Admonitions can also be rendered as inline blocks (e.g., for sidebars), placing
2021-10-03 15:32:50 +02:00
them to the right using the `inline` + `end` modifiers, or to the left using
only the `inline` modifier:
2021-03-14 12:50:15 +01:00
2021-10-03 15:32:50 +02:00
=== ":octicons-arrow-right-16: inline end"
2023-02-12 10:23:08 +01:00
!!! info inline end "Lorem ipsum"
2021-02-22 22:27:30 +01:00
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et
euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo
purus auctor massa, nec semper lorem quam in massa.
2021-02-22 22:27:30 +01:00
``` markdown
2023-02-12 10:23:08 +01:00
!!! info inline end "Lorem ipsum"
2023-09-20 14:59:25 +02:00
2021-02-22 22:27:30 +01:00
Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Nulla et euismod nulla.
Curabitur feugiat, tortor non consequat
finibus, justo purus auctor massa, nec
semper lorem quam in massa.
```
Use `inline end` to align to the right (left for rtl languages).
2021-10-03 15:32:50 +02:00
=== ":octicons-arrow-left-16: inline"
2023-02-12 10:23:08 +01:00
!!! info inline "Lorem ipsum"
2021-02-22 22:27:30 +01:00
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et
euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo
purus auctor massa, nec semper lorem quam in massa.
``` markdown
2023-02-12 10:23:08 +01:00
!!! info inline "Lorem ipsum"
2021-10-03 15:32:50 +02:00
2021-02-22 22:27:30 +01:00
Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Nulla et euismod nulla.
Curabitur feugiat, tortor non consequat
finibus, justo purus auctor massa, nec
semper lorem quam in massa.
```
Use `inline` to align to the left (right for rtl languages).
2021-11-14 09:08:40 +01:00
__Important__: admonitions that use the `inline` modifiers _must_ be declared
2021-10-03 15:32:50 +02:00
prior to the content block you want to place them beside. If there's
insufficient space to render the admonition next to the block, the admonition
will stretch to the full width of the viewport, e.g., on mobile viewports.
2020-07-20 17:40:48 +02:00
### Supported types
Following is a list of type qualifiers provided by Material for MkDocs, whereas
the default type, and thus fallback for unknown type qualifiers, is `note`[^1]:
[^1]:
Previously, some of the supported types defined more than one qualifier.
For example, authors could use `summary` or `tldr` as alternative qualifiers
to render an [`abstract`](#+type:abstract) admonition. As this increased the
size of the CSS that is shipped with Material for MkDocs, the additional
type qualifiers are now all deprecated and will be removed in the next major
version. This will also be mentioned in the upgrade guide.
2020-07-20 17:40:48 +02:00
2023-09-14 19:09:18 +02:00
<!-- md:option type:note -->
2020-07-20 17:40:48 +02:00
: !!! note
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et
euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo
purus auctor massa, nec semper lorem quam in massa.
2023-09-14 19:09:18 +02:00
<!-- md:option type:abstract -->
2020-07-20 17:40:48 +02:00
: !!! abstract
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et
euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo
purus auctor massa, nec semper lorem quam in massa.
2023-09-14 19:09:18 +02:00
<!-- md:option type:info -->
2020-07-20 17:40:48 +02:00
: !!! info
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et
euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo
purus auctor massa, nec semper lorem quam in massa.
2023-09-14 19:09:18 +02:00
<!-- md:option type:tip -->
2020-07-20 17:40:48 +02:00
: !!! tip
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et
euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo
purus auctor massa, nec semper lorem quam in massa.
2023-09-14 19:09:18 +02:00
<!-- md:option type:success -->
2020-07-20 17:40:48 +02:00
: !!! success
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et
euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo
purus auctor massa, nec semper lorem quam in massa.
2023-09-14 19:09:18 +02:00
<!-- md:option type:question -->
2020-07-20 17:40:48 +02:00
: !!! question
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et
euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo
purus auctor massa, nec semper lorem quam in massa.
2023-09-14 19:09:18 +02:00
<!-- md:option type:warning -->
2020-07-20 17:40:48 +02:00
: !!! warning
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et
euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo
purus auctor massa, nec semper lorem quam in massa.
2023-09-14 19:09:18 +02:00
<!-- md:option type:failure -->
2020-07-20 17:40:48 +02:00
: !!! failure
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et
euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo
purus auctor massa, nec semper lorem quam in massa.
2023-09-14 19:09:18 +02:00
<!-- md:option type:danger -->
2020-07-20 17:40:48 +02:00
: !!! danger
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et
euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo
purus auctor massa, nec semper lorem quam in massa.
2023-09-14 19:09:18 +02:00
<!-- md:option type:bug -->
2020-07-20 17:40:48 +02:00
: !!! bug
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et
euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo
purus auctor massa, nec semper lorem quam in massa.
2023-09-14 19:09:18 +02:00
<!-- md:option type:example -->
2020-07-20 17:40:48 +02:00
: !!! example
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et
euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo
purus auctor massa, nec semper lorem quam in massa.
2023-09-14 19:09:18 +02:00
<!-- md:option type:quote -->
2020-07-20 17:40:48 +02:00
: !!! quote
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et
euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo
purus auctor massa, nec semper lorem quam in massa.
## Customization
2022-10-02 15:15:35 +02:00
### Classic admonitions
2023-09-14 19:09:18 +02:00
Prior to version <!-- md:version 8.5.6 -->, admonitions had a slightly
different appearance:
2022-10-02 15:15:35 +02:00
!!! classic "Note"
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.
If you want to restore this appearance, add the following CSS to an
[additional style sheet]:
<style>
.md-typeset .admonition.classic {
border-width: 0;
border-left-width: 4px;
}
</style>
=== ":octicons-file-code-16: `docs/stylesheets/extra.css`"
``` css
.md-typeset .admonition,
.md-typeset details {
border-width: 0;
border-left-width: 4px;
}
```
=== ":octicons-file-code-16: `mkdocs.yml`"
``` yaml
extra_css:
- stylesheets/extra.css
```
### Custom admonitions
If you want to add a custom admonition type, all you need is a color and an
2021-10-10 12:19:14 +02:00
`*.svg` icon. Copy the icon's code from the [`.icons`][custom icons] folder
and add the following CSS to an [additional style sheet]:
<style>
:root {
--md-admonition-icon--pied-piper: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M244 246c-3.2-2-6.3-2.9-10.1-2.9-6.6 0-12.6 3.2-19.3 3.7l1.7 4.9zm135.9 197.9c-19 0-64.1 9.5-79.9 19.8l6.9 45.1c35.7 6.1 70.1 3.6 106-9.8-4.8-10-23.5-55.1-33-55.1zM340.8 177c6.6 2.8 11.5 9.2 22.7 22.1 2-1.4 7.5-5.2 7.5-8.6 0-4.9-11.8-13.2-13.2-23 11.2-5.7 25.2-6 37.6-8.9 68.1-16.4 116.3-52.9 146.8-116.7C548.3 29.3 554 16.1 554.6 2l-2 2.6c-28.4 50-33 63.2-81.3 100-31.9 24.4-69.2 40.2-106.6 54.6l-6.3-.3v-21.8c-19.6 1.6-19.7-14.6-31.6-23-18.7 20.6-31.6 40.8-58.9 51.1-12.7 4.8-19.6 10-25.9 21.8 34.9-16.4 91.2-13.5 98.8-10zM555.5 0l-.6 1.1-.3.9.6-.6zm-59.2 382.1c-33.9-56.9-75.3-118.4-150-115.5l-.3-6c-1.1-13.5 32.8 3.2 35.1-31l-14.4 7.2c-19.8-45.7-8.6-54.3-65.5-54.3-14.7 0-26.7 1.7-41.4 4.6 2.9 18.6 2.2 36.7-10.9 50.3l19.5 5.5c-1.7 3.2-2.9 6.3-2.9 9.8 0 21 42.8 2.9 42.8 33.6 0 18.4-36.8 60.1-54.9 60.1-8 0-53.7-50-53.4-60.1l.3-4.6 52.3-11.5c13-2.6 12.3-22.7-2.9-22.7-3.7 0-43.1 9.2-49.4 10.6-2-5.2-7.5-14.1-13.8-14.1-3.2 0-6.3 3.2-9.5 4-9.2 2.6-31 2.9-21.5 20.1L15.9 298.5c-5.5 1.1-8.9 6.3-8.9 11.8 0 6 5.5 10.9 11.5 10.9 8 0 131.3-28.4 147.4-32.2 2.6 3.2 4.6 6.3 7.8 8.6 20.1 14.4 59.8 85.9 76.4 85.9 24.1 0 58-22.4 71.3-41.9 3.2-4.3 6.9-7.5 12.4-6.9.6 13.8-31.6 34.2-33 43.7-1.4 10.2-1 35.2-.3 41.1 26.7 8.1 52-3.6 77.9-2.9 4.3-21 10.6-41.9 9.8-63.5l-.3-9.5c-1.4-34.2-10.9-38.5-34.8-58.6-1.1-1.1-2.6-2.6-3.7-4 2.2-1.4 1.1-1 4.6-1.7 88.5 0 56.3 183.6 111.5 229.9 33.1-15 72.5-27.9 103.5-47.2-29-25.6-52.6-45.7-72.7-79.9zm-196.2 46.1v27.2l11.8-3.4-2.9-23.8zm-68.7-150.4l24.1 61.2 21-13.8-31.3-50.9zm84.4 154.9l2 12.4c9-1.5 58.4-6.6 58.4-14.1 0-1.4-.6-3.2-.9-4.6-26.8 0-36.9 3.8-59.5 6.3z"/></svg>')
}
.md-typeset .admonition.pied-piper,
.md-typeset details.pied-piper {
border-color: rgb(43, 155, 70);
}
.md-typeset .pied-piper > .admonition-title,
.md-typeset .pied-piper > summary {
background-color: rgba(43, 155, 70, 0.1);
}
.md-typeset .pied-piper > .admonition-title::before,
.md-typeset .pied-piper > summary::before {
background-color: rgb(43, 155, 70);
-webkit-mask-image: var(--md-admonition-icon--pied-piper);
mask-image: var(--md-admonition-icon--pied-piper);
}
</style>
2022-09-11 19:25:40 +02:00
=== ":octicons-file-code-16: `docs/stylesheets/extra.css`"
2021-10-10 12:19:14 +02:00
``` css
:root {
--md-admonition-icon--pied-piper: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M244 246c-3.2-2-6.3-2.9-10.1-2.9-6.6 0-12.6 3.2-19.3 3.7l1.7 4.9zm135.9 197.9c-19 0-64.1 9.5-79.9 19.8l6.9 45.1c35.7 6.1 70.1 3.6 106-9.8-4.8-10-23.5-55.1-33-55.1zM340.8 177c6.6 2.8 11.5 9.2 22.7 22.1 2-1.4 7.5-5.2 7.5-8.6 0-4.9-11.8-13.2-13.2-23 11.2-5.7 25.2-6 37.6-8.9 68.1-16.4 116.3-52.9 146.8-116.7C548.3 29.3 554 16.1 554.6 2l-2 2.6c-28.4 50-33 63.2-81.3 100-31.9 24.4-69.2 40.2-106.6 54.6l-6.3-.3v-21.8c-19.6 1.6-19.7-14.6-31.6-23-18.7 20.6-31.6 40.8-58.9 51.1-12.7 4.8-19.6 10-25.9 21.8 34.9-16.4 91.2-13.5 98.8-10zM555.5 0l-.6 1.1-.3.9.6-.6zm-59.2 382.1c-33.9-56.9-75.3-118.4-150-115.5l-.3-6c-1.1-13.5 32.8 3.2 35.1-31l-14.4 7.2c-19.8-45.7-8.6-54.3-65.5-54.3-14.7 0-26.7 1.7-41.4 4.6 2.9 18.6 2.2 36.7-10.9 50.3l19.5 5.5c-1.7 3.2-2.9 6.3-2.9 9.8 0 21 42.8 2.9 42.8 33.6 0 18.4-36.8 60.1-54.9 60.1-8 0-53.7-50-53.4-60.1l.3-4.6 52.3-11.5c13-2.6 12.3-22.7-2.9-22.7-3.7 0-43.1 9.2-49.4 10.6-2-5.2-7.5-14.1-13.8-14.1-3.2 0-6.3 3.2-9.5 4-9.2 2.6-31 2.9-21.5 20.1L15.9 298.5c-5.5 1.1-8.9 6.3-8.9 11.8 0 6 5.5 10.9 11.5 10.9 8 0 131.3-28.4 147.4-32.2 2.6 3.2 4.6 6.3 7.8 8.6 20.1 14.4 59.8 85.9 76.4 85.9 24.1 0 58-22.4 71.3-41.9 3.2-4.3 6.9-7.5 12.4-6.9.6 13.8-31.6 34.2-33 43.7-1.4 10.2-1 35.2-.3 41.1 26.7 8.1 52-3.6 77.9-2.9 4.3-21 10.6-41.9 9.8-63.5l-.3-9.5c-1.4-34.2-10.9-38.5-34.8-58.6-1.1-1.1-2.6-2.6-3.7-4 2.2-1.4 1.1-1 4.6-1.7 88.5 0 56.3 183.6 111.5 229.9 33.1-15 72.5-27.9 103.5-47.2-29-25.6-52.6-45.7-72.7-79.9zm-196.2 46.1v27.2l11.8-3.4-2.9-23.8zm-68.7-150.4l24.1 61.2 21-13.8-31.3-50.9zm84.4 154.9l2 12.4c9-1.5 58.4-6.6 58.4-14.1 0-1.4-.6-3.2-.9-4.6-26.8 0-36.9 3.8-59.5 6.3z"/></svg>')
}
.md-typeset .admonition.pied-piper,
.md-typeset details.pied-piper {
border-color: rgb(43, 155, 70);
}
.md-typeset .pied-piper > .admonition-title,
.md-typeset .pied-piper > summary {
background-color: rgba(43, 155, 70, 0.1);
}
.md-typeset .pied-piper > .admonition-title::before,
.md-typeset .pied-piper > summary::before {
background-color: rgb(43, 155, 70);
-webkit-mask-image: var(--md-admonition-icon--pied-piper);
mask-image: var(--md-admonition-icon--pied-piper);
}
```
2022-09-11 19:25:40 +02:00
=== ":octicons-file-code-16: `mkdocs.yml`"
2021-10-10 12:19:14 +02:00
``` yaml
extra_css:
2021-10-10 17:39:53 +02:00
- stylesheets/extra.css
2021-10-10 12:19:14 +02:00
```
After applying the customization, you can use the custom admonition type:
``` markdown title="Admonition with custom type"
!!! pied-piper "Pied Piper"
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et
euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo
purus auctor massa, nec semper lorem quam in massa.
```
<div class="result" markdown>
!!! pied-piper "Pied Piper"
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod
nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor
massa, nec semper lorem quam in massa.
</div>
2023-09-20 14:59:25 +02:00
[custom icons]: https://github.com/squidfunk/mkdocs-material/tree/master/material/templates/.icons
2021-10-10 12:19:14 +02:00
[additional style sheet]: ../customization.md#additional-css