Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

select: dropdown doesn't inherit dark theme #3379

Closed
wniehof opened this issue Jun 21, 2015 · 13 comments · Fixed by #11198
Closed

select: dropdown doesn't inherit dark theme #3379

wniehof opened this issue Jun 21, 2015 · 13 comments · Fixed by #11198
Assignees
Labels
has: Pull Request A PR has been created to address this issue P4: minor Minor issues. May not be fixed without community contributions. resolution: fixed severity: inconvenient type: bug ui: theme
Milestone

Comments

@wniehof
Copy link

wniehof commented Jun 21, 2015

There have been multiple reported issues about md-select not inheriting theme closed recently. Like this one: #2483

However I still feel it isn't completely solved.

See this Pen:
http://codepen.io/anon/pen/KpXrMB

The dropdown always seems to inherit the background color of the default theme.

@rschmukler
Copy link
Contributor

Thanks for re-opening, this is now fixed in 691dd2f. Styling fix will come in commit to follow shortly

@sondreb
Copy link

sondreb commented Oct 22, 2015

I can verify that this is still not working, getting the latest 1.0.0-rc1 and when changing themes, with this set:

$mdThemingProvider.alwaysWatchTheme(true);

The menu that opens up on the md-select always renders with the default theme, like screenshots below:

md-select

md-select-2

E.g. if I do like this:
$mdThemingProvider.setDefaultTheme('dark');

Then my menu always render dark, but I obviously don't want that to happen if the user selects "Light" or another theme.

My package.json:
"angular-material": "http://github.com/angular/bower-material/tarball/master",

From my built "lib.js" (built with browserify) this is the version header:

/*!
 * Angular Material Design
 * https://github.com/angular/material
 * @license MIT
 * v1.0.0-rc1-master-325d83e
 */

I see that the signature here is different than the one here:

https://github.com/angular/material/releases/tag/v1.0.0-rc1

Is that perhaps a different build of the rc1 than the one I get from tarball/master?

@rudzikdawid
Copy link
Contributor

rudzikdawid commented Mar 28, 2018

https://material.angular.io/components/menu/overview
material2 has proper implementation: dark menu in dark theme, light menu in light theme.

But material1 always render light menu becouse:

md-menu-content.md-THEME_NAME-theme {
  background-color: '{{background-A100}}';
}

sorurce from: https://github.com/angular/material/blob/master/src/components/menu/menu-theme.scss

maybe it should be:

md-menu-content.md-THEME_NAME-theme {
    background-color: '{{background-hue-1}}';
}

and then we need change color property

md-menu-item {
    color: '{{foreground-1-0.87}}';
}

please reopen this issue

@Splaktar
Copy link
Member

@rudzikdawid what version of AngularJS Material are you using?

I updated the CodePen for 1.1.8 and I see that the dateTheme background is being inherited by the md-select popup.

If you can reproduce the issue that you are seeing with the latest version of AngularJS Material, then please open a new issue with a CodePen reproduction so that we can investigate.

@Splaktar Splaktar added this to the 0.10.1 milestone Mar 28, 2018
@rudzikdawid
Copy link
Contributor

https://codepen.io/anon/pen/qoxORQ?editors=1010
in scenario without backgroundPalette only with .dark() we have light menu in dark theme

@Splaktar
Copy link
Member

@rudzikdawid you should be looking at the select-theme and not the menu-theme, here: https://github.com/angular/material/blob/master/src/components/select/select-theme.scss#L117-L155

@Splaktar Splaktar changed the title md-select dropdown doesn't inherit theme md-select dropdown doesn't inherit dark theme Mar 28, 2018
@Splaktar
Copy link
Member

It looks like the styling fix mentioned in #3379 (comment), never came. Re-opening this.

@Splaktar Splaktar reopened this Mar 28, 2018
@Splaktar Splaktar modified the milestones: 0.10.1, 1.1.9 Mar 28, 2018
@Splaktar Splaktar self-assigned this Mar 28, 2018
@Splaktar Splaktar added ui: theme P4: minor Minor issues. May not be fixed without community contributions. type: bug severity: inconvenient labels Mar 28, 2018
@rudzikdawid
Copy link
Contributor

rudzikdawid commented Mar 28, 2018

@Splaktar You have right
but md-select-menu has the same problem as md-menu-content
both components has background-color: '{{background-A100}}';
that's why they render white background in dark theme.

here is example with md-menu and md-select
https://codepen.io/anon/pen/qoxORQ?editors=1010

i think they should have background-color: '{{background-hue-1}}';
and color: '{{foreground-1}}'; for text ind icons

@Splaktar Splaktar added the has: Pull Request A PR has been created to address this issue label Mar 28, 2018
@Splaktar
Copy link
Member

I've opened PR #11198 to address this with md-select. Please open a new issue for md-menu, it does indeed have the same problem.

@rudzikdawid
Copy link
Contributor

thanks for reopen and PR
here is issue with md-menu #11199

@Splaktar
Copy link
Member

Thank you!

@rudzikdawid
Copy link
Contributor

@Splaktar also datepicker has similar issue
I've opened issue #11200 and PR #11201

@Splaktar Splaktar changed the title md-select dropdown doesn't inherit dark theme select: dropdown doesn't inherit dark theme Apr 7, 2018
@rudzikdawid
Copy link
Contributor

I've opened PR #11230 for md-menu
it's probably last component with theme issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has: Pull Request A PR has been created to address this issue P4: minor Minor issues. May not be fixed without community contributions. resolution: fixed severity: inconvenient type: bug ui: theme
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants