2016-09-04 18:11:58 +03:00
|
|
|
////
|
2017-01-06 21:11:18 +03:00
|
|
|
/// Copyright (c) 2016-2017 Martin Donath <martin.donath@squidfunk.com>
|
2016-09-04 18:11:58 +03:00
|
|
|
///
|
|
|
|
/// 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
|
|
|
|
////
|
2016-01-29 01:27:15 +03:00
|
|
|
|
2016-09-04 18:32:12 +03:00
|
|
|
// ----------------------------------------------------------------------------
|
2016-10-06 13:14:33 +03:00
|
|
|
// Rules
|
2016-09-04 18:32:12 +03:00
|
|
|
// ----------------------------------------------------------------------------
|
2016-09-02 01:33:45 +03:00
|
|
|
|
2017-08-26 14:31:24 +03:00
|
|
|
// Scoped in typesetted content to match specificity of regular content
|
|
|
|
.md-typeset {
|
2016-11-01 23:38:06 +03:00
|
|
|
|
2017-08-26 14:31:24 +03:00
|
|
|
// Admonition extension
|
|
|
|
.admonition {
|
|
|
|
@include z-depth(2);
|
2016-11-01 23:38:06 +03:00
|
|
|
|
2017-08-26 14:31:24 +03:00
|
|
|
position: relative;
|
|
|
|
margin: 1.5625em 0;
|
2017-12-08 11:36:03 +03:00
|
|
|
padding: 0 1.2rem;
|
2017-08-26 14:31:24 +03:00
|
|
|
border-left: 0.4rem solid $clr-blue-a200;
|
|
|
|
border-radius: 0.2rem;
|
|
|
|
font-size: ms(-1);
|
2017-12-08 11:36:03 +03:00
|
|
|
overflow: auto;
|
2016-09-02 23:59:14 +03:00
|
|
|
|
2017-12-02 16:43:49 +03:00
|
|
|
// Adjust spacing on last element
|
2017-12-12 23:39:52 +03:00
|
|
|
html & > :last-child {
|
2017-12-08 11:36:03 +03:00
|
|
|
margin-bottom: 1.2rem;
|
2017-08-26 14:31:24 +03:00
|
|
|
}
|
2016-09-02 01:33:45 +03:00
|
|
|
|
2017-08-29 10:07:27 +03:00
|
|
|
// Adjust margin for nested admonition blocks
|
|
|
|
.admonition {
|
|
|
|
margin: 1em 0;
|
|
|
|
}
|
|
|
|
|
2017-08-26 14:31:24 +03:00
|
|
|
// Title
|
2017-10-31 23:03:31 +03:00
|
|
|
> .admonition-title {
|
2017-12-08 11:36:03 +03:00
|
|
|
margin: 0 -1.2rem;
|
2017-08-29 14:46:07 +03:00
|
|
|
padding: 0.8rem 1.2rem 0.8rem 4rem;
|
2017-08-26 14:31:24 +03:00
|
|
|
border-bottom: 0.1rem solid transparentize($clr-blue-a200, 0.9);
|
|
|
|
background-color: transparentize($clr-blue-a200, 0.9);
|
|
|
|
font-weight: 700;
|
2016-09-02 01:33:45 +03:00
|
|
|
|
2017-12-02 16:43:49 +03:00
|
|
|
// Reset spacing, if title is the only element
|
2017-12-08 11:36:03 +03:00
|
|
|
&:last-child {
|
|
|
|
margin-bottom: 0;
|
2017-12-02 16:43:49 +03:00
|
|
|
}
|
|
|
|
|
2016-11-01 23:38:06 +03:00
|
|
|
// Icon
|
|
|
|
&::before {
|
2017-08-26 14:31:24 +03:00
|
|
|
@extend %md-icon;
|
2016-09-02 01:33:45 +03:00
|
|
|
|
2017-08-29 14:46:07 +03:00
|
|
|
position: absolute;
|
|
|
|
left: 1.2rem;
|
2017-08-26 14:31:24 +03:00
|
|
|
color: $clr-blue-a200;
|
|
|
|
font-size: 2rem;
|
2017-08-29 18:23:30 +03:00
|
|
|
content: "\E3C9"; // edit
|
2016-09-02 01:33:45 +03:00
|
|
|
}
|
|
|
|
}
|
2016-11-06 01:26:07 +03:00
|
|
|
|
2017-08-26 14:31:24 +03:00
|
|
|
// Build representational classes
|
|
|
|
@each $names, $appearance in (
|
2018-01-10 00:53:56 +03:00
|
|
|
abstract summary tldr: $clr-light-blue-a400 "\E8D2", // subject
|
2017-08-29 18:23:30 +03:00
|
|
|
info todo: $clr-cyan-a700 "\E88E", // info
|
|
|
|
tip hint important : $clr-teal-a700 "\E80E", // whatshot
|
|
|
|
success check done: $clr-green-a700 "\E876", // done
|
|
|
|
question help faq: $clr-light-green-a700 "\E887", // help
|
|
|
|
warning caution attention: $clr-orange-a400 "\E002", // warning
|
|
|
|
failure fail missing: $clr-red-a200 "\E14C", // clear
|
|
|
|
danger error: $clr-red-a400 "\E3E7", // flash_on
|
|
|
|
bug: $clr-pink-a400 "\E868", // bug_report
|
2018-01-10 00:53:56 +03:00
|
|
|
example: $clr-deep-purple-a400 "\E242", // format_list_numbered
|
2017-08-29 18:23:30 +03:00
|
|
|
quote cite: $clr-grey "\E244" // format_quote
|
2017-08-26 14:31:24 +03:00
|
|
|
) {
|
|
|
|
$tint: nth($appearance, 1);
|
|
|
|
$icon: nth($appearance, 2);
|
2016-11-06 01:26:07 +03:00
|
|
|
|
2017-08-26 14:31:24 +03:00
|
|
|
// Define base class
|
|
|
|
&%#{nth($names, 1)},
|
|
|
|
&.#{nth($names, 1)} {
|
|
|
|
border-left: 0.4rem solid $tint;
|
|
|
|
|
|
|
|
// Title
|
2017-10-31 23:03:31 +03:00
|
|
|
> .admonition-title {
|
2017-08-26 14:31:24 +03:00
|
|
|
border-bottom: 0.1rem solid transparentize($tint, 0.9);
|
|
|
|
background-color: transparentize($tint, 0.9);
|
2016-11-06 01:26:07 +03:00
|
|
|
|
2017-08-26 14:31:24 +03:00
|
|
|
// Icon
|
|
|
|
&::before {
|
|
|
|
color: $tint;
|
|
|
|
content: $icon;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Define synonyms for base class
|
|
|
|
@if length($names) > 1 {
|
|
|
|
@for $n from 2 through length($names) {
|
|
|
|
&.#{nth($names, $n)} {
|
|
|
|
@extend .admonition%#{nth($names, 1)};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-11-06 01:26:07 +03:00
|
|
|
}
|
|
|
|
}
|