logo

pleroma-fe

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

font_control.vue (1657B)


  1. <template>
  2. <div
  3. class="font-control style-control"
  4. :class="{ custom: isCustom }"
  5. >
  6. <label
  7. :id="name + '-label'"
  8. :for="preset === 'custom' ? name : name + '-font-switcher'"
  9. class="label"
  10. >
  11. {{ label }}
  12. </label>
  13. <input
  14. v-if="typeof fallback !== 'undefined'"
  15. :id="name + '-o'"
  16. :aria-labelledby="name + '-label'"
  17. class="input -checkbox opt exlcude-disabled visible-for-screenreader-only"
  18. type="checkbox"
  19. :checked="present"
  20. @change="$emit('update:modelValue', typeof modelValue === 'undefined' ? fallback : undefined)"
  21. >
  22. <label
  23. v-if="typeof fallback !== 'undefined'"
  24. class="opt-l"
  25. :for="name + '-o'"
  26. :aria-hidden="true"
  27. />
  28. {{ ' ' }}
  29. <Select
  30. :id="name + '-font-switcher'"
  31. v-model="preset"
  32. :disabled="!present"
  33. class="font-switcher"
  34. >
  35. <option
  36. v-for="option in availableOptions"
  37. :key="option"
  38. :value="option"
  39. >
  40. {{ option === 'custom' ? $t('settings.style.fonts.custom') : option }}
  41. </option>
  42. </Select>
  43. <input
  44. v-if="isCustom"
  45. :id="name"
  46. v-model="family"
  47. class="input custom-font"
  48. type="text"
  49. >
  50. </div>
  51. </template>
  52. <script src="./font_control.js"></script>
  53. <style lang="scss">
  54. .font-control {
  55. input.custom-font {
  56. min-width: 10em;
  57. }
  58. &.custom {
  59. /* TODO Should make proper joiners... */
  60. .font-switcher {
  61. border-top-right-radius: 0;
  62. border-bottom-right-radius: 0;
  63. }
  64. .custom-font {
  65. border-top-left-radius: 0;
  66. border-bottom-left-radius: 0;
  67. }
  68. }
  69. }
  70. </style>