diff --git a/apps/mobile/package.json b/apps/mobile/package.json
index 3899f1b20..f3a800c3b 100644
--- a/apps/mobile/package.json
+++ b/apps/mobile/package.json
@@ -82,6 +82,7 @@
"react-native-safe-area-context": "4.12.0",
"react-native-screens": "~4.1.0",
"react-native-svg": "15.8.0",
+ "react-native-uikit-colors": "0.1.1",
"react-native-web": "~0.19.13",
"react-native-webview": "13.12.5",
"swiftui-react-native": "6.3.3",
diff --git a/apps/mobile/src/components/ui/typography/MarkdownWeb.tsx b/apps/mobile/src/components/ui/typography/MarkdownWeb.tsx
index f6ad599be..37158ce36 100644
--- a/apps/mobile/src/components/ui/typography/MarkdownWeb.tsx
+++ b/apps/mobile/src/components/ui/typography/MarkdownWeb.tsx
@@ -20,6 +20,16 @@ const MarkdownWeb: WebComponent<{ value: string; style?: React.CSSProperties }>
className={cn("text-text prose min-w-0", isDarkMode ? "prose-invert" : "prose")}
style={style}
>
+
{useMemo(() => parseMarkdown(value).content, [value])}
)
diff --git a/apps/mobile/src/screens/(modal)/rsshub-form.tsx b/apps/mobile/src/screens/(modal)/rsshub-form.tsx
index 1632d529e..5443096b8 100644
--- a/apps/mobile/src/screens/(modal)/rsshub-form.tsx
+++ b/apps/mobile/src/screens/(modal)/rsshub-form.tsx
@@ -12,6 +12,7 @@ import { memo, useEffect, useMemo, useState } from "react"
import { Controller, useForm } from "react-hook-form"
import { Linking, Text, TouchableOpacity, View } from "react-native"
import { KeyboardAwareScrollView } from "react-native-keyboard-controller"
+import { useSafeAreaInsets } from "react-native-safe-area-context"
import { z } from "zod"
import { HeaderTitleExtra } from "@/src/components/common/HeaderTitleExtra"
@@ -110,6 +111,7 @@ function FormImpl({ route, routePrefix, name }: RsshubFormParams) {
mode: "all",
})
+ const insets = useSafeAreaInsets()
return (
-
-
+
+
{keys.map((keyItem) => {
const parameters = normalizeRSSHubParameters(route.parameters[keyItem.name])
@@ -183,7 +188,7 @@ function FormImpl({ route, routePrefix, name }: RsshubFormParams) {
{!!route.description && (
-
+
) => {
- const cssVars = {} as Record<`${typeof varPrefix}-${string}`, string>
- for (const [key, value] of Object.entries(_vars)) {
- cssVars[`${varPrefix}-${key}`] = value
- }
- return IS_DOM ? cssVars : vars(cssVars)
-}
-
-const lightPalette = {
- red: "255 59 48",
- orange: "255 149 0",
- yellow: "255 204 0",
- green: "52 199 89",
- mint: "0 199 190",
- teal: "48 176 190",
- cyan: "50 173 200",
- blue: "0 122 255",
- indigo: "88 86 214",
- purple: "175 82 222",
- pink: "255 45 85",
- brown: "162 132 94",
- gray: "142 142 147",
- gray2: "172 172 178",
- gray3: "199 199 204",
- gray4: "209 209 214",
- gray5: "229 229 234",
- gray6: "242 242 247",
-}
-const darkPalette = {
- red: "255 69 58",
- orange: "255 175 113",
- yellow: "255 214 10",
- green: "48 209 88",
- mint: "99 230 226",
- teal: "64 200 244",
- cyan: "100 210 255",
- blue: "10 132 255",
- indigo: "94 92 230",
- purple: "191 90 242",
- pink: "255 55 95",
- brown: "172 142 104",
- gray: "142 142 147",
- gray2: "99 99 102",
- gray3: "72 72 74",
- gray4: "58 58 60",
- gray5: "44 44 46",
- gray6: "28 28 30",
-}
-export const palette = {
- // iOS color palette https://developer.apple.com/design/human-interface-guidelines/color
- light: buildVars(lightPalette),
- dark: buildVars(darkPalette),
-}
-
-export const lightVariants = {
- // UIKit Colors
-
- placeholderText: "199 199 204",
- separator: "84 84 86 0.34",
- opaqueSeparator: "84 84 86 0.34",
- nonOpaqueSeparator: "198 198 200",
- link: "0 122 255",
-
- systemBackground: "255 255 255",
- secondarySystemBackground: "242 242 247",
- tertiarySystemBackground: "255 255 255",
-
- // Grouped
- systemGroupedBackground: "242 242 247",
- secondarySystemGroupedBackground: "255 255 255",
- tertiarySystemGroupedBackground: "242 242 247",
-
- // System Colors
- systemFill: "120 120 128 0.2",
- secondarySystemFill: "120 120 128 0.16",
- tertiarySystemFill: "120 120 128 0.12",
- quaternarySystemFill: "120 120 128 0.08",
-
- // Text Colors
- label: "0 0 0",
- text: "0 0 0",
- secondaryLabel: "60 60 67 0.6",
- tertiaryLabel: "60 60 67 0.3",
- quaternaryLabel: "60 60 67 0.18",
-
- // Extended colors
- disabled: "235 235 228",
- itemPressed: "229 229 234",
-}
-export const darkVariants = {
- // UIKit Colors
-
- placeholderText: "122 122 122",
- separator: "56 56 58 0.6",
- opaqueSeparator: "56 56 58 0.6",
- nonOpaqueSeparator: "84 84 86",
- link: "10 132 255",
- systemBackground: "0 0 0",
- secondarySystemBackground: "28 28 30",
- tertiarySystemBackground: "44 44 46",
-
- // Grouped
- systemGroupedBackground: "0 0 0",
- secondarySystemGroupedBackground: "28 28 30",
- tertiarySystemGroupedBackground: "44 44 46",
-
- // System Colors
- systemFill: "120 120 128 36",
- secondarySystemFill: "120 120 128 0.32",
- tertiarySystemFill: "120 120 128 0.24",
- quaternarySystemFill: "120 120 128 0.19",
-
- // Text Colors
- label: "255 255 255",
- text: "255 255 255",
- secondaryLabel: "235 235 245 0.6",
- tertiaryLabel: "235 235 245 0.3",
- quaternaryLabel: "235 235 245 0.18",
-
- // Extended colors
- disabled: "85 85 85",
- itemPressed: "44 44 46",
-}
-
-/// Utils
-
-const mergedLightColors = {
- ...lightVariants,
- ...lightPalette,
-}
-const mergedDarkColors = {
- ...darkVariants,
- ...darkPalette,
-}
-const mergedColors = {
- light: mergedLightColors,
- dark: mergedDarkColors,
-}
-
-export const colorVariants = {
- light: buildVars(lightVariants),
- dark: buildVars(darkVariants),
-}
-
-export const useColor = (color: keyof typeof mergedLightColors) => {
- const { colorScheme } = useColorScheme()
- const colors = mergedColors[colorScheme || "light"]
- return useMemo(() => rgbStringToRgb(colors[color]), [color, colors])
-}
-
-export const useColors = () => {
- const { colorScheme } = useColorScheme()
- return mergedColors[colorScheme || "light"]
-}
-
-export type Colors = typeof mergedLightColors
+export * from "react-native-uikit-colors"
diff --git a/apps/mobile/src/theme/utils.ts b/apps/mobile/src/theme/utils.ts
index 5f4530433..e7f51175e 100644
--- a/apps/mobile/src/theme/utils.ts
+++ b/apps/mobile/src/theme/utils.ts
@@ -1,21 +1 @@
-import { rgbStringToRgb } from "@follow/utils"
-import type { StyleProp, ViewStyle } from "react-native"
-import { Appearance, StyleSheet } from "react-native"
-
-import { colorVariants, darkVariants, lightVariants, palette } from "./colors"
-
-export const getCurrentColors = () => {
- const colorScheme = Appearance.getColorScheme() || "light"
-
- return StyleSheet.compose(
- colorVariants[colorScheme],
- palette[colorScheme],
- ) as StyleProp
-}
-
-export const getSystemBackgroundColor = () => {
- const colorScheme = Appearance.getColorScheme() || "light"
-
- const colors = colorScheme === "light" ? lightVariants : darkVariants
- return rgbStringToRgb(colors.systemBackground)
-}
+export { getCurrentColors, getSystemBackgroundColor } from "react-native-uikit-colors"
diff --git a/apps/mobile/src/theme/web.ts b/apps/mobile/src/theme/web.ts
index 330951df9..b2962f26d 100644
--- a/apps/mobile/src/theme/web.ts
+++ b/apps/mobile/src/theme/web.ts
@@ -1,24 +1 @@
-import { useInsertionEffect } from "react"
-import { useDarkMode } from "usehooks-ts"
-
-import { colorVariants, palette } from "./colors"
-
-export const useCSSInjection = () => {
- const isDark = useDarkMode().isDarkMode
-
- useInsertionEffect(() => {
- const style = document.createElement("style")
-
- const vars1 = colorVariants[isDark ? "dark" : "light"]
- const vars2 = palette[isDark ? "dark" : "light"]
-
- style.innerHTML = `:root {${[...Object.entries(vars1), ...Object.entries(vars2)]
- .map(([key, value]) => `${key}: ${value};`)
- .join("\n")}}`
-
- document.head.append(style)
- return () => {
- style.remove()
- }
- }, [isDark])
-}
+export { useCSSInjection } from "react-native-uikit-colors/dist/web"
diff --git a/apps/mobile/tailwind.config.ts b/apps/mobile/tailwind.config.ts
index f6a5c0a6c..711cdfc44 100644
--- a/apps/mobile/tailwind.config.ts
+++ b/apps/mobile/tailwind.config.ts
@@ -1,7 +1,7 @@
/** @type {import('tailwindcss').Config} */
-import resolveConfig from "tailwindcss/resolveConfig"
+import { withUIKit } from "react-native-uikit-colors/tailwind"
-export default resolveConfig({
+export default withUIKit({
darkMode: "class",
content: ["./src/**/*.{js,jsx,ts,tsx}"],
presets: [require("nativewind/preset")],
@@ -15,62 +15,6 @@ export default resolveConfig({
},
colors: {
accent: "#FF5C00",
- // Palette colors
- red: "rgb(var(--color-red) / )",
- orange: "rgb(var(--color-orange) / )",
- yellow: "rgb(var(--color-yellow) / )",
- green: "rgb(var(--color-green) / )",
- mint: "rgb(var(--color-mint) / )",
- teal: "rgb(var(--color-teal) / )",
- cyan: "rgb(var(--color-cyan) / )",
- blue: "rgb(var(--color-blue) / )",
- indigo: "rgb(var(--color-indigo) / )",
- purple: "rgb(var(--color-purple) / )",
- pink: "rgb(var(--color-pink) / )",
- brown: "rgb(var(--color-brown) / )",
- gray: {
- DEFAULT: "rgb(var(--color-gray) / )",
- 2: "rgb(var(--color-gray2) / )",
- 3: "rgb(var(--color-gray3) / )",
- 4: "rgb(var(--color-gray4) / )",
- 5: "rgb(var(--color-gray5) / )",
- 6: "rgb(var(--color-gray6) / )",
- },
-
- // System colors
-
- "placeholder-text": "rgb(var(--color-placeholderText) / )",
- separator: "rgb(var(--color-separator) / )",
- "opaque-separator": "rgba(var(--color-opaqueSeparator))",
- "non-opaque-separator": "rgba(var(--color-nonOpaqueSeparator))",
- link: "rgb(var(--color-link) / )",
-
- // Backgrounds
- "system-background": "rgb(var(--color-systemBackground) / )",
- "secondary-system-background":
- "rgb(var(--color-secondarySystemBackground) / )",
- "tertiary-system-background": "rgb(var(--color-tertiarySystemBackground) / )",
- "system-grouped-background": "rgb(var(--color-systemGroupedBackground) / )",
- "secondary-system-grouped-background":
- "rgb(var(--color-secondarySystemGroupedBackground) / )",
- "tertiary-system-grouped-background":
- "rgb(var(--color-tertiarySystemGroupedBackground) / )",
- // System fills
- "system-fill": "rgba(var(--color-systemFill))",
- "secondary-system-fill": "rgba(var(--color-secondarySystemFill))",
- "tertiary-system-fill": "rgba(var(--color-tertiarySystemFill))",
- "quaternary-system-fill": "rgba(var(--color-quaternarySystemFill))",
-
- // Text colors
- label: "rgb(var(--color-text) / )",
- text: "rgb(var(--color-text) / )",
- "secondary-label": "rgba(var(--color-secondaryLabel))",
- "tertiary-label": "rgba(var(--color-tertiaryLabel))",
- "quaternary-label": "rgba(var(--color-quaternaryLabel))",
-
- // Extended colors
- disabled: "rgb(var(--color-disabled) / )",
- "item-pressed": "rgb(var(--color-itemPressed) / )",
},
},
},
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index e2362c057..ad88d62fb 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -610,6 +610,9 @@ importers:
react-native-svg:
specifier: 15.8.0
version: 15.8.0(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1)
+ react-native-uikit-colors:
+ specifier: 0.1.1
+ version: 0.1.1(nativewind@4.1.23(nstbpzfxmampvbdkx7dnhhhjzi))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1)(tailwindcss@3.4.16(ts-node@10.9.1(@types/node@22.10.1)(typescript@5.7.2)))
react-native-web:
specifier: ~0.19.13
version: 0.19.13(encoding@0.1.13)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
@@ -2472,8 +2475,8 @@ packages:
resolution: {integrity: sha512-F+nKc0xW+kVbBRhFzaMgPy3KwmuNTYX1fx6+FxxoSnNgwYX6LD7AKBTWkU0MQ6IBoe7dz069CNkR673sPAgkCQ==}
engines: {node: '>=14'}
- '@electron/node-gyp@https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2':
- resolution: {tarball: https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2}
+ '@electron/node-gyp@git+https://git@github.com:electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2':
+ resolution: {commit: 06b29aafb7708acef8b3669835c8a7857ebc92d2, repo: git@github.com:electron/node-gyp.git, type: git}
version: 10.2.0-electron.1
engines: {node: '>=12.13.0'}
hasBin: true
@@ -12841,6 +12844,14 @@ packages:
react: '*'
react-native: '*'
+ react-native-uikit-colors@0.1.1:
+ resolution: {integrity: sha512-PNAXc/Pk/WYnU+/C1I7iaMCVdphjt/QRXqvq0cWDEDgX3ac0gP2H4RTb6xAJWGTsIbGYmtE+BNp5LnX0NgBibw==}
+ peerDependencies:
+ nativewind: '>=4.1.0'
+ react: '>=18.0.0'
+ react-native: '>=0.76.0'
+ tailwindcss: '>=3.0.0'
+
react-native-web@0.19.13:
resolution: {integrity: sha512-etv3bN8rJglrRCp/uL4p7l8QvUNUC++QwDbdZ8CB7BvZiMvsxfFIRM1j04vxNldG3uo2puRd6OSWR3ibtmc29A==}
peerDependencies:
@@ -16611,7 +16622,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
- '@electron/node-gyp@https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2':
+ '@electron/node-gyp@git+https://git@github.com:electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2':
dependencies:
env-paths: 2.2.1
exponential-backoff: 3.1.1
@@ -16711,7 +16722,7 @@ snapshots:
'@electron/rebuild@3.7.1':
dependencies:
- '@electron/node-gyp': https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2
+ '@electron/node-gyp': git+https://git@github.com:electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2
'@malept/cross-spawn-promise': 2.0.0
chalk: 4.1.2
debug: 4.4.0(supports-color@8.1.1)
@@ -29500,6 +29511,13 @@ snapshots:
react-native: 0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)
warn-once: 0.1.1
+ react-native-uikit-colors@0.1.1(nativewind@4.1.23(nstbpzfxmampvbdkx7dnhhhjzi))(react-native@0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1))(react@18.3.1)(tailwindcss@3.4.16(ts-node@10.9.1(@types/node@22.10.1)(typescript@5.7.2))):
+ dependencies:
+ nativewind: 4.1.23(nstbpzfxmampvbdkx7dnhhhjzi)
+ react: 18.3.1
+ react-native: 0.76.5(@babel/core@7.26.0)(@babel/preset-env@7.26.0(@babel/core@7.26.0))(@react-native-community/cli-server-api@14.1.0(bufferutil@4.0.8))(@types/react@18.3.14)(bufferutil@4.0.8)(encoding@0.1.13)(react@18.3.1)
+ tailwindcss: 3.4.16(ts-node@10.9.1(@types/node@22.10.1)(typescript@5.7.2))
+
react-native-web@0.19.13(encoding@0.1.13)(react-dom@18.3.1(react@18.3.1))(react@18.3.1):
dependencies:
'@babel/runtime': 7.26.0