From 4cb24ebd3699a0e965380eb285a7c5eab9f2bee8 Mon Sep 17 00:00:00 2001 From: vantezzen Date: Fri, 1 Nov 2019 13:04:17 +0100 Subject: #172 Add additional accent styles to fix styling options --- src/features/accentColor/index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/features') diff --git a/src/features/accentColor/index.js b/src/features/accentColor/index.js index a0f57a2fa..90fbcab43 100644 --- a/src/features/accentColor/index.js +++ b/src/features/accentColor/index.js @@ -4,6 +4,15 @@ import { DEFAULT_APP_SETTINGS } from '../../config'; const STYLE_ELEMENT_ID = 'accent-color'; +// Additional styles needed to make accent colors work properly +// "[ACCENT]" will be replaced with the accent color +const ADDITIONAL_STYLES = ` +.franz-form__button { + background: inherit !important; + border: 2px solid [ACCENT] !important; +} +`; + function createAccentStyleElement() { const styles = document.createElement('style'); styles.id = STYLE_ELEMENT_ID; @@ -13,6 +22,7 @@ function createAccentStyleElement() { function setAccentStyle(style) { const styleElement = document.getElementById(STYLE_ELEMENT_ID); + styleElement.innerHTML = style; } @@ -27,6 +37,8 @@ function generateAccentStyle(color) { `; }); + style += ADDITIONAL_STYLES.replace(/\[ACCENT\]/g, color); + return style; } -- cgit v1.2.3-54-g00ecf