diff options
| author | Egor Kislitsyn <egor@kislitsyn.com> | 2018-12-13 18:22:15 +0700 |
|---|---|---|
| committer | Egor Kislitsyn <egor@kislitsyn.com> | 2018-12-13 18:22:15 +0700 |
| commit | a8521fc8d99ee7ee5142e2c7c642eee0fc14ed93 (patch) | |
| tree | 53e98662ef34b8bccc845f627c125528c1c1436c /src/components/font_control/font_control.vue | |
| parent | b3455649c53034e01725977260e69cff59c47e87 (diff) | |
| parent | e443716bcd616ad61efae161624dd970841a935c (diff) | |
Merge commit 'e443716bcd616ad61efae161624dd970841a935c' into feature/push-subscriptions
# Conflicts:
# src/i18n/en.json
# src/modules/interface.js
# src/modules/users.js
# yarn.lock
Diffstat (limited to 'src/components/font_control/font_control.vue')
| -rw-r--r-- | src/components/font_control/font_control.vue | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/components/font_control/font_control.vue b/src/components/font_control/font_control.vue new file mode 100644 index 00000000..ed36b280 --- /dev/null +++ b/src/components/font_control/font_control.vue @@ -0,0 +1,54 @@ +<template> +<div class="font-control style-control" :class="{ custom: isCustom }"> + <label :for="preset === 'custom' ? name : name + '-font-switcher'" class="label"> + {{label}} + </label> + <input + v-if="typeof fallback !== 'undefined'" + class="opt exlcude-disabled" + type="checkbox" + :id="name + '-o'" + :checked="present" + @input="$emit('input', typeof value === 'undefined' ? fallback : undefined)"> + <label v-if="typeof fallback !== 'undefined'" class="opt-l" :for="name + '-o'"></label> + <label :for="name + '-font-switcher'" class="select" :disabled="!present"> + <select + :disabled="!present" + v-model="preset" + class="font-switcher" + :id="name + '-font-switcher'"> + <option v-for="option in availableOptions" :value="option"> + {{ option === 'custom' ? $t('settings.style.fonts.custom') : option }} + </option> + </select> + <i class="icon-down-open"/> + </label> + <input + v-if="isCustom" + class="custom-font" + type="text" + :id="name" + v-model="family"> +</div> +</template> + +<script src="./font_control.js" ></script> + +<style lang="scss"> +@import '../../_variables.scss'; +.font-control { + input.custom-font { + min-width: 10em; + } + &.custom { + .select { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + } + .custom-font { + border-top-left-radius: 0; + border-bottom-left-radius: 0; + } + } +} +</style> |
