Skip to content

Commit ad2fb29

Browse files
committed
fix(@angular/pwa): remove background_color and theme_color from manifest
These properties are unnecessary and create additional maintenance overhead for developers. Closes: #30336 (cherry picked from commit 7a21deb)
1 parent d2f99b5 commit ad2fb29

File tree

4 files changed

+1
-8
lines changed

4 files changed

+1
-8
lines changed

packages/angular/pwa/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ Executing the command mentioned above will perform the following actions:
1313
1. Adds [`@angular/service-worker`](https://npmjs.com/@angular/service-worker) as a dependency to your project.
1414
1. Enables service worker builds in the Angular CLI.
1515
1. Imports and registers the service worker in the application module.
16-
1. Updates the `index.html` file:
17-
- Includes a link to add the [manifest.webmanifest](https://developer.mozilla.org/en-US/docs/Web/Manifest) file.
18-
- Adds a meta tag for `theme-color`.
16+
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.
1917
1. Installs icon files to support the installed Progressive Web App (PWA).
2018
1. Creates the service worker configuration file called `ngsw-config.json`, specifying caching behaviors and other settings.
2119

packages/angular/pwa/pwa/files/assets/manifest.webmanifest

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
22
"name": "<%= title %>",
33
"short_name": "<%= title %>",
4-
"theme_color": "#1976d2",
5-
"background_color": "#fafafa",
64
"display": "standalone",
75
"scope": "./",
86
"start_url": "./",

packages/angular/pwa/pwa/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ function updateIndexFile(path: string): Rule {
4545
rewriter.on('endTag', (endTag) => {
4646
if (endTag.tagName === 'head') {
4747
rewriter.emitRaw(' <link rel="manifest" href="manifest.webmanifest">\n');
48-
rewriter.emitRaw(' <meta name="theme-color" content="#1976d2">\n');
4948
} else if (endTag.tagName === 'body' && needsNoScript) {
5049
rewriter.emitRaw(
5150
' <noscript>Please enable JavaScript to continue using this application.</noscript>\n',

packages/angular/pwa/pwa/index_spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ describe('PWA Schematic', () => {
112112
const content = tree.readContent('projects/bar/src/index.html');
113113

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

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

0 commit comments

Comments
 (0)