Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
e70149af
Unverified
Commit
e70149af
authored
Mar 07, 2026
by
memoclaw
Committed by
GitHub
Mar 07, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enhance: polish PWA manifest and meta tags (#5695)
Co-authored-by:
Claude Opus 4.6
<
noreply@anthropic.com
>
parent
cd5816c4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
1 deletion
+27
-1
index.html
web/index.html
+4
-0
site.webmanifest
web/public/site.webmanifest
+5
-1
theme.ts
web/src/utils/theme.ts
+18
-0
No files found.
web/index.html
View file @
e70149af
...
@@ -9,6 +9,10 @@
...
@@ -9,6 +9,10 @@
<link
rel=
"icon"
type=
"image/webp"
href=
"/logo.webp"
/>
<link
rel=
"icon"
type=
"image/webp"
href=
"/logo.webp"
/>
<link
rel=
"manifest"
href=
"/site.webmanifest"
/>
<link
rel=
"manifest"
href=
"/site.webmanifest"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, user-scalable=no"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, user-scalable=no"
/>
<meta
name=
"theme-color"
content=
"#faf9f5"
/>
<meta
name=
"mobile-web-app-capable"
content=
"yes"
/>
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
/>
<meta
name=
"apple-mobile-web-app-status-bar-style"
content=
"default"
/>
<!-- memos.metadata.head -->
<!-- memos.metadata.head -->
<title>
Memos
</title>
<title>
Memos
</title>
</head>
</head>
...
...
web/public/site.webmanifest
View file @
e70149af
{
{
"name": "Memos",
"name": "Memos",
"short_name": "Memos",
"short_name": "Memos",
"description": "An open-source, self-hosted note-taking tool. Capture thoughts instantly. Own them completely.",
"icons": [
"icons": [
{ "src": "/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" },
{ "src": "/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" },
{ "src": "/android-chrome-512x512.png", "sizes": "512x512", "type": "image/png" }
{ "src": "/android-chrome-512x512.png", "sizes": "512x512", "type": "image/png" }
],
],
"display": "standalone",
"display": "standalone",
"start_url": "/"
"scope": "/",
"start_url": "/",
"theme_color": "#faf9f5",
"background_color": "#faf9f5"
}
}
web/src/utils/theme.ts
View file @
e70149af
...
@@ -24,6 +24,12 @@ const THEME_CONTENT: Record<ResolvedTheme, string | null> = {
...
@@ -24,6 +24,12 @@ const THEME_CONTENT: Record<ResolvedTheme, string | null> = {
paper
:
paperThemeContent
,
paper
:
paperThemeContent
,
};
};
const
THEME_COLORS
:
Record
<
ResolvedTheme
,
string
>
=
{
default
:
"#faf9f5"
,
"default-dark"
:
"#020204"
,
paper
:
"#f5ede4"
,
};
export
const
THEME_OPTIONS
:
ThemeOption
[]
=
[
export
const
THEME_OPTIONS
:
ThemeOption
[]
=
[
{
value
:
"system"
,
label
:
"Sync with system"
},
{
value
:
"system"
,
label
:
"Sync with system"
},
{
value
:
"default"
,
label
:
"Light"
},
{
value
:
"default"
,
label
:
"Light"
},
...
@@ -165,6 +171,17 @@ const setThemeAttribute = (theme: ResolvedTheme): void => {
...
@@ -165,6 +171,17 @@ const setThemeAttribute = (theme: ResolvedTheme): void => {
document
.
documentElement
.
setAttribute
(
"data-theme"
,
theme
);
document
.
documentElement
.
setAttribute
(
"data-theme"
,
theme
);
};
};
/**
* Updates the theme-color meta tag to match the current theme background.
* This colors the browser/status bar on mobile devices.
*/
const
updateThemeColorMeta
=
(
theme
:
ResolvedTheme
):
void
=>
{
const
meta
=
document
.
querySelector
<
HTMLMetaElement
>
(
'meta[name="theme-color"]'
);
if
(
meta
)
{
meta
.
content
=
THEME_COLORS
[
theme
];
}
};
// ============================================================================
// ============================================================================
// Main Theme Loading
// Main Theme Loading
// ============================================================================
// ============================================================================
...
@@ -184,6 +201,7 @@ export const loadTheme = (themeName: string): void => {
...
@@ -184,6 +201,7 @@ export const loadTheme = (themeName: string): void => {
injectThemeStyle
(
resolvedTheme
);
injectThemeStyle
(
resolvedTheme
);
setThemeAttribute
(
resolvedTheme
);
setThemeAttribute
(
resolvedTheme
);
updateThemeColorMeta
(
resolvedTheme
);
setStoredTheme
(
validTheme
);
// Store original theme preference (not resolved)
setStoredTheme
(
validTheme
);
// Store original theme preference (not resolved)
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment