Applying a style.color to input placeholder
See original GitHub issueπ bug report
Affected Package
The issue is caused by package @angular/coreIs this a regression?
NO
Description
When adding a [style.color]
to an input field, that color is expected to be applied to the input text as well as the placeholder.
It seems that the expected behavior is fine on Firefox, but on Chrome the color of the placeholder falls back to default like shown in the Stackblitz example below.
π¬ Minimal Reproduction
https://stackblitz.com/edit/angular-gvssfb?file=src/app/app.component.html
π Your Environment
Angular Version:
Angular CLI: 7.0.4
Node: 10.18.0
OS: darwin x64
Angular: 7.0.3
... animations, cdk, common, compiler, compiler-cli, core, forms
... http, language-service, material, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.6.8
@angular-devkit/build-angular 0.6.8
@angular-devkit/build-optimizer 0.6.8
@angular-devkit/core 0.6.8
@angular-devkit/schematics 7.0.4
@angular/cli 7.0.4
@angular/flex-layout 7.0.0-beta.19
@ngtools/webpack 6.0.8
@schematics/angular 7.0.4
@schematics/update 0.10.4
rxjs 6.3.3
typescript 3.1.6
webpack 4.8.3
Anything else relevant? It occurs on Google Chrome Version 81.0.4044.129 (Official Build) (64-bit). Works fine on Firefox.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How To Change Input Placeholder Color - W3Schools
In most browsers, the placeholder text is grey. To change this, style the placeholder with the non-standard ::placeholder selector. Note that Firefox adds...
Read more >placeholder - CSS: Cascading Style Sheets - MDN Web Docs
Note: In most browsers, the appearance of placeholder text is a translucent or light gray color by default. Syntax. ::placeholder. AccessibilityΒ ...
Read more >Change a HTML5 input's placeholder color with CSS
This property allows you to specify a fill color for text. If it is not set, then the color property will be used...
Read more >Change an HTML5 input placeholder color with CSS
Change an HTML5 input placeholder color with CSS ... Example 1: This code shows the use of ::placeholder selectors in different browsers. HTMLΒ ......
Read more >How To Change the Color of an HTML5 Input Placeholder ...
The default color of a placeholder text is light grey in most browsers. If you want to change it, you need to use...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Iβm going to close this issue as it is outside of Angularβs scope and we canβt do anything about the issue here in this project.
I can effectively see the difference between Chrome and FFox in terms of styling placeholderβs text:
Having said this, the observed discrepancy has nothing to do with Angular, as I can observe the same effect with vanilla HTML, without any Angular involvement, see: https://stackblitz.com/edit/typescript-ufp1pz?file=index.html