-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
A suggestion to make it easier to style individual pieces #192
Comments
The color picker has an I've been playing around with the idea of possibly moving to webcomponents for the next version of iro.js, and targeting shadowDOM elements with CSS isn't really possible, so I'll need to think a bit more about styling components. I wouldn't want to introduce something now only to take it away in the next major version. |
As best I can tell based on the documentation, there are a handful of properties you can modify, but there's no way to add a class and/or arbitrary styles to the color picker or any of its components. This severely limits the customizability of the picker, and would be relatively simple to address by providing a way to configure classes and/or styles to the picker and components.
Iro and its components should...
className
property, which can be a string (which will be split on whitespace) or an array of strings. Each of these strings would be added to theclassList
of the appropriate element.element.classList.add(...classes)
style
property, which must be an object. Each property of the style object should be applied to the element's own style object.Object.keys(styles).forEach( key => element.style[key] = styles[key])
Here's an example of what it might look like in use.
The text was updated successfully, but these errors were encountered: