Skip to content

fix(@angular/pwa): remove background_color and theme_color from manifest #30339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions packages/angular/pwa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ Executing the command mentioned above will perform the following actions:
1. Adds [`@angular/service-worker`](https://npmjs.com/@angular/service-worker) as a dependency to your project.
1. Enables service worker builds in the Angular CLI.
1. Imports and registers the service worker in the application module.
1. Updates the `index.html` file:
- Includes a link to add the [manifest.webmanifest](https://developer.mozilla.org/en-US/docs/Web/Manifest) file.
- Adds a meta tag for `theme-color`.
1. Updates the `index.html` file to inlclude a link to add the [manifest.webmanifest](https://developer.mozilla.org/en-US/docs/Web/Manifest) file.
1. Installs icon files to support the installed Progressive Web App (PWA).
1. Creates the service worker configuration file called `ngsw-config.json`, specifying caching behaviors and other settings.

Expand Down
2 changes: 0 additions & 2 deletions packages/angular/pwa/pwa/files/assets/manifest.webmanifest
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"name": "<%= title %>",
"short_name": "<%= title %>",
"theme_color": "#1976d2",
"background_color": "#fafafa",
"display": "standalone",
"scope": "./",
"start_url": "./",
Expand Down
1 change: 0 additions & 1 deletion packages/angular/pwa/pwa/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ function updateIndexFile(path: string): Rule {
rewriter.on('endTag', (endTag) => {
if (endTag.tagName === 'head') {
rewriter.emitRaw(' <link rel="manifest" href="manifest.webmanifest">\n');
rewriter.emitRaw(' <meta name="theme-color" content="#1976d2">\n');
} else if (endTag.tagName === 'body' && needsNoScript) {
rewriter.emitRaw(
' <noscript>Please enable JavaScript to continue using this application.</noscript>\n',
Expand Down
2 changes: 0 additions & 2 deletions packages/angular/pwa/pwa/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ describe('PWA Schematic', () => {
const content = tree.readContent('projects/bar/src/index.html');

expect(content).toMatch(/<link rel="manifest" href="manifest.webmanifest">/);
expect(content).toMatch(/<meta name="theme-color" content="#1976d2">/);
expect(content).toMatch(
/<noscript>Please enable JavaScript to continue using this application.<\/noscript>/,
);
Expand All @@ -127,7 +126,6 @@ describe('PWA Schematic', () => {
const content = tree.readContent('projects/bar/src/index.html');

expect(content).toMatch(/<link rel="manifest" href="manifest.webmanifest">/);
expect(content).toMatch(/<meta name="theme-color" content="#1976d2">/);
expect(content).not.toMatch(
/<noscript>Please enable JavaScript to continue using this application.<\/noscript>/,
);
Expand Down