diff --git a/app/soapbox/features/soapbox_config/components/site-preview.tsx b/app/soapbox/features/soapbox_config/components/site-preview.tsx index 36cbe5ca8..12a5a1de3 100644 --- a/app/soapbox/features/soapbox_config/components/site-preview.tsx +++ b/app/soapbox/features/soapbox_config/components/site-preview.tsx @@ -1,7 +1,9 @@ import classNames from 'classnames'; import React, { useMemo } from 'react'; +import { FormattedMessage } from 'react-intl'; import { defaultSettings } from 'soapbox/actions/settings'; +import BackgroundShapes from 'soapbox/features/ui/components/background_shapes'; import { normalizeSoapboxConfig } from 'soapbox/normalizers'; import { generateThemeCss } from 'soapbox/utils/theme'; @@ -15,33 +17,33 @@ const SitePreview: React.FC = ({ soapbox }) => { const soapboxConfig = useMemo(() => normalizeSoapboxConfig(soapbox), [soapbox]); const settings = defaultSettings.mergeDeep(soapboxConfig.defaultSettings); - const bodyClass = classNames('site-preview', `theme-mode-${settings.get('themeMode')}`, { - 'no-reduce-motion': !settings.get('reduceMotion'), - 'underline-links': settings.get('underlineLinks'), - 'dyslexic': settings.get('dyslexicFont'), - 'demetricator': settings.get('demetricator'), - }); + const dark = settings.get('themeMode') === 'dark'; + + const bodyClass = classNames( + 'site-preview', + 'relative flex justify-center align-center text-base', + 'border border-solid border-gray-200 dark:border-slate-600', + 'h-40 rounded-lg overflow-hidden', + { + 'bg-white': !dark, + 'bg-slate-900': dark, + }); return (
-
-
-
- -
- Site Preview -
-
-
+ + +
+ +
+ +
+ Logo
); diff --git a/app/soapbox/features/ui/components/background_shapes.tsx b/app/soapbox/features/ui/components/background_shapes.tsx index 82809909b..bc4e3694c 100644 --- a/app/soapbox/features/ui/components/background_shapes.tsx +++ b/app/soapbox/features/ui/components/background_shapes.tsx @@ -1,8 +1,14 @@ +import classNames from 'classnames'; import React from 'react'; +interface IBackgroundShapes { + /** Whether the shapes should be absolute positioned or fixed. */ + position?: 'fixed' | 'absolute', +} + /** Gradient that appears in the background of the UI. */ -const BackgroundShapes: React.FC = () => ( -
+const BackgroundShapes: React.FC = ({ position = 'fixed' }) => ( +
diff --git a/app/styles/forms.scss b/app/styles/forms.scss index 6c0625572..82bda6714 100644 --- a/app/styles/forms.scss +++ b/app/styles/forms.scss @@ -776,36 +776,6 @@ code { transform: translateY(7px); } -.site-preview { - border-radius: 4px; - overflow: hidden; - height: 164px; - border: 1px solid; - margin-bottom: 40px; - background: var(--background-color); - - * { - z-index: 0; - } - - a { - cursor: default; - } - - .ui { - display: flex; - flex-direction: column; - padding: 0; - height: 100%; - } - - .page { - align-items: center; - justify-content: center; - height: 100%; - } -} - .input.with_label.toggle .label_input { display: flex; font-size: 14px; diff --git a/app/styles/truth.scss b/app/styles/truth.scss index 8b4eaf5a8..5c7e1770f 100644 --- a/app/styles/truth.scss +++ b/app/styles/truth.scss @@ -34,13 +34,6 @@ background-color: var(--brand-color) !important; } -body, -.site-preview { - --accent-color_h: 345; - --accent-color_s: 100%; - --accent-color_l: 64%; -} - @media screen and (max-width: 450px) { .tabs-bar__link--logo { margin: 0 auto;