feat: Update select button styles to match button styles (#1742)

This commit is contained in:
Pranav Raj S
2021-02-08 18:27:20 +05:30
committed by GitHub
parent df0d7262b4
commit 88fd2c22d3
2 changed files with 24 additions and 28 deletions

View File

@@ -1,14 +1,17 @@
<template> <template>
<li class="option" :class="{ 'is-selected': isSelected }"> <li
class="option"
:class="{ 'is-selected': isSelected }"
:style="{ borderColor: widgetColor }"
>
<button class="option-button button" @click="onClick"> <button class="option-button button" @click="onClick">
<span v-if="isSelected" class="icon ion-checkmark-circled" /> <span :style="{ color: widgetColor }">{{ action.title }}</span>
<span v-else class="icon ion-android-radio-button-off" />
<span>{{ action.title }}</span>
</button> </button>
</li> </li>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex';
export default { export default {
components: {}, components: {},
props: { props: {
@@ -21,6 +24,11 @@ export default {
default: false, default: false,
}, },
}, },
computed: {
...mapGetters({
widgetColor: 'appConfig/getWidgetColor',
}),
},
methods: { methods: {
onClick() { onClick() {
this.$emit('click', this.action); this.$emit('click', this.action);
@@ -30,19 +38,21 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '~dashboard/assets/scss/variables.scss'; @import '~widget/assets/scss/variables.scss';
@import '~dashboard/assets/scss/mixins.scss';
.option { .option {
border: 1px solid $color-woot;
border-radius: $space-jumbo;
float: left;
margin: $space-smaller;
.option-button { .option-button {
width: 100%;
padding: 0;
max-height: $space-larger;
border-radius: 0;
background: transparent; background: transparent;
color: $color-woot; border-radius: $space-large;
border: 0; border: 0;
text-align: left; color: $color-woot;
cursor: pointer; cursor: pointer;
text-align: left;
span { span {
display: inline-block; display: inline-block;
@@ -54,15 +64,5 @@ export default {
font-size: $font-size-medium; font-size: $font-size-medium;
} }
} }
+ .option .option-button {
@include border-normal-top;
}
&.is-selected {
.option-button {
color: $success-color;
}
}
} }
</style> </style>

View File

@@ -67,19 +67,16 @@ export default {
} }
</style> </style>
<style scoped lang="scss"> <style scoped lang="scss">
@import '~dashboard/assets/scss/variables.scss'; @import '~widget/assets/scss/variables.scss';
@import '~dashboard/assets/scss/mixins.scss';
.options-message { .options-message {
background: white;
width: 60%;
max-width: 17rem; max-width: 17rem;
padding: $space-small $space-normal; padding: $space-small $space-normal;
border-radius: $space-small; border-radius: $space-small;
overflow: hidden; overflow: hidden;
.title { .title {
font-size: $font-size-small; font-size: $font-size-default;
font-weight: $font-weight-normal; font-weight: $font-weight-normal;
margin-top: $space-smaller; margin-top: $space-smaller;
margin-bottom: $space-smaller; margin-bottom: $space-smaller;
@@ -93,7 +90,6 @@ export default {
> li { > li {
list-style: none; list-style: none;
padding: 0; padding: 0;
margin: 0;
} }
} }
} }