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

65 lines
1.2 KiB
Vue
Raw Normal View History

<template>
<label
class="Select input"
2021-03-11 14:31:15 +00:00
:class="{ disabled, unstyled }"
>
<select
:disabled="disabled"
2022-03-21 20:00:25 +00:00
:value="modelValue"
@change="$emit('update:modelValue', $event.target.value)"
>
<slot />
</select>
2022-03-23 14:15:05 +00:00
{{ ' ' }}
<FAIcon
class="select-down-icon"
icon="chevron-down"
/>
</label>
</template>
2021-03-11 14:19:11 +00:00
<script src="./select.js"> </script>
<style lang="scss">
@import '../../_variables.scss';
2022-03-17 07:06:05 +00:00
/* TODO fix order of styles */
label.Select {
padding: 0;
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background: transparent;
border: none;
color: $fallback--text;
color: var(--inputText, --text, $fallback--text);
margin: 0;
padding: 0 2em 0 .2em;
font-family: sans-serif;
font-family: var(--interfaceFont, sans-serif);
2022-04-20 20:22:51 +00:00
font-size: 1em;
width: 100%;
z-index: 1;
2022-04-20 20:22:51 +00:00
height: 2em;
line-height: 16px;
}
2021-03-11 14:31:15 +00:00
.select-down-icon {
position: absolute;
top: 0;
bottom: 0;
right: 5px;
height: 100%;
2022-03-15 19:00:52 +00:00
width: 0.875em;
2021-03-11 14:31:15 +00:00
color: $fallback--text;
color: var(--inputText, $fallback--text);
2022-04-20 20:22:51 +00:00
line-height: 2;
2021-03-11 14:31:15 +00:00
z-index: 0;
pointer-events: none;
}
}
</style>