From b886fd2f012f3ebe68292aaedf55d5c3709f972b Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Wed, 15 Jan 2014 18:07:22 -0800 Subject: [PATCH] refactoring: add & use .text-emphasis-variant() mixin --- less/mixins.less | 9 +++++++++ less/type.less | 25 +++++-------------------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/less/mixins.less b/less/mixins.less index 3af3c82087..1edaa3f4ef 100644 --- a/less/mixins.less +++ b/less/mixins.less @@ -577,6 +577,15 @@ } } +// Typography +// ------------------------- +.text-emphasis-variant(@color) { + color: @color; + &:hover { + color: darken(@color, 10%); + } +} + // Navbar vertical align // ------------------------- // Vertically center elements in the navbar. diff --git a/less/type.less b/less/type.less index 91496dc8c1..aaf654f70a 100644 --- a/less/type.less +++ b/less/type.less @@ -92,34 +92,19 @@ cite { font-style: normal; } color: @text-muted; } .text-primary { - color: @brand-primary; - &:hover { - color: darken(@brand-primary, 10%); - } + .text-emphasis-variant(@brand-primary); } .text-success { - color: @state-success-text; - &:hover { - color: darken(@state-success-text, 10%); - } + .text-emphasis-variant(@state-success-text); } .text-info { - color: @state-info-text; - &:hover { - color: darken(@state-info-text, 10%); - } + .text-emphasis-variant(@state-info-text); } .text-warning { - color: @state-warning-text; - &:hover { - color: darken(@state-warning-text, 10%); - } + .text-emphasis-variant(@state-warning-text); } .text-danger { - color: @state-danger-text; - &:hover { - color: darken(@state-danger-text, 10%); - } + .text-emphasis-variant(@state-danger-text); } // Contextual backgrounds