From 776ad91843563cf23863b1f902f9a0f8d7130c27 Mon Sep 17 00:00:00 2001 From: bmauger Date: Thu, 23 Dec 2021 08:53:11 -0500 Subject: [PATCH] CSR-241 Add horizontal radio card. --- src/layouts/component-test/component-test.vue | 19 ++- src/ux-components/list-card/list-card.vue | 124 ++++++++++-------- 2 files changed, 87 insertions(+), 56 deletions(-) diff --git a/src/layouts/component-test/component-test.vue b/src/layouts/component-test/component-test.vue index a94d6b321..73d068cd3 100644 --- a/src/layouts/component-test/component-test.vue +++ b/src/layouts/component-test/component-test.vue @@ -90,7 +90,7 @@
List Card Demo +
+
+
Horizontal as Radio Button
+
+ List Card Demo + +
+
+

List Button - Single-Line

diff --git a/src/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue index b31ce3d38..6ce2d5561 100644 --- a/src/ux-components/list-card/list-card.vue +++ b/src/ux-components/list-card/list-card.vue @@ -1,5 +1,5 @@ @@ -65,23 +77,23 @@ export default { position: fixed; width: 0; + label { - display: block; - position: relative; - &:hover { - cursor: pointer; - } - } - &:focus + label { - box-shadow: 0 0 0 2.5px $blue; - border-radius: .5rem; - } - &:checked + label { - background: $blue-100; - box-shadow: 0 0 0 1px $blue; - border-radius: .5rem; - } - + label::before { - content: ""; + display: block; + position: relative; + &:hover { + cursor: pointer; + } + } + &:focus + label { + box-shadow: 0 0 0 2.5px $blue; + border-radius: .5rem; + } + &:checked + label { + background: $blue-100; + box-shadow: 0 0 0 1px $blue; + border-radius: .5rem; + } + + label::before { + content: ""; position: absolute; display: flex; margin: 0 auto; @@ -92,45 +104,39 @@ export default { border: 1px solid $gray-500; border-radius: 2px; order: 2; - } - + label.checkboxTop::before { - margin: -1.25rem 0.5rem 0 0 !important; - } - + label.checkboxTop::after { - margin: -1.5rem 0.5rem 0 0 !important; - } - &:checked + label::before { - background: $blue; - } - &:checked + label::after { - content: ''; - position: absolute; - margin: 3.2rem 0 0 0; - border-left: 2px solid $white; - border-bottom: 2px solid $white; - height: 6px; - width: 11px; - transform: rotate(-45deg); - } - &:disabled + label { - color: #575757; - } - &:disabled + label::before { - background: #ddd; - } + } + + label.checkboxTop::before { + margin: -1.25rem 0.5rem 0 0 !important; + } + + label.checkboxTop::after { + margin: -1.5rem 0.5rem 0 0 !important; + } + &:checked + label::before { + background: $blue; + } + &:checked + label::after { + content: ''; + position: absolute; + margin: 3.2rem 0 0 0; + border-left: 2px solid $white; + border-bottom: 2px solid $white; + height: 6px; + width: 11px; + transform: rotate(-45deg); + } } input[type="radio"] { + label::before { content: ""; - display: none; + display: none; } + label::after { content: ""; - display: none; + display: none; } + label { img { - margin-bottom: 1rem; + margin-bottom: 0; } } } @@ -142,16 +148,24 @@ export default { input[type="radio"] { + label::before { content: ""; - position: relative; - margin: 0 .5rem 0 0; - order: 1; + position: relative; + margin: 0 .5rem 0 0; + order: 1; } &:checked + label::after { content: ''; margin: -0.25rem 0 0 0; left: .875rem; } + + label { + img { + margin-bottom: 0; + } + } } } + &.error { + border: 1px solid $red !important; + } }