-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix(autocomplete): apply theming to input element #9698
fix(autocomplete): apply theming to input element #9698
Conversation
@devversion similar to what we discussed in #9447 as option 1, but this isn't a full solution... I realized that the loading bar wouldn't be covered by this case (for example docs + accent yields proper coloured input, but incorrect styled loading bar) We could filter the classes (md-warn and md-accent) as you mentioned and forward those to the input container and loading bar -- a similar solution could be applicable to md-input-container + md-select. Edit: or I can add in the progress-linear css |
52d08c9
to
9a459d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added two comments, those should make the review easier after.
@@ -218,6 +218,7 @@ function MdAutocomplete ($$mdSvgRegistry) { | |||
// Retrieve the state of using a md-not-found template by using our attribute, which will | |||
// be added to the element in the template function. | |||
ctrl.hasNotFound = !!element.attr('md-has-not-found'); | |||
$mdTheming(element); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to do this again? The controller already does register the theme.
background-color: '{{warn-color}}'; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are doing something like that, then we should create a mixin for it, so we don't have to repeat it three times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@devversion not sure if you mean in autocomplete-theme.scss or if you mean on in input and linear progress that could be included?
Was hoping that the mixins used in md-tabs would have been a good starting point -- upon closer inspection they just repeated the same code in mixins:
@mixin md-tab-primary { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I meant something like that 👍 This just removes the unnecessary repetitions and it's easier to maintain.
14a955e
to
dcb8aef
Compare
dcb8aef
to
da3027b
Compare
@devversion Sorry, my bad. Fixed. |
I tried it out and it works 👍 Still not a fan of that solution, but it might be easiest for now. |
@mckenzielong I'm sorry that this got stuck for so long. If you can rebase it, I'd be happy to try to get this merged in 1.1.11. If you rebase, please update the commit to include the existing first line plus a blank line and then If you aren't able to rebase it, I can try to take over this work and get it updated merged in. |
@Splaktar i'll take a look 👍 |
da3027b
to
b5d2150
Compare
b5d2150
to
e5bb719
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Verified with manual testing in light and dark modes. Thank you very much for this contribution! Sorry for the delay in getting it merged.
Fixes #9447