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

[NEEDS RESEARCH] Create input type="color" proposal #334

Open
gregwhitworth opened this issue Apr 15, 2021 · 3 comments
Open

[NEEDS RESEARCH] Create input type="color" proposal #334

gregwhitworth opened this issue Apr 15, 2021 · 3 comments
Labels
needs-research This issue needs research in order to move forward stale

Comments

@gregwhitworth
Copy link
Member

There is an outstanding ask in WHATWG to enable the color input to support alpha channels, among other things.@domenic outlines the following options in order to enable this:

  • is already a mess. We could add more to the mess (e.g. a new type="" value, or a format="" that applies only to type="color", or valueWithAlpha/valueAsWideGamut getters, or...). Or we could start over with a new input type (e.g. like switch attempted). Although it'd be nice to avoid extending the mess, it sure is convenient and expedient.
  • Reusing also has a better backward-compatibility story. For example if we did then in browsers that don't implement the user would get a text box, which might be better than nothing. Or, if we reused and added some of the additions mentioned above, we could have sites which accept alpha-less colors in older browsers and alpha-ful colors in new ones.

Further down the thread there is general agreement that the path forward will be a new tag that offers this capability due to backwards compatibility that changing <input type="color"> will cause. As Domenic later states:

I would prefer a new tag, though one completely unrelated to HTMLInputElement. (You can't have that as a base class without inheriting all of its complexity.)

There is still a demand for this functionality as I was just asked by someone on our SLDS team about this capability missing in the native controls. We should begin the work of doing the research for the color control in order to define this new HTML element.

Notes:

  • Color has overlap of functionality with the <select> in that it has a <popup>, so certain discussions and resolutions we'll want to ensure are consistent
  • Thorough research into the various color wells will need to be done
  • Future proofing that control for extensibility, as @svgeesus noted in the other thread "do we only have 1 chance at this". The overall design of the IDL for color value selection and storage should be worked with closely with the CSSWG and color editors.
@gregwhitworth gregwhitworth added the needs-research This issue needs research in order to move forward label Apr 15, 2021
@gregwhitworth gregwhitworth changed the title Define input type="color" for a new element [NEEDS RESEARCH] Create input type="color" proposal Apr 15, 2021
@svgeesus
Copy link

svgeesus commented May 6, 2021

Related: TAG review of EyeDropper API

@danburzo
Copy link

If contributions are accepted, I'd like to help with researching the topic. If there exists any kind of framework, or a set of questions this research should answer, it would be of great help. (Otherwise I can put forth a set of questions to frame the problem.)

@github-actions
Copy link

There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label.

@github-actions github-actions bot added the stale label Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-research This issue needs research in order to move forward stale
Projects
None yet
Development

No branches or pull requests

3 participants