2016-09-04 17:11:58 +02:00
|
|
|
////
|
|
|
|
/// Copyright (c) 2016 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
|
|
|
|
////
|
2016-01-28 23:27:15 +01:00
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// Admonition extension
|
|
|
|
// ----------------------------------------------------------------------------
|
2016-09-02 00:33:45 +02:00
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Admonition
|
2016-09-02 00:33:45 +02:00
|
|
|
.admonition {
|
|
|
|
position: relative;
|
|
|
|
margin: 2.0rem 0;
|
2016-09-04 17:11:58 +02:00
|
|
|
padding: 0.8rem 1.6rem;
|
2016-09-02 00:33:45 +02:00
|
|
|
border-left: px2rem(32px) solid $clr-blue-a200;
|
|
|
|
border-radius: px2rem(2px);
|
2016-09-04 17:11:58 +02:00
|
|
|
background: transparentize($clr-blue-a200, 0.95);
|
2016-09-02 00:33:45 +02:00
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Icon
|
2016-09-04 17:11:58 +02:00
|
|
|
&::before {
|
2016-09-02 00:33:45 +02:00
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
top: 0.2rem;
|
|
|
|
left: -2.6rem;
|
|
|
|
float: left;
|
2016-09-04 17:11:58 +02:00
|
|
|
color: $md-color-white;
|
2016-09-02 00:33:45 +02:00
|
|
|
font-family: "Material Icons";
|
|
|
|
font-size: 2.0rem;
|
2016-09-04 17:11:58 +02:00
|
|
|
font-weight: normal;
|
|
|
|
content: "edit";
|
2016-09-02 00:33:45 +02:00
|
|
|
vertical-align: -0.1em;
|
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Title
|
2016-09-02 00:33:45 +02:00
|
|
|
&-title {
|
2016-09-04 17:11:58 +02:00
|
|
|
color: $clr-blue-a400;
|
2016-09-02 00:33:45 +02:00
|
|
|
font-size: ms(-1);
|
|
|
|
font-weight: 700;
|
|
|
|
line-height: 2.0rem;
|
|
|
|
text-transform: uppercase;
|
2016-09-02 22:59:14 +02:00
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Ensure smaller spacing to next element
|
2016-09-02 22:59:14 +02:00
|
|
|
html & {
|
|
|
|
margin-bottom: 1.6rem;
|
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Ensure smaller spacing to next element
|
2016-09-02 22:59:14 +02:00
|
|
|
html & + * {
|
|
|
|
margin-top: 1.6rem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Remove spacing on first element
|
2016-09-02 22:59:14 +02:00
|
|
|
:first-child {
|
|
|
|
margin-top: 0;
|
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Remove spacing on last element
|
2016-09-02 22:59:14 +02:00
|
|
|
:last-child {
|
|
|
|
margin-bottom: 0;
|
2016-09-02 00:33:45 +02:00
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Build representational classes
|
2016-09-02 00:33:45 +02:00
|
|
|
@each $names, $appearance in (
|
2016-09-02 00:44:04 +02:00
|
|
|
tip idea: $clr-teal-a700 "whatshot",
|
2016-09-04 17:11:58 +02:00
|
|
|
success check done: $clr-green-a400 "done",
|
2016-09-02 22:59:14 +02:00
|
|
|
warning warn: $clr-orange-a400 "warning",
|
2016-09-04 17:11:58 +02:00
|
|
|
failure fail missing: $clr-red-a200 "clear",
|
2016-09-02 00:33:45 +02:00
|
|
|
danger fatal: $clr-red-a400 "flash_on",
|
2016-09-04 17:11:58 +02:00
|
|
|
error bug: $clr-pink-a400 "bug_report"
|
2016-09-02 00:33:45 +02:00
|
|
|
) {
|
|
|
|
$tint: nth($appearance, 1);
|
|
|
|
$icon: nth($appearance, 2);
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Define base class
|
2016-09-04 17:11:58 +02:00
|
|
|
&%#{nth($names, 1)},
|
2016-09-02 00:33:45 +02:00
|
|
|
&.#{nth($names, 1)} {
|
|
|
|
border-color: $tint;
|
2016-09-04 17:11:58 +02:00
|
|
|
background: transparentize($tint, 0.95);
|
2016-09-02 00:33:45 +02:00
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Icon
|
2016-09-04 17:11:58 +02:00
|
|
|
&::before {
|
2016-09-02 00:33:45 +02:00
|
|
|
content: $icon;
|
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Set color for title
|
2016-09-02 00:33:45 +02:00
|
|
|
.admonition-title {
|
|
|
|
color: $tint;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-04 17:32:12 +02:00
|
|
|
// Define synonyms for base class
|
2016-09-02 00:33:45 +02:00
|
|
|
@if length($names) > 1 {
|
|
|
|
@for $n from 2 through length($names) {
|
|
|
|
&.#{nth($names, $n)} {
|
2016-09-04 17:11:58 +02:00
|
|
|
@extend .admonition%#{nth($names, 1)};
|
2016-09-02 00:33:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-09-04 17:11:58 +02:00
|
|
|
}
|