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.

Button no longer inherits color from theme

See original GitHub issue

According to the readme:

By default an MDC Button will inherit its color from the theme

:root {
  --mdc-theme-primary: #3fa9f5;
}

Since 0.21.0, this is no longer happening and the buttons are all black.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
Lc0rEcommented, Sep 25, 2017

Hey, @hebbet thanks for the useful comment!

As I said, I came here just after having read the documentation which is (sadly) not mentioning this. As a general rule, I think that it should be a good approach to update docs when something showed up in the very first tutorial is removed or modified…

I also found terribly annoying that the example linked in the theming section docs/theming/ which is pointing to the plunker https://plnkr.co/edit/qxt7qpPsXgkt9UbMnE36?p=preview, contains the old (I guess old since I just approached the repository) mdl- classes.

Anyway, we don’t have now the possibility to use CSS Custom Properties? Just SASS?

2reactions
robbyricecommented, Sep 25, 2017

I’ve run into this as well after updating to version 0.21.1. I think the main issue is that the documentation doesn’t reflect the current behavior of the library. As stated above (quotation from the current documentation),

By default an MDC Button will inherit its color from the theme

Unfortunately, this is not the case and buttons are rendered with a black background no matter what the theme is set to. This is the case on the button demo page as well. It is not a problem to style the button background (or any other component) on a project-by-project basis. However, the documentation should be clear about that. Otherwise, there is something missing from the CSS that is preventing the button background from being styled correctly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Why doesn't theme inherit button style - Stack Overflow
I am having a problems with my Transparent style inheriting the button style from the parent style (AppTheme). The button has a different...
Read more >
Bottons inheriting old theme colors | WordPress.org
I'm getting some buttons that are inheriting an old theme color with a thick dark ... some of the darker buttons are not...
Read more >
inherit - CSS: Cascading Style Sheets - MDN Web Docs
The inherit CSS keyword causes the element to take the computed value of the property from its parent element. It can be applied...
Read more >
Button API - Material UI - MUI
Rule name Global class Description root.MuiButton‑root Styles applied to the root element. fullWidth.MuiButton‑fullWidth Styles applied to the root element if fullWidth= . endIcon.MuiButton‑endIcon Styles applied to...
Read more >
Styles and Themes - Android Developers
For example, one style might specify a button's attributes. ... since the styles are using the semantic names and not specific color definitions....
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