aboutsummaryrefslogtreecommitdiff
path: root/src/components/select/select.vue
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2021-03-11 16:11:44 +0200
committerHenry Jameson <me@hjkos.com>2021-03-11 16:11:44 +0200
commitc6d4c20982261b55b16dda59c3e657eb1feb0041 (patch)
tree1c3051d5c1ce59b02cb2eaaac78a05835c20250e /src/components/select/select.vue
parent6281241b92bc17a9535b15a52e656b9f218e3322 (diff)
Made Select component to make using styled selects easier
Diffstat (limited to 'src/components/select/select.vue')
-rw-r--r--src/components/select/select.vue67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/components/select/select.vue b/src/components/select/select.vue
new file mode 100644
index 00000000..a27a2541
--- /dev/null
+++ b/src/components/select/select.vue
@@ -0,0 +1,67 @@
+
+<template>
+ <label
+ class="Select input"
+ :class="{ disabled }"
+ >
+ <select
+ :disabled="disabled"
+ :value="value"
+ @change="$emit('change', $event.target.value)"
+ >
+ <slot />
+ </select>
+ <FAIcon
+ class="select-down-icon"
+ icon="chevron-down"
+ />
+ </label>
+</template>
+
+<script>
+import { library } from '@fortawesome/fontawesome-svg-core'
+import {
+ faChevronDown
+} from '@fortawesome/free-solid-svg-icons'
+
+library.add(
+ faChevronDown
+)
+export default {
+ model: {
+ prop: 'value',
+ event: 'change'
+ },
+ props: [
+ 'value',
+ 'disabled'
+ ]
+}
+</script>
+
+<style lang="scss">
+@import '../../_variables.scss';
+
+.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(--inputFont, sans-serif);
+ font-size: 14px;
+ width: 100%;
+ z-index: 1;
+ height: 28px;
+ line-height: 16px;
+ }
+}
+</style>