Sha256: 9fd853963c6b669b32166d6d42e882d2aa9f1a398d73f32efc3ead9b72c168b0

Contents?: true

Size: 1.83 KB

Versions: 17

Compression:

Stored size: 1.83 KB

Contents

// Foundation by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source

@import "global";

//
// @variables
//
$include-html-keystroke-classes: $include-html-classes !default;

// We use these to control text styles.
$keystroke-font: "Consolas", "Menlo", "Courier", monospace !default;
$keystroke-font-size: inherit !default;
$keystroke-font-color: #222 !default;
$keystroke-font-color-alt: #fff !default;
$keystroke-function-factor: -7% !default;

// We use this to control keystroke padding.
$keystroke-padding: rem-calc(2 4 0) !default;

// We use these to control background and border styles.
$keystroke-bg: scale-color(#fff, $lightness: $keystroke-function-factor) !default;
$keystroke-border-style: solid !default;
$keystroke-border-width: 1px !default;
$keystroke-border-color: scale-color($keystroke-bg, $lightness: $keystroke-function-factor) !default;
$keystroke-radius: $global-radius !default;

//
// @mixins
//
// We use this mixin to create keystroke styles.
// $bg - Default: $keystroke-bg || scale-color(#fff, $lightness: $keystroke-function-factor) !default;
@mixin keystroke($bg:$keystroke-bg) {
  // This find the lightness percentage of the background color.
  $bg-lightness: lightness($bg);

  background-color: $bg;
  border-color: scale-color($bg, $lightness: $keystroke-function-factor);

  // We adjust the font color based on the brightness of the background.
  @if $bg-lightness > 70% { color: $keystroke-font-color; }
  @else { color: $keystroke-font-color-alt; }

  border-style: $keystroke-border-style;
  border-width: $keystroke-border-width;
  margin: 0;
  font-family: $keystroke-font;
  font-size: $keystroke-font-size;
  padding: $keystroke-padding;
}

@include exports("keystroke") {
  @if $include-html-keystroke-classes  {
    .keystroke,
    kbd {
      @include keystroke;
      @include radius($keystroke-radius);
    }
  }
}

Version data entries

17 entries across 17 versions & 5 rubygems

Version Path
rubyneat_dashboard-0.4.1 bower_components/foundation/scss/foundation/components/_keystrokes.scss
locomotivecms_wagon-1.5.1 generators/foundation5/public/stylesheets/foundation/components/_keystrokes.scss
locomotivecms_wagon-1.5.0 generators/foundation5/public/stylesheets/foundation/components/_keystrokes.scss
locomotivecms_wagon-1.5.0.rc1 generators/foundation5/public/stylesheets/foundation/components/_keystrokes.scss
rubyneat_dashboard-0.4.0.alpha.6 bower_components/foundation/scss/foundation/components/_keystrokes.scss
foundation-rails-5.3.3.0 vendor/assets/stylesheets/foundation/components/_keystrokes.scss
rubyneat_dashboard-0.4.0.alpha.4.pre.1 bower_components/foundation/scss/foundation/components/_keystrokes.scss
rubyneat_dashboard-0.4.0.alpha.4 bower_components/foundation/scss/foundation/components/_keystrokes.scss
foundation-rails-5.3.1.0 vendor/assets/stylesheets/foundation/components/_keystrokes.scss
TokiCLI-0.2.1 lib/TokiServer/bower_components/foundation/scss/foundation/components/_keystrokes.scss
foundation-rails-5.3.0.1 vendor/assets/stylesheets/foundation/components/_keystrokes.scss
foundation-rails-5.3.0.0 vendor/assets/stylesheets/foundation/components/_keystrokes.scss
TokiCLI-0.2.0 lib/TokiServer/bower_components/foundation/scss/foundation/components/_keystrokes.scss
foundation-rails-5.2.3.0 vendor/assets/stylesheets/foundation/components/_keystrokes.scss
zurb-foundation-5-5.2.2 scss/foundation/components/_keystrokes.scss
foundation-rails-5.2.2.0 vendor/assets/stylesheets/foundation/components/_keystrokes.scss
foundation-rails-5.2.1.0 vendor/assets/stylesheets/foundation/components/_keystrokes.scss