Sha256: f3530a9054fe38e9a6acc04aa05f41e27a22e28ac40add51985363f9275344f0

Contents?: true

Size: 1.3 KB

Versions: 4

Compression:

Stored size: 1.3 KB

Contents

// @category  utilities/debug

// check if debug is enabled
// @function  is-debug-enabled
// @param     $if {Boolean} optional override for $CONFIG_DEBUG
// @return    {Boolean} whether or not debug is enabled
@function is-debug-enabled($if: nil) {
  // debug is only available in DEV environments, so check that first
  // then check if the debug flag/override is truthy
  @return (index($CONFIG_DEBUG_ENVS, archetype-env()) and if($if == nil, $CONFIG_DEBUG, $if));
}

// a debug helper, print out a message
// @mixin     debug-message
// @param     $message {String} the message to output
// @param     $if {Boolean} override $CONFIG_DEBUG
@mixin debug-message($message, $if: nil) {
  @if(is-debug-enabled($if)) {
    @if archetype-version('sass >= 3.2') {
      /* #{$message} */
    }
    @else {
      -archetype-debug: quote($message);
    }
  }
}

// a debug helper, draws a "border" around the container when hovered and change opacity
// @mixin     debug-hover-box
// @param     $color {String} the color to draw the border
// @param     $opacity {Number}
// @param     $if {Boolean} override $CONFIG_DEBUG
@mixin debug-hover-box($color: rgb(0, 255, 255), $opacity: 0.9, $if: nil) {
  @if(is-debug-enabled($if)) {
    &:hover {
      @include opacity($opacity);
      @include box-shadow(0 0 3px 0 $color);
    }
  }
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
archetype-0.0.1.pre.13 stylesheets/archetype/util/_debug.scss
archetype-0.0.1.pre.10 stylesheets/archetype/util/_debug.scss
archetype-0.0.1.pre.9 stylesheets/archetype/util/_debug.scss
archetype-0.0.1.pre.8 stylesheets/archetype/util/_debug.scss