mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Added support for inline admonitions
This commit is contained in:
parent
4ca3fa5668
commit
9591265939
@ -228,8 +228,7 @@ _Result_:
|
||||
### Inline blocks
|
||||
|
||||
[:octicons-file-code-24: Source][12] ·
|
||||
:octicons-beaker-24: Experimental ·
|
||||
[:octicons-heart-fill-24:{: .tx-heart } Insiders only][12]{: .tx-insiders }
|
||||
:octicons-beaker-24: Experimental
|
||||
|
||||
Admonitions and [Details][11] can also be rendered as inline blocks (i.e.
|
||||
sidebars), moving them to the right using the `inline` + `end` modifiers, or
|
||||
@ -254,7 +253,7 @@ _Result_:
|
||||
|
||||
[![Admonition, inline][14]][14]
|
||||
|
||||
[12]: ../insiders.md
|
||||
[12]: https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/stylesheets/main/_modifiers.scss
|
||||
[13]: ../assets/screenshots/admonition-inline-end.png
|
||||
[14]: ../assets/screenshots/admonition-inline.png
|
||||
|
||||
|
2
material/assets/stylesheets/main.006edf1e.min.css
vendored
Normal file
2
material/assets/stylesheets/main.006edf1e.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
material/assets/stylesheets/main.006edf1e.min.css.map
Normal file
1
material/assets/stylesheets/main.006edf1e.min.css.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -39,7 +39,7 @@
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block styles %}
|
||||
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.a361390f.min.css' | url }}">
|
||||
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.006edf1e.min.css' | url }}">
|
||||
{% if config.theme.palette %}
|
||||
{% set palette = config.theme.palette %}
|
||||
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.7fa14f5b.min.css' | url }}">
|
||||
|
@ -68,4 +68,5 @@
|
||||
@import "main/extensions/pymdownx/tabbed";
|
||||
@import "main/extensions/pymdownx/tasklist";
|
||||
|
||||
@import "main/modifiers";
|
||||
@import "main/shame";
|
||||
|
63
src/assets/stylesheets/main/_modifiers.scss
Normal file
63
src/assets/stylesheets/main/_modifiers.scss
Normal file
@ -0,0 +1,63 @@
|
||||
////
|
||||
/// Copyright (c) 2016-2021 Martin Donath <martin.donath@squidfunk.com>
|
||||
///
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
/// copy of this software and associated documentation files (the "Software"),
|
||||
/// to deal in the Software without restriction, including without limitation
|
||||
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
/// and/or sell copies of the Software, and to permit persons to whom the
|
||||
/// Software is furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
/// DEALINGS
|
||||
////
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Rules
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Scoped in typesetted content to match specificity of regular content
|
||||
.md-typeset {
|
||||
|
||||
// [tablet +]: Allow for rendering content as sidebars
|
||||
@include break-from-device(tablet) {
|
||||
|
||||
// Modifier to float block elements
|
||||
.inline {
|
||||
float: left;
|
||||
width: px2rem(234px);
|
||||
margin-top: 0;
|
||||
margin-right: px2rem(16px);
|
||||
margin-bottom: px2rem(16px);
|
||||
|
||||
// Adjust for right-to-left languages
|
||||
[dir="rtl"] & {
|
||||
float: right;
|
||||
margin-right: 0;
|
||||
margin-left: px2rem(16px);
|
||||
}
|
||||
|
||||
// Modifier to move to end (ltr: right, rtl: left)
|
||||
&.end {
|
||||
float: right;
|
||||
margin-right: 0;
|
||||
margin-left: px2rem(16px);
|
||||
|
||||
// Adjust for right-to-left languages
|
||||
[dir="rtl"] & {
|
||||
float: left;
|
||||
margin-right: px2rem(16px);
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
////
|
||||
/// Copyright (c) 2016-2021 Martin Donath <martin.donath@squidfunk.com>
|
||||
/// Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>
|
||||
///
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
/// copy of this software and associated documentation files (the "Software"),
|
||||
@ -82,6 +82,7 @@ kbd {
|
||||
ol,
|
||||
dl,
|
||||
blockquote {
|
||||
display: flow-root;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
@ -142,6 +143,7 @@ kbd {
|
||||
|
||||
// Horizontal separator
|
||||
hr {
|
||||
display: flow-root;
|
||||
margin: 1.5em 0;
|
||||
border-bottom: px2rem(1px) solid var(--md-default-fg-color--lightest);
|
||||
}
|
||||
@ -214,6 +216,7 @@ kbd {
|
||||
// Unformatted content
|
||||
pre {
|
||||
position: relative;
|
||||
display: flow-root;
|
||||
margin: 1em 0;
|
||||
line-height: 1.4;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user