Start adding dark mode

merge-requests/1136/head
Alex Gleason 2022-03-23 19:18:37 -05:00
rodzic 8970e4e3db
commit 793b0f9128
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
15 zmienionych plików z 36 dodań i 30 usunięć

Wyświetl plik

@ -10,7 +10,7 @@
"font-family-no-missing-generic-family-keyword": [true, { "ignoreFontFamilies": ["ForkAwesome", "Font Awesome 5 Free", "OpenDyslexic", "soapbox"] }], "font-family-no-missing-generic-family-keyword": [true, { "ignoreFontFamilies": ["ForkAwesome", "Font Awesome 5 Free", "OpenDyslexic", "soapbox"] }],
"no-descending-specificity": null, "no-descending-specificity": null,
"no-duplicate-selectors": null, "no-duplicate-selectors": null,
"scss/at-rule-no-unknown": [true, { "ignoreAtRules": ["/tailwind/"]}], "scss/at-rule-no-unknown": [true, { "ignoreAtRules": ["/tailwind/", "layer"]}],
"no-invalid-position-at-import-rule": [true, { "ignoreAtRules": ["/tailwind/"]}] "no-invalid-position-at-import-rule": null
} }
} }

Wyświetl plik

@ -257,7 +257,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
<Textarea <Textarea
ref={this.setTextarea} ref={this.setTextarea}
className={classNames('px-0 border-0 text-gray-800 placeholder:text-color-400 resize-none w-full focus:shadow-none focus:border-0 focus:ring-0', { className={classNames('dark:bg-slate-800 px-0 border-0 text-gray-800 dark:text-white placeholder:text-color-400 resize-none w-full focus:shadow-none focus:border-0 focus:ring-0', {
'min-h-[100px]': !condensed, 'min-h-[100px]': !condensed,
})} })}
id={id} id={id}

Wyświetl plik

@ -607,7 +607,7 @@ class StatusActionBar extends ImmutablePureComponent {
<IconButton <IconButton
disabled={!publicStatus} disabled={!publicStatus}
className={classNames({ className={classNames({
'text-gray-400 hover:text-gray-600': !status.get('reblogged'), 'text-gray-400 hover:text-gray-600 dark:hover:text-white': !status.get('reblogged'),
'text-success-600 hover:text-success-600': status.get('reblogged'), 'text-success-600 hover:text-success-600': status.get('reblogged'),
})} })}
title={!publicStatus ? intl.formatMessage(messages.cannot_reblog) : intl.formatMessage(messages.reblog)} title={!publicStatus ? intl.formatMessage(messages.cannot_reblog) : intl.formatMessage(messages.reblog)}
@ -631,7 +631,7 @@ class StatusActionBar extends ImmutablePureComponent {
title={intl.formatMessage(messages.share)} title={intl.formatMessage(messages.share)}
src={require('@tabler/icons/icons/upload.svg')} src={require('@tabler/icons/icons/upload.svg')}
onClick={this.handleShareClick} onClick={this.handleShareClick}
className='text-gray-400 hover:text-gray-600' className='text-gray-400 hover:text-gray-600 dark:hover:text-white'
/> />
</div> </div>
); );
@ -643,7 +643,7 @@ class StatusActionBar extends ImmutablePureComponent {
title={replyTitle} title={replyTitle}
src={require('@tabler/icons/icons/message-circle.svg')} src={require('@tabler/icons/icons/message-circle.svg')}
onClick={this.handleReplyClick} onClick={this.handleReplyClick}
className='text-gray-400 hover:text-gray-600' className='text-gray-400 hover:text-gray-600 dark:hover:text-white'
/> />
{replyCount !== 0 ? ( {replyCount !== 0 ? (
@ -672,7 +672,7 @@ class StatusActionBar extends ImmutablePureComponent {
/> */} /> */}
<IconButton <IconButton
className={classNames({ className={classNames({
'text-gray-400 hover:text-gray-600': !meEmojiReact, 'text-gray-400 hover:text-gray-600 dark:hover:text-white': !meEmojiReact,
'text-accent-300 hover:text-accent-300': Boolean(meEmojiReact), 'text-accent-300 hover:text-accent-300': Boolean(meEmojiReact),
})} })}
title={meEmojiTitle} title={meEmojiTitle}

Wyświetl plik

@ -226,7 +226,7 @@ export default class StatusList extends ImmutablePureComponent {
placeholderComponent={PlaceholderStatus} placeholderComponent={PlaceholderStatus}
placeholderCount={20} placeholderCount={20}
ref={this.setRef} ref={this.setRef}
className={divideType === 'border' ? 'divide-y divide-solid divide-gray-200' : 'sm:space-y-3 divide-y divide-solid divide-gray-200 sm:divide-none'} className={divideType === 'border' ? 'divide-y divide-solid divide-gray-200 dark:divide-gray-800' : 'sm:space-y-3 divide-y divide-solid divide-gray-200 dark:divide-gray-800 sm:divide-none'}
{...other} {...other}
> >
{this.renderScrollableContent()} {this.renderScrollableContent()}

Wyświetl plik

@ -26,7 +26,7 @@ const Card: React.FC<ICard> = React.forwardRef(({ children, variant, size = 'md'
{...filteredProps} {...filteredProps}
className={classNames({ className={classNames({
'space-y-4': true, 'space-y-4': true,
'bg-white sm:shadow-lg overflow-hidden': variant === 'rounded', 'bg-white dark:bg-slate-800 sm:shadow-lg dark:sm:shadow-inset overflow-hidden': variant === 'rounded',
[sizes[size]]: true, [sizes[size]]: true,
[className]: typeof className !== 'undefined', [className]: typeof className !== 'undefined',
})} })}

Wyświetl plik

@ -23,8 +23,8 @@ const IconButton = React.forwardRef((props: IIconButton, ref: React.ForwardedRef
<button <button
ref={ref} ref={ref}
type='button' type='button'
className={classNames('flex items-center space-x-2 p-1 rounded-full focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500', { className={classNames('flex items-center space-x-2 p-1 rounded-full focus:outline-none focus:ring-2 focus:ring-offset-2 dark:ring-offset-0 focus:ring-primary-500', {
'bg-white': !transparent, 'bg-white dark:bg-transparent': !transparent,
[className]: typeof className !== 'undefined', [className]: typeof className !== 'undefined',
})} })}
{...filteredProps} {...filteredProps}

Wyświetl plik

@ -10,11 +10,11 @@ type Families = 'sans' | 'mono'
type Tags = 'abbr' | 'p' | 'span' | 'pre' | 'time' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' type Tags = 'abbr' | 'p' | 'span' | 'pre' | 'time' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
const themes = { const themes = {
default: 'text-gray-900', default: 'text-gray-900 dark:text-gray-100',
danger: 'text-danger-600', danger: 'text-danger-600',
primary: 'text-primary-600', primary: 'text-primary-600',
muted: 'text-gray-500', muted: 'text-gray-500 dark:text-gray-400',
subtle: 'text-gray-400', subtle: 'text-gray-400 dark:text-gray-500',
success: 'text-success-600', success: 'text-success-600',
inherit: 'text-inherit', inherit: 'text-inherit',
white: 'text-white', white: 'text-white',

Wyświetl plik

@ -18,7 +18,7 @@ const Textarea = React.forwardRef(
{...props} {...props}
ref={ref} ref={ref}
className={classNames({ className={classNames({
'shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 rounded-md': 'dark:bg-slate-800 shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 dark:border-gray-600 rounded-md':
true, true,
'font-mono': isCodeEditor, 'font-mono': isCodeEditor,
})} })}

Wyświetl plik

@ -170,7 +170,7 @@ class SoapboxMount extends React.PureComponent {
<BrowserRouter basename={FE_SUBDIRECTORY}> <BrowserRouter basename={FE_SUBDIRECTORY}>
<> <>
<Helmet> <Helmet>
{/* <html lang='en' className={this.props.themeMode} /> */} <html lang='en' className={classNames({ dark: this.props.themeMode === 'dark' })} />
<body className={bodyClass} /> <body className={bodyClass} />
{themeCss && <style id='theme' type='text/css'>{`:root{${themeCss}}`}</style>} {themeCss && <style id='theme' type='text/css'>{`:root{${themeCss}}`}</style>}
<meta name='theme-color' content={this.props.brandColor} /> <meta name='theme-color' content={this.props.brandColor} />

Wyświetl plik

@ -15,7 +15,7 @@ const PlaceholderAvatar = ({ size }) => {
return ( return (
<div <div
className='rounded-full bg-slate-200' className='rounded-full bg-slate-200 dark:bg-slate-700'
style={style} style={style}
alt='' alt=''
/> />

Wyświetl plik

@ -8,7 +8,7 @@ const PlaceholderDisplayName = ({ minLength, maxLength }) => {
const acctLength = randomIntFromInterval(maxLength, minLength); const acctLength = randomIntFromInterval(maxLength, minLength);
return ( return (
<div className='flex flex-col text-slate-200'> <div className='flex flex-col text-slate-200 dark:text-slate-700'>
<p>{generateText(length)}</p> <p>{generateText(length)}</p>
<p>{generateText(acctLength)}</p> <p>{generateText(acctLength)}</p>
</div> </div>

Wyświetl plik

@ -12,8 +12,8 @@ interface IPlaceholderStatus {
const PlaceholderStatus = ({ thread = false }: IPlaceholderStatus) => ( const PlaceholderStatus = ({ thread = false }: IPlaceholderStatus) => (
<div <div
className={classNames({ className={classNames({
'status-placeholder bg-white': true, 'status-placeholder bg-white dark:bg-slate-800': true,
'sm:shadow-xl sm:rounded-xl px-4 py-6 sm:p-6': !thread, 'sm:shadow-xl dark:sm:shadow-inset sm:rounded-xl px-4 py-6 sm:p-6': !thread,
})} })}
> >
<div className='w-full animate-pulse overflow-hidden'> <div className='w-full animate-pulse overflow-hidden'>

Wyświetl plik

@ -7,7 +7,7 @@ const PlaceholderStatusContent = ({ minLength, maxLength }) => {
const length = randomIntFromInterval(maxLength, minLength); const length = randomIntFromInterval(maxLength, minLength);
return ( return (
<div className='flex flex-col text-slate-200'> <div className='flex flex-col text-slate-200 dark:text-slate-700'>
<p className='break-words'>{generateText(length)}</p> <p className='break-words'>{generateText(length)}</p>
</div> </div>
); );

Wyświetl plik

@ -104,6 +104,12 @@
@tailwind components; @tailwind components;
@tailwind utilities; @tailwind utilities;
@layer utilities {
.shadow-inset {
box-shadow: inset 0 0 0 1px rgb(255 255 255 / 10%);
}
}
@import 'forms'; @import 'forms';
@import 'utilities'; @import 'utilities';
@import 'components/datepicker'; @import 'components/datepicker';

Wyświetl plik

@ -160,7 +160,7 @@
} }
.status-link { .status-link {
@apply hover:underline text-primary-600 hover:text-primary-800; @apply hover:underline text-primary-600 dark:text-primary-400 hover:text-primary-800 dark:hover:text-primary-500;
} }
.status { .status {
@ -238,7 +238,7 @@
} }
.status__wrapper { .status__wrapper {
@apply bg-white px-4 py-6 sm:shadow-xl sm:p-5 sm:rounded-xl; @apply bg-white dark:bg-slate-800 px-4 py-6 sm:shadow-xl dark:sm:shadow-inset sm:p-5 sm:rounded-xl;
} }
[column-type=filled] .status__wrapper, [column-type=filled] .status__wrapper,
@ -379,7 +379,7 @@
.status__content, .status__content,
.reply-indicator__content { .reply-indicator__content {
@apply text-gray-900 break-words text-ellipsis overflow-hidden relative; @apply text-gray-900 dark:text-gray-300 break-words text-ellipsis overflow-hidden relative;
&:focus { &:focus {
@apply outline-none; @apply outline-none;
@ -410,7 +410,7 @@
} }
a { a {
@apply text-primary-600 hover:underline; @apply text-primary-600 dark:text-primary-400 hover:underline;
.fa { .fa {
color: var(--primary-text-color); color: var(--primary-text-color);
@ -469,11 +469,11 @@
} }
.status-card { .status-card {
@apply flex text-sm border border-solid border-gray-200 rounded-lg text-gray-800 mt-3 min-h-[150px] no-underline overflow-hidden; @apply flex text-sm border border-solid border-gray-200 dark:border-gray-700 rounded-lg text-gray-800 dark:text-gray-200 mt-3 min-h-[150px] no-underline overflow-hidden;
} }
a.status-card { a.status-card {
@apply cursor-pointer hover:bg-gray-50 hover:no-underline; @apply cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-900 hover:no-underline;
} }
.status-card-photo { .status-card-photo {
@ -489,7 +489,7 @@ a.status-card {
} }
.status-card__title { .status-card__title {
@apply block font-medium mb-2 text-gray-800 no-underline; @apply block font-medium mb-2 text-gray-800 dark:text-gray-200 no-underline;
} }
.status-card__content { .status-card__content {
@ -497,7 +497,7 @@ a.status-card {
} }
.status-card__description { .status-card__description {
@apply text-gray-500; @apply text-gray-500 dark:text-gray-400;
} }
.status-card__host { .status-card__host {
@ -549,7 +549,7 @@ a.status-card {
} }
.status-card.compact { .status-card.compact {
@apply border-gray-200; @apply border-gray-200 dark:border-gray-700;
} }
.status-card__image-image { .status-card__image-image {