v-card-info.vue 1.42 KB
Newer Older
NGPixel's avatar
NGPixel committed
1 2
<template lang='pug'>
  .v-card-info(:class='`is-` + color')
3
    v-card-text.d-flex.align-center(:class='colors.cls')
NGPixel's avatar
NGPixel committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
      v-icon(:color='colors.icon', left) {{icon}}
      slot
</template>

<script>
export default {
  props: {
    color: {
      type: String,
      default: 'blue'
    },
    icon: {
      type: String,
      default: 'mdi-information-outline'
    }
  },
  computed: {
    colors () {
      switch (this.color) {
        case 'blue':
          return {
25
            cls: this.$vuetify.theme.dark ? 'grey darken-4-l5 blue--text text--lighten-4' : 'blue lighten-5 blue--text text--darken-3',
NGPixel's avatar
NGPixel committed
26 27 28 29
            icon: 'blue lighten-3'
          }
        case 'red':
          return {
30
            cls: this.$vuetify.theme.dark ? 'grey darken-4-l5 red--text text--lighten-4' : 'red lighten-5 red--text text--darken-2',
NGPixel's avatar
NGPixel committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
            icon: 'red lighten-3'
          }
        default:
          return {
            cls: this.$vuetify.theme.dark ? 'grey darken-4-l5' : 'grey lighten-4',
            icon: 'grey darken-2'
          }
      }
    }
  }
}
</script>

<style lang="scss">
.v-card-info {
  border-bottom: 1px solid #EEE;

  &.is-blue {
    border-bottom-color: mc('blue', '100');
50 51 52 53

    @at-root .theme--dark & {
      border-bottom-color: rgba(mc('blue', '100'), .3);
    }
NGPixel's avatar
NGPixel committed
54 55 56 57
  }

  &.is-red {
    border-bottom-color: mc('red', '100');
58 59 60 61

    @at-root .theme--dark & {
      border-bottom-color: rgba(mc('red', '100'), .3);
    }
NGPixel's avatar
NGPixel committed
62 63 64
  }
}
</style>