From 8f37765dc41dc69af334661e8c034d52183d35bc Mon Sep 17 00:00:00 2001 From: Dave Lockhart Date: Tue, 25 Apr 2017 16:46:56 -0400 Subject: [PATCH] exposing a few mixins so that BSI can leverage them --- d2l-button.scss | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/d2l-button.scss b/d2l-button.scss index feed485..032fb09 100644 --- a/d2l-button.scss +++ b/d2l-button.scss @@ -1,10 +1,23 @@ @import 'bower_components/d2l-colors/d2l-colors.scss'; +@mixin _d2l-button-clear-focus() { + box-shadow: 0 0 0 4px rgba(0, 0, 0, 0); +} + +@mixin _d2l-button-focus() { + border-color: rgba(0, 111, 191, 0.4); + box-shadow: 0 0 0 4px rgba(0, 111, 191, 0.3); +} + +@mixin _d2l-button-primary-focus() { + box-shadow: 0 0 0 4px rgba(0, 111, 191, 0.3); +} + @mixin d2l-button() { border-width: 1px; border-style: solid; border-radius: 0.3rem; - box-shadow: 0 0 0 4px rgba(0, 0, 0, 0); + @include _d2l-button-clear-focus(); box-sizing: border-box; cursor: pointer; display: inline-block; @@ -39,8 +52,7 @@ background-color: $d2l-color-gypsum; } &:focus, &.d2l-button-focus { - border-color: rgba(0, 111, 191, 0.4); - box-shadow: 0 0 0 4px rgba(0, 111, 191, 0.3); + @include _d2l-button-focus(); } &[disabled] { opacity: 0.5; @@ -55,6 +67,6 @@ background-color: $d2l-color-celestuba; } &[primary]:focus, &[primary].d2l-button-focus { - box-shadow: 0 0 0 4px rgba(0, 111, 191, 0.3); + @include _d2l-button-primary-focus(); } }