1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-24 07:30:12 +01:00

Refactored Admonition styles

This commit is contained in:
squidfunk 2017-08-26 18:31:24 +07:00 committed by Martin Donath
parent 4768d78530
commit 35dbc1c0bb
8 changed files with 80 additions and 79 deletions

View File

@ -78,7 +78,7 @@ emojis. Happy scrolling :tada:
[MagicLink][9] detects links in Markdown and auto-generates the necessary
markup, so no special syntax is required. It auto-links `http[s]://` and
`ftp://` links, as well as references to email addresses:
`ftp://` links, as well as references to email addresses.
[9]: https://facelessuser.github.io/pymdown-extensions/extensions/magiclink/
@ -150,7 +150,7 @@ must be enclosed in two carets `^^...^^`.
#### Mark
[Mark][16] adds the ability to ==highlight text== like it was marked with a
==yellow text marker==. The portion of text that should be highlighted must be
==text marker==. The portion of text that should be highlighted must be
enclosed in two equal signs `==...==`.
[16]: https://facelessuser.github.io/pymdown-extensions/extensions/mark/
@ -163,7 +163,7 @@ symbols ((c), (tm), (r)) and fractions (1/2, 1/4, ...).
[17]: https://facelessuser.github.io/pymdown-extensions/extensions/smartsymbols/
#### Critic
### Critic
[Critic][18] implements [Critic Markup][19], a Markdown extension that enables
the tracking of changes (additions, deletions and comments) on documents.

View File

@ -1 +1 @@
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.jp=function(){this.pipeline.reset(),this.pipeline.add(e.jp.stopWordFilter,e.jp.stemmer),r?this.tokenizer=e.jp.tokenizer:(e.tokenizer&&(e.tokenizer=e.jp.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.jp.tokenizer))};var t=new e.TinySegmenter;e.jp.tokenizer=function(n){if(!arguments.length||null==n||void 0==n)return[];if(Array.isArray(n))return n.map(function(t){return r?new e.Token(t.toLowerCase()):t.toLowerCase()});for(var i=n.toString().toLowerCase().replace(/^\s+/,""),o=i.length-1;o>=0;o--)if(/\S/.test(i.charAt(o))){i=i.substring(0,o+1);break}return t.segment(i).filter(function(e){return!!e}).map(function(t){return r?new e.Token(t):t})},e.jp.stemmer=function(){return function(e){return e}}(),e.Pipeline.registerFunction(e.jp.stemmer,"stemmer-jp"),e.jp.wordCharacters="一二三四五六七八九十百千万億兆一-龠々〆ヵヶぁ-んァ-ヴーア-ン゙a-zA-Z--0-9-",e.jp.stopWordFilter=function(t){if(-1===e.jp.stopWordFilter.stopWords.indexOf(r?t.toString():t))return t},e.jp.stopWordFilter=e.generateStopWordFilter("これ それ あれ この その あの ここ そこ あそこ こちら どこ だれ なに なん 何 私 貴方 貴方方 我々 私達 あの人 あのかた 彼女 彼 です あります おります います は が の に を で え から まで より も どの と し それで しかし".split(" ")),e.Pipeline.registerFunction(e.jp.stopWordFilter,"stopWordFilter-jp")}});
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.jp=function(){this.pipeline.reset(),this.pipeline.add(e.jp.stopWordFilter,e.jp.stemmer),r?this.tokenizer=e.jp.tokenizer:(e.tokenizer&&(e.tokenizer=e.jp.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.jp.tokenizer))};var t=new e.TinySegmenter;e.jp.tokenizer=function(n){if(!arguments.length||null==n||void 0==n)return[];if(Array.isArray(n))return n.map(function(t){return r?new e.Token(t.toLowerCase()):t.toLowerCase()});for(var i=n.toString().toLowerCase().replace(/^\s+/,""),o=i.length-1;o>=0;o--)if(/\S/.test(i.charAt(o))){i=i.substring(0,o+1);break}return t.segment(i).filter(function(e){return!!e}).map(function(t){return r?new e.Token(t):t})},e.jp.stemmer=function(e){return e},e.Pipeline.registerFunction(e.jp.stemmer,"stemmer-jp"),e.jp.wordCharacters="一二三四五六七八九十百千万億兆一-龠々〆ヵヶぁ-んァ-ヴーア-ン゙a-zA-Z--0-9-",e.jp.stopWordFilter=function(t){if(-1===e.jp.stopWordFilter.stopWords.indexOf(r?t.toString():t))return t},e.jp.stopWordFilter=e.generateStopWordFilter("これ それ あれ この その あの ここ そこ あそこ こちら どこ だれ なに なん 何 私 貴方 貴方方 我々 私達 あの人 あのかた 彼女 彼 です あります おります います は が の に を で え から まで より も どの と し それで しかし".split(" ")),e.Pipeline.registerFunction(e.jp.stopWordFilter,"stopWordFilter-jp")}});

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

View File

@ -36,12 +36,12 @@
{% endif %}
{% endblock %}
{% block libs %}
<script src="{{ base_url }}/assets/javascripts/modernizr-1df76c4e58.js"></script>
<script src="{{ base_url }}/assets/javascripts/modernizr-a4b2c11202.js"></script>
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-bfecc7305d.css">
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-096a56e411.css">
{% if config.extra.palette %}
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-02c2a4388f.palette.css">
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-c0da6837a6.palette.css">
{% endif %}
{% endblock %}
{% block fonts %}
@ -174,7 +174,7 @@
{% endblock %}
{% block analytics %}
{% if config.google_analytics %}
<script>!function(e,t,a,n,o,c,i){e.GoogleAnalyticsObject=o,e[o]=e[o]||function(){(e[o].q=e[o].q||[]).push(arguments)},e[o].l=1*new Date,c=t.createElement(a),i=t.getElementsByTagName(a)[0],c.async=1,c.src=n,i.parentNode.insertBefore(c,i)}(window,document,"script","https://www.google-analytics.com/analytics.js","ga"),ga("create","{{ config.google_analytics[0] }}","{{ config.google_analytics[1] }}"),ga("set","anonymizeIp",!0),ga("send","pageview");var links=document.getElementsByTagName("a");Array.prototype.map.call(links,function(e){e.host!=document.location.host&&e.addEventListener("click",function(){var t=e.getAttribute("data-md-action")||"follow";ga("send","event","outbound",t,e.href)})});var query=document.forms.search.query;query.addEventListener("blur",function(){if(this.value){var e=document.location.pathname;ga("send","pageview",e+"?q="+this.value)}})</script>
<script>!function(e,t,a,n,o,c,i){e.GoogleAnalyticsObject=o,e[o]=e[o]||function(){(e[o].q=e[o].q||[]).push(arguments)},e[o].l=1*new Date,c=t.createElement(a),i=t.getElementsByTagName(a)[0],c.async=1,c.src="https://www.google-analytics.com/analytics.js",i.parentNode.insertBefore(c,i)}(window,document,"script",0,"ga"),ga("create","{{ config.google_analytics[0] }}","{{ config.google_analytics[1] }}"),ga("set","anonymizeIp",!0),ga("send","pageview");var links=document.getElementsByTagName("a");Array.prototype.map.call(links,function(e){e.host!=document.location.host&&e.addEventListener("click",function(){var t=e.getAttribute("data-md-action")||"follow";ga("send","event","outbound",t,e.href)})});var query=document.forms.search.query;query.addEventListener("blur",function(){if(this.value){var e=document.location.pathname;ga("send","pageview",e+"?q="+this.value)}})</script>
{% endif %}
{% endblock %}
</body>

View File

@ -20,4 +20,4 @@
mkdocs>=0.16
pygments>=2.2
pymdown-extensions>=2.0
pymdown-extensions>=3.4

View File

@ -24,28 +24,20 @@
// Rules
// ----------------------------------------------------------------------------
// Scoped in typesetted content to match specificity of regular content
.md-typeset {
// Admonition extension
.admonition {
@include z-depth(2);
position: relative;
margin: 1.5625em 0;
padding: 0.8rem 1.2rem;
border-left: 3.2rem solid transparentize($clr-blue-a200, 0.6);
border-left: 0.4rem solid $clr-blue-a200;
border-radius: 0.2rem;
background-color: transparentize($clr-blue-a200, 0.85);
font-size: ms(-1);
// Icon
&::before {
@extend %md-icon;
position: absolute;
left: -2.6rem;
color: $md-color-white;
font-size: 2rem;
content: "edit";
vertical-align: -0.25em;
}
// Remove spacing on first element
:first-child {
margin-top: 0;
@ -56,11 +48,31 @@
margin-bottom: 0;
}
// Title
.admonition-title {
margin: -0.8rem -1.2rem -0.4rem;
padding: 0.8rem 1.2rem;
border-bottom: 0.1rem solid transparentize($clr-blue-a200, 0.9);
background-color: transparentize($clr-blue-a200, 0.9);
font-weight: 700;
// Icon
&::before {
@extend %md-icon;
margin-right: 0.8rem;
color: $clr-blue-a200;
font-size: 2rem;
content: "edit";
vertical-align: -0.25em;
}
}
// Build representational classes
@each $names, $appearance in (
summary tldr: $clr-light-blue-a400 "subject",
tip hint important : $clr-teal-a700 "whatshot",
success check done: $clr-green-a400 "done",
success check done: $clr-green-a700 "done",
warning caution attention: $clr-orange-a400 "warning",
failure fail missing: $clr-red-a200 "clear",
danger error: $clr-red-a400 "flash_on",
@ -73,14 +85,20 @@
// Define base class
&%#{nth($names, 1)},
&.#{nth($names, 1)} {
border-color: transparentize($tint, 0.6);
background-color: transparentize($tint, 0.85);
border-left: 0.4rem solid $tint;
// Title
.admonition-title {
border-bottom: 0.1rem solid transparentize($tint, 0.9);
background-color: transparentize($tint, 0.9);
// Icon
&::before {
color: $tint;
content: $icon;
}
}
}
// Define synonyms for base class
@if length($names) > 1 {
@ -92,18 +110,4 @@
}
}
}
// Title
.admonition-title {
font-weight: 700;
// Remove bottom spacing for title
html & {
margin-bottom: 0;
}
// Remove top spacing for first element following title
html & + * {
margin-top: 0;
}
}