-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
color
vs value
attribute
#73
Comments
Do I get it correctly that the In general, I think it's good to be consistent with the platform and let authors use the elements the way they used to. I think it's a win-win. |
No, I think it's okay for authors to set either of them, and they should be kept in sync. I was also thinking that |
For inspiration, I was using |
I believe we have a bit more, e.g., |
Related: nudeui/element#24 |
When rewriting
<color-swatch>
, I opted for acolor
attribute. However, I’m not so sure it was a good idea.value
is far more common across HTML elements, and there are libraries and frameworks that work out of the box with elements that follow the convention of.value
property +input
event for user-initiated changes (e.g. Vue’sv-model
). Also,color
is aColor
, so conceptually since the attribute is specifying a string,value
seems more fitting.So what about:
value
attribute, which gets reflected into avalue
propertycolor
property that contains aColor
instance ifthis.value
is a valid color, ornull
otherwise.This would be across all components whose value is a color (
<color-inline>
,<color-swatch>
,<color-picker>
).The text was updated successfully, but these errors were encountered: