question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mat-input: text in input element does not respect theme when using dark theme

See original GitHub issue

Bug, feature request, or proposal:

Bug

What is the expected behavior?

The input should have a text color that respects the selected theme

What is the current behavior?

If a matInput is placed within a container that uses a mat-dark-theme color scheme, the text color in the matInput remains black, while every other aspect of the form field respects the dark theme and turns light.

What are the steps to reproduce?

https://stackblitz.com/edit/mat-input-dark-theme-bug

What is the use-case or motivation for changing an existing behavior?

The input should be readable when using dark theme

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Testet using Angular Material v6.4.7 and 7.0.3, and the error is in both versions.

Is there anything else we should know?

No

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ccponycommented, Dec 13, 2018

Yes mmalerba - you can do that. However, changing the accent color to accommodate mat-form-field completely changes the entire theme. So… no. That’s really not a good fix. Bottom line - - Material’s dark-theme is worthwhile as long as there is no requirement for data input. Otherwise, it seems to be worthless.

1reaction
ccponycommented, Dec 12, 2018

Surprised that this issue isn’t getting more attention. The dark mode is unusable in its current condition.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular Material Input does not have white text with dark theme
Update -. I just opened this for the first time in a few days, and now it is showing the text as white...
Read more >
Input field not visible in Angular Material Dark Themes — Solved
css theme. The primary glitch which is noted is that, when a mat-input is consolidated, the field fringe and the content cursor isn't...
Read more >
Mat Input Dark Theme Bug - StackBlitz
Issue template for @angular/material.
Read more >
Creating a custom form field control - Angular Material
Note that the method by default will not respect element ids that have been set manually on the control element through the aria-describedby...
Read more >
angular/material/_theming.scss - UNPKG
243 .cdk-text-field-autofill-monitored:not(:-webkit-autofill) { ... 1283, // Background palette for dark themes. 1284, $mat-dark-theme-background: (.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found