Skip to content
Snippets Groups Projects
Select Git revision
  • 93223df6a2ed396a8e42b83aceb4826c695f5a0f
  • master default protected
  • greenkeeper/webpack-4.10.1
  • greenkeeper/webpack-4.10.0
  • greenkeeper/webpack-4.9.2
  • greenkeeper/promise-polyfill-8.0.0
  • greenkeeper/webpack-4.9.1
  • greenkeeper/webpack-4.9.0
  • greenkeeper/webpack-manifest-plugin-2.0.3
  • greenkeeper/update-to-node-10
  • gh-pages
  • greenkeeper/webpack-4.8.3
  • greenkeeper/webpack-4.8.2
  • greenkeeper/webpack-4.7.0
  • greenkeeper/webpack-manifest-plugin-2.0.2
  • greenkeeper/webpack-manifest-plugin-2.0.1
  • greenkeeper/style-loader-0.21.0
  • greenkeeper/webpack-4.6.0
  • greenkeeper/sass-loader-7.0.1
  • greenkeeper/sass-loader-7.0.0
  • greenkeeper/webpack-manifest-plugin-2.0.0
  • 2.7.3
  • 2.7.2
  • 2.7.1
  • 2.7.0
  • 2.6.6
  • 2.6.5
  • 2.6.4
  • 2.6.3
  • 2.6.2
  • 2.6.1
  • 2.6.0
  • 2.5.5
  • 2.5.4
  • 2.5.3
  • 2.5.2
  • 2.5.1
  • 2.5.0
  • 2.4.0
  • 2.3.0
  • 2.2.6
41 results

_admonition.scss

Blame
  • user avatar
    squidfunk authored and Martin Donath committed
    96678bd3
    History
    _admonition.scss 3.76 KiB
    ////
    /// Copyright (c) 2016-2017 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 {
    
      // Admonition extension
      .admonition {
        @include z-depth(2);
    
        position: relative;
        margin: 1.5625em 0;
        padding: 0 1.2rem;
        border-left: 0.4rem solid $clr-blue-a200;
        border-radius: 0.2rem;
        font-size: ms(-1);
        overflow: auto;
    
        // Adjust spacing on last element
        html & > :last-child {
          margin-bottom: 1.2rem;
        }
    
        // Adjust margin for nested admonition blocks
        .admonition {
          margin: 1em 0;
        }
    
        // Title
        > .admonition-title {
          margin: 0 -1.2rem;
          padding: 0.8rem 1.2rem 0.8rem 4rem;
          border-bottom: 0.1rem solid transparentize($clr-blue-a200, 0.9);
          background-color: transparentize($clr-blue-a200, 0.9);
          font-weight: 700;
    
          // Reset spacing, if title is the only element
          &:last-child {
            margin-bottom: 0;
          }
    
          // Icon
          &::before {
            @extend %md-icon;
    
            position: absolute;
            left: 1.2rem;
            color: $clr-blue-a200;
            font-size: 2rem;
            content: "\E3C9"; // edit
          }
        }
    
        // Build representational classes
        @each $names, $appearance in (
          summary tldr: $clr-light-blue-a400 "\E8D2", // subject
          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
          quote cite: $clr-grey "\E244" // format_quote
        ) {
          $tint: nth($appearance, 1);
          $icon: nth($appearance, 2);
    
          // Define base class
          &%#{nth($names, 1)},
          &.#{nth($names, 1)} {
            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 {
            @for $n from 2 through length($names) {
              &.#{nth($names, $n)} {
                @extend .admonition%#{nth($names, 1)};
              }
            }
          }
        }
      }
    }