diff --git a/locales/en/translation.json b/locales/en/translation.json index 44f1d4dd28..4f686787ab 100644 --- a/locales/en/translation.json +++ b/locales/en/translation.json @@ -166,7 +166,8 @@ "settings": { "title": "Settings", "language": "Language", - "font_size": "Font size" + "font_size": "Font size", + "theme": "Color theme" }, "thirdparty": { "title": "Third-party licenses" diff --git a/package.json b/package.json index 058829c922..77ed95f1fd 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "postcss": "^8.4.31", "react": "^18.2.0", "react-dom": "^18.2.0", + "sass": "^1.71.1", "tailwindcss": "^3.3.3", "typescript": "^5.2.2" }, diff --git a/renderer/app.css b/renderer/app.css deleted file mode 100644 index 831e25af0a..0000000000 --- a/renderer/app.css +++ /dev/null @@ -1,114 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - -.emojione { - display: inline-block; - width: 1.2rem; - height: 1.2rem; -} - - -.timeline-wrapper { - width: calc(100% - 16rem); -} - -.timeline { - width: 100%; -} - -.timeline-with-drawer { - width: calc(100% - 384px); -} - -.detail { - width: 384px; -} - -@media screen and (max-width: 1112px) { - .sidebar-menu { - display: none; - } - - .my-profile { - visibility: hidden; - } - - .sidebar { - width: 64px; - } - - .timeline-wrapper { - width: calc(100% - 64px); - } - - .sidebar-menu-item { - position: relative; - } - - .sidebar-menu-item > span { - display: none; - } - - .sidebar-toolchip { - position: absolute; - top: 2px; - right: 2px; - font-size: 7px; - } - - .sidebar-toolchip > div { - padding: 2px 4px; - } -} - -@media screen and (max-width: 996px) { - .timeline-with-drawer { - display: none; - } - - .detail { - width: 100%; - } -} - -.raw-html .invisible { - display: none; -} - -.timeline-scrollable { - overflow-y: auto; - overflow-x: auto; -} - -.timeline-scrollable::-webkit-scrollbar { - width: 6px !important; - height: 6px !important; -} - -.timeline-scrollable::-webkit-scrollbar-thumb { - background-color: rgb(203 213 225); - border-radius: 4px !important; - opacity: 0; -} - -.timeline-scrollable::-webkit-scrollbar-track { - border-radius: 4px !important; - background-color: rgb(241 245 249); -} - -.timeline-scrollable:hover::-webkit-scrollbar-thumb { - opacity: 1; -} - -button:focus { - outline: none; -} - -a { - color: blue; -} - - a:hover { - text-decoration: underline; -} diff --git a/renderer/app.scss b/renderer/app.scss new file mode 100644 index 0000000000..d5a5867dec --- /dev/null +++ b/renderer/app.scss @@ -0,0 +1,331 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +.emojione { + display: inline-block; + width: 1.2rem; + height: 1.2rem; +} + + +.timeline-wrapper { + width: calc(100% - 16rem); +} + +.timeline { + width: 100%; +} + +.timeline-with-drawer { + width: calc(100% - 384px); +} + +.detail { + width: 384px; +} + +@media screen and (max-width: 1112px) { + .sidebar-menu { + display: none; + } + + .my-profile { + visibility: hidden; + } + + .sidebar { + width: 64px; + } + + .timeline-wrapper { + width: calc(100% - 64px); + } + + .sidebar-menu-item { + position: relative; + } + + .sidebar-menu-item > span { + display: none; + } + + .sidebar-toolchip { + position: absolute; + top: 2px; + right: 2px; + font-size: 7px; + } + + .sidebar-toolchip > div { + padding: 2px 4px; + } +} + +@media screen and (max-width: 996px) { + .timeline-with-drawer { + display: none; + } + + .detail { + width: 100%; + } +} + +.raw-html .invisible { + display: none; +} + +.timeline-scrollable { + overflow-y: auto; + overflow-x: auto; +} + +.timeline-scrollable::-webkit-scrollbar { + width: 6px !important; + height: 6px !important; +} + +.timeline-scrollable::-webkit-scrollbar-thumb { + background-color: rgb(203 213 225); + border-radius: 4px !important; + opacity: 0; +} + +.timeline-scrollable::-webkit-scrollbar-track { + border-radius: 4px !important; + background-color: rgb(241 245 249); +} + +.timeline-scrollable:hover::-webkit-scrollbar-thumb { + opacity: 1; +} + +button:focus { + outline: none; +} + +a { + color: blue; +} + + a:hover { + text-decoration: underline; +} + +.theme-blue { + .theme-account-bg { + @apply bg-gradient-to-b; + @apply from-indigo-800; + @apply to-indigo-700; + } + + .theme-bg { + @apply bg-blue-950; + } + + .theme-bg-secondary { + @apply bg-blue-900; + } + + .theme-text-primary { + @apply text-blue-100; + } + + .theme-text-subtle { + @apply text-blue-600; + } + + .theme-badge { + @apply bg-blue-600; + } + + .theme-enabled { + @apply text-blue-400; + } + + .theme-enabled:hover { + @apply text-blue-600; + } + +} + +.theme-orange { + .theme-account-bg { + @apply bg-gradient-to-b; + @apply from-orange-900; + @apply to-orange-800; + } + + .theme-bg { + @apply bg-deep-orange-900; + } + + .theme-bg-secondary { + @apply bg-orange-900; + } + + .theme-text-primary { + @apply text-deep-orange-100; + } + + .theme-text-subtle { + @apply text-deep-orange-600; + } + + .theme-badge { + @apply bg-deep-orange-600; + } + + .theme-enabled { + @apply text-deep-orange-400; + } + + .theme-enabled:hover { + @apply text-deep-orange-600; + } +} + +.theme-purple { + .theme-account-bg { + @apply bg-gradient-to-b; + @apply from-purple-900; + @apply to-purple-800; + } + + .theme-bg { + @apply bg-deep-purple-900; + } + + .theme-bg-secondary { + @apply bg-purple-900; + } + + .theme-text-primary { + @apply text-deep-purple-100; + } + + .theme-text-subtle { + @apply text-deep-purple-600; + } + + .theme-badge { + @apply bg-deep-purple-600; + } + + .theme-enabled { + @apply text-deep-purple-400; + } + + .theme-enabled:hover { + @apply text-deep-purple-600; + } +} + +.theme-green { + .theme-account-bg { + @apply bg-gradient-to-b; + @apply from-teal-900; + @apply to-teal-800; + } + + .theme-bg { + @apply bg-green-900; + } + + .theme-bg-secondary { + @apply bg-green-900; + } + + .theme-text-primary { + @apply text-green-100; + } + + .theme-text-subtle { + @apply text-green-600; + } + + .theme-badge { + @apply bg-green-600; + } + + .theme-enabled { + @apply text-green-400; + } + + .theme-enabled:hover { + @apply text-green-600; + } +} + +.theme-brown { + .theme-account-bg { + @apply bg-gradient-to-b; + @apply from-gray-900; + @apply to-gray-800; + } + + .theme-bg { + @apply bg-brown-900; + } + + .theme-bg-secondary { + @apply bg-brown-900; + } + + .theme-text-primary { + @apply text-brown-100; + } + + .theme-text-subtle { + @apply text-brown-600; + } + + .theme-badge { + @apply bg-brown-600; + } + + .theme-enabled { + @apply text-brown-400; + } + + .theme-enabled:hover { + @apply text-brown-600; + } +} + +.theme-gray { + .theme-account-bg { + @apply bg-gradient-to-b; + @apply from-gray-900; + @apply to-gray-800; + } + + .theme-bg { + @apply bg-blue-gray-900; + } + + .theme-bg-secondary { + @apply bg-blue-gray-900; + } + + .theme-text-primary { + @apply text-blue-gray-100; + } + + .theme-text-subtle { + @apply text-blue-gray-600; + } + + .theme-badge { + @apply bg-blue-gray-600; + } + + .theme-enabled { + @apply text-blue-gray-400; + } + + .theme-enabled:hover { + @apply text-blue-gray-600; + } +} diff --git a/renderer/components/Settings.tsx b/renderer/components/Settings.tsx index bd56edc0c2..691901108b 100644 --- a/renderer/components/Settings.tsx +++ b/renderer/components/Settings.tsx @@ -24,9 +24,37 @@ const languages = [ } ] +const themes = [ + { + label: 'Blue', + value: 'theme-blue' + }, + { + label: 'Orange', + value: 'theme-orange' + }, + { + label: 'Purple', + value: 'theme-purple' + }, + { + label: 'Green', + value: 'theme-green' + }, + { + label: 'Brown', + value: 'theme-brown' + }, + { + label: 'Gray', + value: 'theme-gray' + } +] + export default function Settings(props: Props) { const [language, setLanguage] = useState('en') const [fontSize, setFontSize] = useState(16) + const [theme, setTheme] = useState('theme-blue') useEffect(() => { if (typeof localStorage !== 'undefined') { @@ -55,6 +83,14 @@ export default function Settings(props: Props) { props.reloadSettings() } + const themeChanged = (e: string) => { + setTheme(e) + if (typeof localStorage !== 'undefined') { + localStorage.setItem('theme', e) + } + props.reloadSettings() + } + return ( @@ -88,6 +124,22 @@ export default function Settings(props: Props) { +
+
+ + + +
+
+ +
+
diff --git a/renderer/components/compose/Compose.tsx b/renderer/components/compose/Compose.tsx index 4ae060b06b..70c35f7301 100644 --- a/renderer/components/compose/Compose.tsx +++ b/renderer/components/compose/Compose.tsx @@ -349,12 +349,7 @@ export default function Compose(props: Props) { {cw ? ( - setCW(false)} - > + setCW(false)}> CW ) : ( diff --git a/renderer/components/detail/Detail.tsx b/renderer/components/detail/Detail.tsx index 347cc7013e..0fd9bb21cb 100644 --- a/renderer/components/detail/Detail.tsx +++ b/renderer/components/detail/Detail.tsx @@ -46,7 +46,7 @@ export default function Detail(props: Props) { <> {target && (
-
+