A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
feat: improve colors accessibility
thecodrr6a88a1211ce8
diff --git a/apps/web/src/components/editor/footer.js b/apps/web/src/components/editor/footer.jsindex 179c8887b..75a2dd00a 100644--- a/apps/web/src/components/editor/footer.js+++ b/apps/web/src/components/editor/footer.js@@ -11,7 +11,7 @@ function EditorFooter() {if (!id) return null;return (<Flex alignItems="center">- <Text variant="subBody">+ <Text variant="subBody" color="bgSecondaryText">{totalWords + " words"}<TextSeperator />{timeConverter(dateEdited)}diff --git a/apps/web/src/components/group-header/index.js b/apps/web/src/components/group-header/index.jsindex 87e2f220f..91874a5cb 100644--- a/apps/web/src/components/group-header/index.js+++ b/apps/web/src/components/group-header/index.js@@ -125,7 +125,7 @@ function GroupHeader(props) {bg="bgSecondary"sx={{ borderRadius: "default" }}>- <Text variant="subtitle" color="primary">+ <Text variant="subtitle" color="bgSecondaryPrimary">{title}</Text>diff --git a/apps/web/src/components/icons/index.js b/apps/web/src/components/icons/index.jsindex 6d0fc0369..ad2aad80b 100644--- a/apps/web/src/components/icons/index.js+++ b/apps/web/src/components/icons/index.js@@ -82,7 +82,7 @@ export const Search = createIcon(Icons.mdiMagnify);export const Menu = createIcon(Icons.mdiMenu);export const Login = createIcon(Icons.mdiLoginVariant);export const Email = createIcon(Icons.mdiEmailAlertOutline);-export const Signup = createIcon(Icons.mdiAccountPlusOutline);+export const Signup = createIcon(Icons.mdiAccountOutline);export const Logout = createIcon(Icons.mdiLogoutVariant);export const FocusMode = createIcon(Icons.mdiSunglasses);export const NormalMode = createIcon(Icons.mdiGlasses);diff --git a/apps/web/src/components/list-item/index.js b/apps/web/src/components/list-item/index.jsindex f6689a13b..a9369b0ca 100644--- a/apps/web/src/components/list-item/index.js+++ b/apps/web/src/components/list-item/index.js@@ -62,8 +62,7 @@ const ItemSelector = ({ isSelected, toggleSelection }) => {function ListItem(props) {const {- colors: { shade, text, primary, background } = {- shade: "shade",+ colors: { text, primary, background } = {primary: "primary",text: "text",background: "background",@@ -119,13 +118,13 @@ function ListItem(props) {return (<Flex- bg={isSelected ? shade : background}+ bg={isSelected ? "bgSecondary" : background}onContextMenu={(e) =>openContextMenu(e, menuItems, props.menu?.extraData, false)}p={2}py={isCompact ? 2 : 3}- tabIndex={props.index}+ tabIndex={0}justifyContent="center"sx={{height: "inherit",diff --git a/apps/web/src/components/menu/colors.js b/apps/web/src/components/menu/colors.jsindex 48f362ccd..860b23182 100644--- a/apps/web/src/components/menu/colors.js+++ b/apps/web/src/components/menu/colors.js@@ -23,7 +23,7 @@ function Colors(props) {<Icon.Circlesize={isMobile ? 45 : 25}style={{ cursor: "pointer" }}- color={code}+ color={label}strokeWidth={0}data-test-id={`menuitem-colors-${label}`}/>diff --git a/apps/web/src/components/navigation-menu/index.js b/apps/web/src/components/navigation-menu/index.jsindex a7f78d642..d3860b202 100644--- a/apps/web/src/components/navigation-menu/index.js+++ b/apps/web/src/components/navigation-menu/index.js@@ -139,7 +139,7 @@ function NavigationMenu(props) {title={toTitleCase(color.alias || color.title)}icon={Icon.Circle}selected={location === `/colors/${color.id}`}- color={COLORS[color.title]}+ color={color.title}onClick={() => {navigate(`/colors/${color.id}`);}}diff --git a/apps/web/src/components/note/index.js b/apps/web/src/components/note/index.jsindex 3a05f0276..58da953df 100644--- a/apps/web/src/components/note/index.js+++ b/apps/web/src/components/note/index.js@@ -24,10 +24,9 @@ function Note(props) {const viewMode = useStore((store) => store.viewMode);const isOpened = selectedNote === note.id;- const [shade, primary] = useMemo(() => {- if (!note.color) return ["shade", "primary"];- const noteColor = COLORS[note.color];- return [noteColor + "11", noteColor];+ const primary = useMemo(() => {+ if (!note.color) return "primary";+ return note.color;}, [note.color]);const notebook = useMemo(() => {@@ -48,7 +47,6 @@ function Note(props) {id={note.id}index={index}colors={{- shade,primary,text: note.color ? primary : "text",background: isOpened ? "bgSecondary" : "background",@@ -98,7 +96,10 @@ function Note(props) {footer={<FlexalignItems="center"- sx={{ fontSize: "subBody", color: "fontTertiary" }}+ sx={{+ fontSize: "subBody",+ color: isOpened ? "bgSecondaryText" : "fontTertiary",+ }}><TimeAgolive={false}diff --git a/apps/web/src/components/properties/index.js b/apps/web/src/components/properties/index.jsindex 9f1793341..2bcde0cde 100644--- a/apps/web/src/components/properties/index.js+++ b/apps/web/src/components/properties/index.js@@ -128,7 +128,7 @@ function Properties() {data-test-id={`properties-${label}`}><Flex key={label} alignItems="center">- <Icon.Circle size={14} color={code} />+ <Icon.Circle size={14} color={label} /><Text ml={1} color="text" variant="body">{toTitleCase(label)}</Text>diff --git a/apps/web/src/components/status-bar/index.js b/apps/web/src/components/status-bar/index.jsindex 0337c39d6..232e4ed3e 100644--- a/apps/web/src/components/status-bar/index.js+++ b/apps/web/src/components/status-bar/index.js@@ -44,7 +44,7 @@ function StatusBar() {size={7}color={user.isEmailConfirmed ? "success" : "warn"}/>- <Text variant="subBody" ml={1}>+ <Text variant="subBody" color="bgSecondaryText" ml={1}>{user.email}{user.isEmailConfirmed ? "" : " (not verified)"}</Text>@@ -70,11 +70,11 @@ function StatusBar() {<Buttonvariant="statusitem"display="flex"- onClick={() => {}}+ onClick={() => navigate("/login")}sx={{ alignItems: "center", justifyContent: "center" }}><Icon.Circle size={7} color="error" />- <Text variant="subBody" ml={1}>+ <Text variant="subBody" color="bgSecondaryText" ml={1}>Not logged in</Text></Button>@@ -82,7 +82,7 @@ function StatusBar() {{processingStatus && (<Flex ml={1} alignItems="center" justifyContent="center"><Icon.Loading size={12} />- <Text variant="subBody" ml={1}>+ <Text variant="subBody" color="bgSecondaryText" ml={1}>{processingStatus}</Text></Flex>@@ -108,11 +108,13 @@ function StatusBar() {updateStatus.type !== "available"}color={- updateStatus.type === "available" ? "primary" : "fontTertiary"+ updateStatus.type === "available"+ ? "primary"+ : "bgSecondaryText"}size={12}/>- <Text variant="subBody" ml={1}>+ <Text variant="subBody" color="bgSecondaryText" ml={1}>{statusToInfoText(updateStatus)}</Text></Button>diff --git a/apps/web/src/stores/theme-store.js b/apps/web/src/stores/theme-store.jsindex cc8d0ebdf..01ee06ba2 100644--- a/apps/web/src/stores/theme-store.js+++ b/apps/web/src/stores/theme-store.js@@ -1,10 +1,11 @@import createStore from "../common/store";import BaseStore from "./index";import Config from "../utils/config";+import { getDefaultAccentColor } from "../theme/accents";class ThemeStore extends BaseStore {theme = Config.get("theme", "light");- accent = Config.get("accent", "#01c352");+ accent = Config.get("accent", getDefaultAccentColor());followSystemTheme = Config.get("followSystemTheme", false);setTheme = (theme) => {diff --git a/apps/web/src/theme/accents.js b/apps/web/src/theme/accents.jsindex 11c2deb5f..782080956 100644--- a/apps/web/src/theme/accents.js+++ b/apps/web/src/theme/accents.js@@ -2,7 +2,7 @@ const accents = [{ label: "orange", code: "#FF5722" },{ label: "yellow", code: "#FFA000" },{ label: "green", code: "#1B5E20" },- { label: "green2", code: "#01c352" },+ { label: "green2", code: "#008837" },{ label: "gray", code: "#757575" },{ label: "blue", code: "#0560ff" },{ label: "teal", code: "#009688" },@@ -12,4 +12,9 @@ const accents = [{ label: "pink", code: "#FF1744" },{ label: "red", code: "#B71C1C" },];++export function getDefaultAccentColor() {+ return accents.find((a) => a.label === "green2").code;+}+export default accents;diff --git a/apps/web/src/theme/colorscheme/dark.js b/apps/web/src/theme/colorscheme/dark.jsindex 9d97c287c..7f0b4e801 100644--- a/apps/web/src/theme/colorscheme/dark.js+++ b/apps/web/src/theme/colorscheme/dark.js@@ -9,16 +9,27 @@ class DarkColorSchemeFactory {background: "#1f1f1f",accent: "#000",bgSecondary: "#2b2b2b",+ bgSecondaryText: "#A1A1A1",+ bgSecondaryPrimary: "#00AA46",border: "#2b2b2b",hover: "#3b3b3b",fontSecondary: "#000",- fontTertiary: "#7b7b7b",+ fontTertiary: "#A1A1A1",text: "#d3d3d3",overlay: "rgba(255, 255, 255, 0.5)",secondary: "black",icon: "#dbdbdb",disabled: "#5b5b5b",...new StaticColorSchemeFactory(accent),++ // COLORS+ red: "#f44336",+ orange: "#FF9800",+ yellow: "#FFD600",+ green: "#4CAF50",+ blue: "#2196F3",+ purple: "#9568ED",+ gray: "#9E9E9E",};}}diff --git a/apps/web/src/theme/colorscheme/light.js b/apps/web/src/theme/colorscheme/light.jsindex 344422c04..bda7e7afb 100644--- a/apps/web/src/theme/colorscheme/light.js+++ b/apps/web/src/theme/colorscheme/light.js@@ -8,10 +8,12 @@ class LightColorSchemeFactory {background: "white",accent: "white",bgSecondary: "#f7f7f7",+ bgSecondaryText: "#5E5E5E",+ bgSecondaryPrimary: "#008234",border: "#e7e7e7",hover: "#f1f1f1",fontSecondary: "white",- fontTertiary: "#5b5b5b",+ fontTertiary: "#757575",text: "#202124",overlay: "rgba(0, 0, 0, 0.1)",secondary: "white",@@ -19,6 +21,15 @@ class LightColorSchemeFactory {disabled: "#9b9b9b",placeholder: hexToRGB("#000000", 0.6),...new StaticColorSchemeFactory(accent),++ // COLORS+ red: "#D93B30",+ orange: "#C75301",+ yellow: "#AC660D",+ green: "#4CAF50",+ blue: "#197AC7",+ purple: "#673AB7",+ gray: "#777777",};}}