From 895559d431a91f9f13e75571d4db1b7baad43fc9 Mon Sep 17 00:00:00 2001 From: Isaac Lyman Date: Wed, 25 Sep 2019 12:15:04 -0600 Subject: [PATCH 01/14] style(tile): remove underscore from css file fixes #530 --- projects/cashmere/src/lib/sass/{_tile.scss => tile.scss} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename projects/cashmere/src/lib/sass/{_tile.scss => tile.scss} (100%) diff --git a/projects/cashmere/src/lib/sass/_tile.scss b/projects/cashmere/src/lib/sass/tile.scss similarity index 100% rename from projects/cashmere/src/lib/sass/_tile.scss rename to projects/cashmere/src/lib/sass/tile.scss From cce14bedb7088cf9f4e6aa4427a75aa591caf315 Mon Sep 17 00:00:00 2001 From: Isaac Lyman Date: Wed, 25 Sep 2019 13:18:30 -0600 Subject: [PATCH 02/14] refactor(tab): convert tabs to mixins fixes #529 --- projects/cashmere/src/lib/sass/tab.scss | 88 +++++++++++++++++++ .../lib/tabs/tab-set/tab-set.component.scss | 27 ++---- .../src/lib/tabs/tab/tab.component.scss | 37 ++------ 3 files changed, 103 insertions(+), 49 deletions(-) create mode 100644 projects/cashmere/src/lib/sass/tab.scss diff --git a/projects/cashmere/src/lib/sass/tab.scss b/projects/cashmere/src/lib/sass/tab.scss new file mode 100644 index 000000000..cc12a4930 --- /dev/null +++ b/projects/cashmere/src/lib/sass/tab.scss @@ -0,0 +1,88 @@ +@import './colors'; + +// tab + +@mixin hc-tab() { + min-width: 0; +} + +@mixin hc-tab-vertical() { + background-color: $white; + color: $offblack; + display: block; + padding: 20px; + text-decoration: none; + + &:hover { + cursor: pointer; + } +} + +@mixin hc-tab-vertical-active() { + background-color: $slate-gray-100; + border-left: $blue 8px solid; + color: $blue; + font-weight: 600; + padding-left: 12px; +} + +@mixin hc-tab-horizontal() { + background-color: inherit; + color: $offblack; + display: block; + font-size: 14px; + min-width: 100px; + padding: 10px 20px; + text-align: center; + text-decoration: none; + + &:hover { + cursor: pointer; + } +} + +@mixin hc-tab-horizontal-active() { + border-bottom: $blue 4px solid; + color: $offblack; + font-weight: bold; +} + + +// tab-set + +@mixin hc-tab-set-container-horizontal() { + height: auto; + width: 100%; +} + +@mixin hc-tab-set-bar-horizontal() { + align-items: baseline; + background-color: inherit; + border-bottom: 1px solid $slate-gray-300; + display: flex; + flex-direction: row; +} + +@mixin hc-tab-set-content-horizontal() { + background-color: inherit; + height: 100%; + overflow: auto; + width: 100%; +} + +@mixin hc-tab-set-container-vertical() { + display: flex; + height: 100%; + width: 100%; +} + +@mixin hc-tab-set-bar-vertical() { + background-color: $white; + padding: 15px 0; + width: 20%; +} + +@mixin hc-tab-set-content-vertical() { + background-color: $slate-gray-100; + width: 80%; +} diff --git a/projects/cashmere/src/lib/tabs/tab-set/tab-set.component.scss b/projects/cashmere/src/lib/tabs/tab-set/tab-set.component.scss index 9b43d5df4..0af39385b 100644 --- a/projects/cashmere/src/lib/tabs/tab-set/tab-set.component.scss +++ b/projects/cashmere/src/lib/tabs/tab-set/tab-set.component.scss @@ -1,38 +1,25 @@ -@import '../../sass/colors'; +@import '../../sass/tab.scss'; .hc-horizontal-tab-container { - height: auto; - width: 100%; + @include hc-tab-set-container-horizontal(); } .hc-tab-bar-horizontal { - background-color: inherit; - display: flex; - flex-direction: row; - border-bottom: 1px solid $slate-gray-300; - align-items: baseline; + @include hc-tab-set-bar-horizontal(); } .hc-tab-content-horizontal { - background-color: inherit; - width: 100%; - height: 100%; - overflow: auto; + @include hc-tab-set-content-horizontal(); } .hc-vertical-tab-container { - height: 100%; - width: 100%; - display: flex; + @include hc-tab-set-container-vertical(); } .hc-tab-bar-vertical { - padding: 15px 0; - background-color: $white; - width: 20%; + @include hc-tab-set-bar-vertical(); } .hc-tab-content-vertical { - background-color: $slate-gray-100; - width: 80%; + @include hc-tab-set-content-vertical(); } \ No newline at end of file diff --git a/projects/cashmere/src/lib/tabs/tab/tab.component.scss b/projects/cashmere/src/lib/tabs/tab/tab.component.scss index 5c7023b64..ee9d5bdd2 100644 --- a/projects/cashmere/src/lib/tabs/tab/tab.component.scss +++ b/projects/cashmere/src/lib/tabs/tab/tab.component.scss @@ -1,42 +1,21 @@ -@import '../../sass/colors'; +@import '../../sass/tab.scss'; :host { - min-width: 0; + @include hc-tab(); } .hc-tab-vertical { - background-color: $white; - color: $offblack; - padding: 20px; - display: block; - text-decoration: none; - &:hover { - cursor: pointer; - } + @include hc-tab-vertical(); + &.active { - background-color: $slate-gray-100; - border-left: $blue 8px solid; - color: $blue; - font-weight: 600; - padding-left: 12px; + @include hc-tab-vertical-active(); } } .hc-tab-horizontal { - background-color: inherit; - color: $offblack; - font-size: 14px; - padding: 10px 20px; - text-decoration: none; - display: block; - min-width: 100px; - text-align: center; - &:hover { - cursor: pointer; - } + @include hc-tab-horizontal(); + &.active { - border-bottom: $blue 4px solid; - color: $offblack; - font-weight: bold; + @include hc-tab-horizontal-active(); } } \ No newline at end of file From bf654a6a827a07344b80a0a56fafe6dc55b29d1a Mon Sep 17 00:00:00 2001 From: Isaac Lyman Date: Wed, 25 Sep 2019 14:13:14 -0600 Subject: [PATCH 03/14] refactor(radio): convert radio to mixins fixes #524 --- .../radio-button/radio-button.component.html | 8 +- .../radio-button/radio-button.component.scss | 85 ++++++------------- .../cashmere/src/lib/sass/radio-button.scss | 80 +++++++++++++++++ 3 files changed, 109 insertions(+), 64 deletions(-) create mode 100644 projects/cashmere/src/lib/sass/radio-button.scss diff --git a/projects/cashmere/src/lib/radio-button/radio-button.component.html b/projects/cashmere/src/lib/radio-button/radio-button.component.html index a14b4bae0..b897150c3 100644 --- a/projects/cashmere/src/lib/radio-button/radio-button.component.html +++ b/projects/cashmere/src/lib/radio-button/radio-button.component.html @@ -1,5 +1,7 @@ -