components icon indicating copy to clipboard operation
components copied to clipboard

md-button-toggle-group, CSS for button states

Open JordanSliz opened this issue 9 years ago • 7 comments

I haven't seen anyone talking much about this, so I'm adding it as a new issue.

What I'd like to achieve is to style the button states of the md-button-toggle-group. :hover works with no issue. However, :active only works on mouse down, and none of the other pseudoclasses, :checked, :enabled, ::selection, :valid, nor :focus, have any effect of any kind of them. (Obviously some of those were desperate.)

It's my assumption that somewhere, there is a primary color/similar being assigned to it in the scripting. Alas, as a designer first and programmer second, this is all a little above my head as yet. Hopefully someone can help me out.

Plunker here: https://plnkr.co/edit/FwMb2w7wrWWzD256mOkI?p=preview

JordanSliz avatar Jan 18 '17 21:01 JordanSliz

Answered my own question in time. It's injecting classes on multiple element levels that lay-over one another. .md-button-toggle-checked and .md-button-toggle-label-content both are injected on click.

JordanSliz avatar Jan 18 '17 22:01 JordanSliz

The real trouble is that the TS injecting classes on actions makes it nigh impossible to tell if the page-level styles will or will not overwrite what you have written.

Seems to me it would be extremely useful to be able to turn off the precedent of the A2 styles, and allow designers more of a "final say," without having to resort to rewriting whole themes. But, to the theme writing I'll probably go now.

JordanSliz avatar Jan 18 '17 22:01 JordanSliz

So, having done my own theming for Ang2 now, I can't seem to access md-button-toggle or md-button-toggle-group.

Can anyone explain how to affect these items?

JordanSliz avatar Jan 31 '17 00:01 JordanSliz

if you want to change the default gray color from the md-button, you only need to add this line in the main styles.css file .md-button-toggle-checked .md-button-toggle-label-content{ background-color:#8BC34A !important; }

rdelriods01 avatar Feb 12 '17 08:02 rdelriods01

Does it work? I want to change padding for md-button-toggle-label-content from "0 16px" to "0 10px".

Should i change in library files? is there a way I can override? I have tried in my component scss file. It doesnt work.

abansal77 avatar Mar 10 '17 12:03 abansal77

Closing this since I think it's gone off-topic. Feel free to open a new issue that uses the issue template to clarify what you're reporting / proposing.

jelbourn avatar Apr 12 '17 01:04 jelbourn

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.