Merge pull request #801 from Safelite/defect/CSR-918

Defect/csr 918
This commit is contained in:
katieoh-safelite 2022-11-04 14:30:25 -04:00 committed by GitHub
commit 2041b3f17d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 46 additions and 57 deletions

View file

@ -23,4 +23,5 @@ export default {
@import "@/styles/common-typography-styles.scss"; @import "@/styles/common-typography-styles.scss";
@import "@/styles/common-error-styles.scss"; @import "@/styles/common-error-styles.scss";
@import "@/styles/common-animations.scss"; @import "@/styles/common-animations.scss";
@import "@/styles/shared-input-button-styles.scss";
</style> </style>

View file

@ -1,6 +1,6 @@
<template> <template>
<label <label
:class="[buttonWrapperClasses, { 'has-error': errors.length > 0 }]" :class="[buttonWrapperClasses, { 'has-error': errors.length > 0, selected: isChecked }]"
:for="buttonId" :for="buttonId"
@focusin="handleFocus" @focusin="handleFocus"
@focusout="handleBlur" @focusout="handleBlur"

View file

@ -1,15 +1,33 @@
html { html {
.has-error { .has-error {
// START HOVER
&.list-button-horizontal,
&.list-button, &.list-button,
&.list-card, &.list-card {
&.list-button-horizontal {
border: 1px solid $red; border: 1px solid $red;
position: relative;
z-index: 4;
.button-content { .button-content {
border: none; border: none;
} }
&:hover {
@include box-shadow-hover($red-200);
z-index: 5;
}
} }
&.ui-radio {
&:hover {
input[type="radio"],
input[type="checkbox"] {
@include box-shadow-hover($red-200);
}
}
}
// END HOVER
&.list-button, &.list-button,
&.list-card { &.list-card {
color: $red; color: $red;
@ -22,27 +40,11 @@ html {
box-shadow: 0 0 0 1px $red; box-shadow: 0 0 0 1px $red;
} }
&:hover { &:hover {
box-shadow: 0px 0px 0px 4px $red-200;
border-radius: 0.5rem; border-radius: 0.5rem;
} }
label {
border: 1px solid $red;
border-radius: 0.5rem;
}
label:hover {
box-shadow: 0px 0px 0px 4px $red-200;
border-radius: 10px;
border: 1px solid $red;
}
} }
&.list-button-horizontal { &.list-button-horizontal {
color: $red; color: $red;
label {
border: 1px solid $red;
&:hover {
box-shadow: 0px 0px 0px 4px $red-200;
}
}
input[type="checkbox"]:focus + label, input[type="checkbox"]:focus + label,
input[type="radio"]:focus + label { input[type="radio"]:focus + label {
box-shadow: 0 0 1px $red; box-shadow: 0 0 1px $red;

View file

@ -4,3 +4,7 @@
@mixin blue-gradient { @mixin blue-gradient {
background: linear-gradient(270deg, $blue 0%, $blue-800 100%); background: linear-gradient(270deg, $blue 0%, $blue-800 100%);
} }
@mixin box-shadow-hover($color) {
box-shadow: 0 0 0 4px $color;
}

View file

@ -0,0 +1,15 @@
.base-input-button {
&:not(.has-error):hover {
cursor: pointer;
&.list-button,
&.list-button-horizontal,
&.list-card {
&:not(.selected) {
position: relative;
z-index: 4;
@include box-shadow-hover($blue-300);
}
}
}
}

View file

@ -2,7 +2,7 @@
<baseInputButton <baseInputButton
v-bind="$props" v-bind="$props"
:buttonWrapperClasses="[ :buttonWrapperClasses="[
'list-group list-button-horizontal d-flex flex-column w-100', 'list-group list-button-horizontal d-flex flex-column w-100 base-input-button',
{ strong: isStrongStyling }, { strong: isStrongStyling },
]" ]"
v-model="selectedValue"> v-model="selectedValue">
@ -88,18 +88,6 @@ export default {
width: 100%; width: 100%;
color: $gray-600; color: $gray-600;
&:hover {
@include media-breakpoint-up(sm) {
box-shadow: 0 0 0 4px $blue-300;
cursor: pointer;
z-index: 4 !important;
}
}
+ p {
display: none;
}
span { span {
font-size: 0.875rem; font-size: 0.875rem;
} }

View file

@ -1,7 +1,7 @@
<template> <template>
<baseInputButton <baseInputButton
v-bind="$props" v-bind="$props"
buttonWrapperClasses="list-group list-button rounded-3 d-flex flex-column w-100 mb-2" buttonWrapperClasses="list-group base-input-button list-button rounded-3 d-flex flex-column w-100 mb-2"
v-model="selectedValue"> v-model="selectedValue">
<div <div
:aria-label="buttonLabel" :aria-label="buttonLabel"
@ -111,16 +111,6 @@ export default {
color: $gray-550; color: $gray-550;
} }
} }
&:hover {
@include media-breakpoint-up(sm) {
box-shadow: 0 0 0 4px $blue-300;
}
cursor: pointer;
}
+ p {
display: none;
}
} }
} }
</style> </style>

View file

@ -2,7 +2,7 @@
<baseInputButton <baseInputButton
v-bind="$props" v-bind="$props"
:buttonWrapperClasses="[ :buttonWrapperClasses="[
'list-card w-100 rounded-3 d-flex align-items-center h-100', 'list-card w-100 rounded-3 d-flex align-items-center h-100 base-input-button',
{ horizontal: isWide }, { horizontal: isWide },
]" ]"
v-model="selectedValue"> v-model="selectedValue">
@ -88,13 +88,6 @@ export default {
max-width: 100%; max-width: 100%;
} }
&:hover {
@include media-breakpoint-up(sm) {
box-shadow: 0px 0px 0px 4px $blue-300;
border: 1px solid transparent;
}
}
input[type="checkbox"], input[type="checkbox"],
input[type="radio"] { input[type="radio"] {
position: absolute; position: absolute;
@ -104,10 +97,6 @@ export default {
display: block; display: block;
position: relative; position: relative;
&:hover {
cursor: pointer;
}
p { p {
color: $gray-600; color: $gray-600;
text-align: center; text-align: center;

View file

@ -1,7 +1,7 @@
<template> <template>
<baseInputButton <baseInputButton
v-bind="$props" v-bind="$props"
buttonWrapperClasses="ui-radio form-check" buttonWrapperClasses="ui-radio form-check base-input-button"
inputClasses="form-check-input" inputClasses="form-check-input"
v-model="selectedValue"> v-model="selectedValue">
<div class="d-flex align-items-start form-check-label"> <div class="d-flex align-items-start form-check-label">
@ -64,7 +64,7 @@ export default {
} }
&:hover { &:hover {
.form-check-input { .form-check-input:not(:checked) {
box-shadow: 0 0 0 4px $blue-300; box-shadow: 0 0 0 4px $blue-300;
} }
} }