akkoma-fe/src/components/contrast_ratio/contrast_ratio.vue

51 lines
1 KiB
Vue
Raw Normal View History

2018-10-09 21:07:28 +00:00
<template>
2018-11-13 13:30:01 +00:00
<span class="contrast-ratio">
<span :title="`Contrast is ${contrast.text}`" class="rating">
<span v-if="contrast.aaa">
<i class="icon-thumbs-up-alt"/>
</span>
<span v-if="!contrast.aaa && contrast.aa">
<i class="icon-adjust"/>
2018-10-09 21:07:28 +00:00
</span>
2018-11-13 13:30:01 +00:00
<span v-if="!contrast.aaa && !contrast.aa">
<i class="icon-attention"/>
2018-10-09 21:07:28 +00:00
</span>
</span>
2018-11-13 13:30:01 +00:00
<span class="rating" v-if="large" :title="`Contrast is ${contrast.text} (18pt+)`">
<span v-if="contrast.aaa">
<i class="icon-thumbs-up-alt"/>
</span>
<span v-if="!contrast.aaa && contrast.aa">
<i class="icon-adjust"/>
2018-10-09 21:07:28 +00:00
</span>
2018-11-13 13:30:01 +00:00
<span v-if="!contrast.aaa && !contrast.aa">
<i class="icon-attention"/>
2018-10-09 21:07:28 +00:00
</span>
</span>
2018-11-13 13:30:01 +00:00
</span>
2018-10-09 21:07:28 +00:00
</template>
<script>
export default {
props: [
'large', 'contrast'
]
}
</script>
<style lang="scss">
.contrast-ratio {
display: flex;
justify-content: end;
.label {
margin-right: 1em;
}
.rating {
display: inline-block;
text-align: center;
}
}
</style>