Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override toggle colors for specific buttons #126

Open
Redsandro opened this issue Jul 17, 2019 · 4 comments
Open

Override toggle colors for specific buttons #126

Redsandro opened this issue Jul 17, 2019 · 4 comments

Comments

@Redsandro
Copy link

I'm curious if there's a better way than overriding the color values using custom css selectors and supplying a custom class name?

This is basically what I'm doing now:

.x-toggle-flip-warn {
	.x-toggle-flip {
		&::before {
			background-color: #ffff00 !important;
		}
		&::after {
			background-color: #aaaaaa !important;
		}
	}
}
@knownasilya
Copy link
Owner

That looks correct, although I'd try to avoid the !importants. Is there any way that we could make it easier for you?

@Redsandro
Copy link
Author

If no one requested something like this before, I wouldn't spend time on it.

However I'm using color codes to toggle filters for certain labels, where on is the color of the label and off is grey. And it's nice. If you want to make this easier for others (and me), I would suggest something similar to onLabel and offLabel. E.g. onClass/offClass and/or onStyle/offStyle.

This way, one doesn't have to figure out the proper selector and keep an eye for future changes to the DOM/selector names.

@knownasilya
Copy link
Owner

I like the idea of onClass and offClass, I'll keep this open for next time I'm working on improvements here. Thanks!

@Redsandro
Copy link
Author

Great! I'll stay subscribed. If the time comes, I can update my css selectors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants