logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/

select.vue (1650B)


  1. <template>
  2. <label
  3. class="Select input"
  4. :class="{ disabled, unstyled }"
  5. >
  6. <select
  7. :disabled="disabled"
  8. :value="modelValue"
  9. v-bind="$attrs"
  10. @change="$emit('update:modelValue', $event.target.value)"
  11. >
  12. <slot />
  13. </select>
  14. {{ ' ' }}
  15. <FAIcon
  16. v-if="!$attrs.size && !$attrs.multiple"
  17. class="select-down-icon"
  18. icon="chevron-down"
  19. />
  20. </label>
  21. </template>
  22. <script src="./select.js"> </script>
  23. <style lang="scss">
  24. /* TODO fix order of styles */
  25. label.Select {
  26. padding: 0;
  27. select {
  28. appearance: none;
  29. background: transparent;
  30. border: none;
  31. color: var(--text);
  32. margin: 0;
  33. padding: 0 2em 0 0.2em;
  34. font-family: var(--font);
  35. font-size: 1em;
  36. width: 100%;
  37. z-index: 1;
  38. height: 2em;
  39. line-height: 16px;
  40. &[multiple],
  41. &[size] {
  42. height: 100%;
  43. padding: 0.2em;
  44. option {
  45. background-color: transparent;
  46. &:checked,
  47. &.-active {
  48. color: var(--selectionText);
  49. background-color: var(--selectionBackground);
  50. }
  51. }
  52. }
  53. }
  54. &.disabled,
  55. &:disabled {
  56. background-color: var(--background);
  57. opacity: 1; /* override browser */
  58. color: var(--faint);
  59. select {
  60. &[multiple],
  61. &[size] {
  62. option.-active {
  63. color: var(--faint);
  64. background: transparent;
  65. }
  66. }
  67. }
  68. }
  69. .select-down-icon {
  70. position: absolute;
  71. top: 0;
  72. bottom: 0;
  73. right: 5px;
  74. height: 100%;
  75. width: 0.875em;
  76. font-family: var(--font);
  77. line-height: 2;
  78. z-index: 1;
  79. pointer-events: none;
  80. }
  81. }
  82. </style>