diff --git a/app/soapbox/actions/soapbox.js b/app/soapbox/actions/soapbox.js index ac8749221..2871e2aae 100644 --- a/app/soapbox/actions/soapbox.js +++ b/app/soapbox/actions/soapbox.js @@ -41,7 +41,47 @@ export const makeDefaultConfig = features => { banner: '', brandColor: '', // Empty accentColor: '', - colors: ImmutableMap(), + colors: ImmutableMap({ + gray: ImmutableMap({ + 50: '#f9fafb', + 100: '#f3f4f6', + 200: '#e5e7eb', + 300: '#d1d5db', + 400: '#9ca3af', + 500: '#6b7280', + 600: '#4b5563', + 700: '#374151', + 800: '#1f2937', + 900: '#111827', + }), + success: ImmutableMap({ + 50: '#f0fdf4', + 100: '#dcfce7', + 200: '#bbf7d0', + 300: '#86efac', + 400: '#4ade80', + 500: '#22c55e', + 600: '#16a34a', + 700: '#15803d', + 800: '#166534', + 900: '#14532d', + }), + danger: ImmutableMap({ + 50: '#fef2f2', + 100: '#fee2e2', + 200: '#fecaca', + 300: '#fca5a5', + 400: '#f87171', + 500: '#ef4444', + 600: '#dc2626', + 700: '#b91c1c', + 800: '#991b1b', + 900: '#7f1d1d', + }), + 'gradient-purple': '#b8a3f9', + 'gradient-blue': '#9bd5ff', + 'sea-blue': '#2feecc', + }), customCss: ImmutableList(), promoPanel: ImmutableMap({ items: ImmutableList(), @@ -73,7 +113,8 @@ export const getSoapboxConfig = createSelector([ state => state.get('soapbox'), state => getFeatures(state.get('instance')), ], (soapbox, features) => { - return makeDefaultConfig(features).merge(soapbox); + const defaultConfig = makeDefaultConfig(features); + return soapbox.mergeDeepWith((o, n) => o || n, defaultConfig); }); export function rememberSoapboxConfig(host) { diff --git a/app/soapbox/containers/soapbox.js b/app/soapbox/containers/soapbox.js index 3571a687d..4dcfdafb7 100644 --- a/app/soapbox/containers/soapbox.js +++ b/app/soapbox/containers/soapbox.js @@ -25,7 +25,7 @@ import { createGlobals } from 'soapbox/globals'; import messages from 'soapbox/locales/messages'; import { makeGetAccount } from 'soapbox/selectors'; import SoapboxPropTypes from 'soapbox/utils/soapbox_prop_types'; -import { themeColorsToCSS } from 'soapbox/utils/theme'; +import { generateThemeCss } from 'soapbox/utils/theme'; import { INTRODUCTION_VERSION } from '../actions/onboarding'; import { preload } from '../actions/preload'; @@ -84,7 +84,7 @@ const mapStateToProps = (state) => { dyslexicFont: settings.get('dyslexicFont'), demetricator: settings.get('demetricator'), locale: validLocale(locale) ? locale : 'en', - themeCss: themeColorsToCSS(soapboxConfig.get('brandColor') || '#0482d8', soapboxConfig.get('accentColor', '')), + themeCss: generateThemeCss(soapboxConfig), brandColor: soapboxConfig.get('brandColor'), themeMode: settings.get('themeMode'), singleUserMode, diff --git a/app/soapbox/features/soapbox_config/components/site_preview.js b/app/soapbox/features/soapbox_config/components/site_preview.js index 47a4c9ae1..b4506dd81 100644 --- a/app/soapbox/features/soapbox_config/components/site_preview.js +++ b/app/soapbox/features/soapbox_config/components/site_preview.js @@ -3,7 +3,7 @@ import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { defaultSettings } from 'soapbox/actions/settings'; -import { themeColorsToCSS } from 'soapbox/utils/theme'; +import { generateThemeCss } from 'soapbox/utils/theme'; export default function SitePreview({ soapbox }) { @@ -18,7 +18,7 @@ export default function SitePreview({ soapbox }) { return (