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 field #1748
Color field #1748
Conversation
where | ||
isHexColor :: String -> Bool | ||
isHexColor ['#',a,b,c,d,e,f] = all isHexDigit [a,b,c,d,e,f] | ||
isHexColor _ = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hex numbers in CSS can also be #fff
(3 letters). Are you sure that all browsers ever only set 6 letter hex digits?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quoting from https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input/color:
"The value must be in seven-character hexadecimal notation, meaning the "#" character followed by two digits each representing red, green, and blue, like this: #rrggbb".
It is supposed to cover only HTML, not CSS.
Please let me know if I have to look in other non-HTML specs such as CSS. I'm not sure of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I guess you're right! BTW, this would be the most official spec for HTML input: https://html.spec.whatwg.org/multipage/input.html#color-state-(type=color)
… the "bookkeeping details" are also interesting.
@ciukstar Thanks for the PR! Looks good to me 👍 I've started running the build on CI for this, and hopefully we can get this over the line for you soon. |
Hi! I see 14 successful and 4 failed checks. Do I need to do something to make it pass all the checks? |
I have no idea why it would have stopped working recently, I'm assuming that it's to do with GitHub Actions upgrading MacOS images. I see this error message:
I'd recommend ignoring the failure for now. |
Reference issue #1747
This PR adds a new
colorField
function to create an html color field (<input type="color">
) as described at https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input/colorBefore submitting your PR, check that you've:
@since
declarations to the Haddocks for new, public APIsAfter submitting your PR: