2016-09-04 18:11:58 +03: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-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
|
|
|
|
2016-10-06 13:14:33 +03:00
|
|
|
// Admonition extension
|
2016-09-02 01:33:45 +03:00
|
|
|
.admonition {
|
2016-11-01 23:38:06 +03:00
|
|
|
position: relative;
|
2016-09-02 01:33:45 +03:00
|
|
|
margin: 2.0rem 0;
|
2016-10-21 22:15:35 +03:00
|
|
|
padding: 0.8rem 1.2rem;
|
2016-11-01 23:38:06 +03:00
|
|
|
border-left: 3.2rem solid transparentize($clr-blue-a200, 0.6);
|
|
|
|
border-radius: 0.2rem;
|
|
|
|
background: 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: 2.0rem;
|
|
|
|
content: "edit";
|
|
|
|
vertical-align: -0.25em;
|
|
|
|
}
|
2016-09-02 01:33:45 +03:00
|
|
|
|
2016-09-04 18:32:12 +03:00
|
|
|
// Title
|
2016-09-02 01:33:45 +03:00
|
|
|
&-title {
|
|
|
|
font-weight: 700;
|
2016-09-02 23:59:14 +03:00
|
|
|
|
2016-10-21 22:15:35 +03:00
|
|
|
// Remove bottom spacing for title
|
2016-09-02 23:59:14 +03:00
|
|
|
html & {
|
2016-10-21 22:15:35 +03:00
|
|
|
margin-bottom: 0;
|
2016-09-02 23:59:14 +03:00
|
|
|
}
|
|
|
|
|
2016-10-21 22:15:35 +03:00
|
|
|
// Remove top spacing for first element following title
|
2016-09-02 23:59:14 +03:00
|
|
|
html & + * {
|
2016-10-21 22:15:35 +03:00
|
|
|
margin-top: 0;
|
|
|
|
}
|
2016-09-02 23:59:14 +03:00
|
|
|
}
|
|
|
|
|
2016-09-04 18:32:12 +03:00
|
|
|
// Remove spacing on first element
|
2016-09-02 23:59:14 +03:00
|
|
|
:first-child {
|
|
|
|
margin-top: 0;
|
|
|
|
}
|
|
|
|
|
2016-09-04 18:32:12 +03:00
|
|
|
// Remove spacing on last element
|
2016-09-02 23:59:14 +03:00
|
|
|
:last-child {
|
|
|
|
margin-bottom: 0;
|
2016-09-02 01:33:45 +03:00
|
|
|
}
|
|
|
|
|
2016-09-04 18:32:12 +03:00
|
|
|
// Build representational classes
|
2016-09-02 01:33:45 +03:00
|
|
|
@each $names, $appearance in (
|
2016-09-23 12:56:25 +03:00
|
|
|
summary tldr: $clr-light-blue-a400 "subject",
|
2016-09-02 01:44:04 +03:00
|
|
|
tip idea: $clr-teal-a700 "whatshot",
|
2016-09-04 18:11:58 +03:00
|
|
|
success check done: $clr-green-a400 "done",
|
2016-10-21 22:15:35 +03:00
|
|
|
warning attention important: $clr-orange-a400 "warning",
|
2016-09-04 18:11:58 +03:00
|
|
|
failure fail missing: $clr-red-a200 "clear",
|
2016-10-21 22:15:35 +03:00
|
|
|
danger caution: $clr-red-a400 "flash_on",
|
2016-09-04 18:11:58 +03:00
|
|
|
error bug: $clr-pink-a400 "bug_report"
|
2016-09-02 01:33:45 +03:00
|
|
|
) {
|
|
|
|
$tint: nth($appearance, 1);
|
|
|
|
$icon: nth($appearance, 2);
|
|
|
|
|
2016-09-04 18:32:12 +03:00
|
|
|
// Define base class
|
2016-09-04 18:11:58 +03:00
|
|
|
&%#{nth($names, 1)},
|
2016-09-02 01:33:45 +03:00
|
|
|
&.#{nth($names, 1)} {
|
2016-11-01 23:38:06 +03:00
|
|
|
border-color: transparentize($tint, 0.6);
|
|
|
|
background: transparentize($tint, 0.85);
|
2016-09-02 01:33:45 +03:00
|
|
|
|
2016-11-01 23:38:06 +03:00
|
|
|
// Icon
|
|
|
|
&::before {
|
|
|
|
content: $icon;
|
2016-09-02 01:33:45 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-04 18:32:12 +03:00
|
|
|
// Define synonyms for base class
|
2016-09-02 01:33:45 +03:00
|
|
|
@if length($names) > 1 {
|
|
|
|
@for $n from 2 through length($names) {
|
|
|
|
&.#{nth($names, $n)} {
|
2016-09-04 18:11:58 +03:00
|
|
|
@extend .admonition%#{nth($names, 1)};
|
2016-09-02 01:33:45 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-09-04 18:11:58 +03:00
|
|
|
}
|