1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-16 10:06:54 +00:00
* Added: Preview of new theming system with custom colors.
* Changed: Start using the CSS color variables in more places.
* Fixed: Alignment of metadata in theater mode.
* Fixed: Custom chat font not applying to chat input.
* Fixed: Do not attempt to fetch uptime when there is no channel ID.
* Fixed: Hover state of emote menu section buttons.
* Fixed: Re-add pill rendering for FFZ menu button.
This commit is contained in:
SirStendec 2019-09-26 20:34:37 -04:00
parent 2232934309
commit a1949b0f8e
21 changed files with 451 additions and 266 deletions

View file

@ -8,6 +8,8 @@ import Module from 'utilities/module';
import {ManagedStyle} from 'utilities/dom';
import {has} from 'utilities/object';
const STYLE_VALIDATOR = document.createElement('span');
const CLASSES = {
'top-discover': '.top-nav__nav-link[data-a-target="discover-link"]',
'side-nav': '.side-nav',
@ -221,6 +223,17 @@ export default class CSSTweaks extends Module {
// Other?
this.settings.add('layout.theme.global-font', {
default: '',
ui: {
path: 'Appearance > Theme >> Fonts',
title: 'Font Family',
description: 'Override the font used for the entire Twitch website.',
component: 'setting-text-box'
},
changed: () => this.updateFont()
});
this.settings.add('channel.hide-live-indicator', {
requires: ['context.route.name'],
process(ctx, val) {
@ -282,6 +295,28 @@ export default class CSSTweaks extends Module {
this.toggleHide('side-closed-friends', friends === 2);
this.toggleHide('whispers', !this.settings.get('whispers.show'));
this.updateFont();
}
updateFont() {
let font = this.settings.get('layout.theme.global-font');
if ( font && font.length ) {
if ( font.indexOf(' ') !== -1 && font.indexOf(',') === -1 && font.indexOf('"') === -1 && font.indexOf("'") === -1 )
font = `"${font}"`;
STYLE_VALIDATOR.style.fontFamily = '';
STYLE_VALIDATOR.style.fontFamily = font;
if ( STYLE_VALIDATOR.style.fontFamily ) {
this.setVariable('global-font', font);
this.toggle('global-font', true);
return;
}
}
this.toggle('global-font', false);
this.deleteVariable('global-font');
}
toggleHide(key, val) {