Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[Validator] Added CssColor constraint#14965
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
fc18710 tob21f21bCompareb21f21b tod301bfdCompare5e2c888 to4a20f74CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
e9f296c tofa5743eCompareThis PR was merged into the 5.4 branch.Discussion----------[Validator] Added `CssColor` constraint| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | no| New feature? | yes| Deprecations? | no| Tickets || License | MIT| Doc PR |symfony/symfony-docs#14965This PR introduces a new `CssColor` constraint. It comes with 3 validation modes:- Long, which allows all hexadecimal representation of a color, or 9 (#EEEEEEFF) characters- Short, which only allows hexadecimal colors on 4 (#EEE), 5 (#FFF00) characters- Named colors, which matches [the official list of named colors](https://www.w3.org/TR/css-color-4/#named-color)- HTML5, which allows hexadecimal colors on 7 (#EEEEEE) characters as well as the HTML5 input type colorI know that such a color validation already exists in Symfony (in the `ColorType` class), but it's hardcoded in the FormType, and not usable as an assert Annotation. We could decide to remove this hardcoded validation in favor of the new added `CssColor` constraint. Let me know, if yes, I will make the change.Commits-------b36371c Added new CssColor constraint
This PR was merged into the 5.4 branch.Discussion----------[Validator] Added `CssColor` constraint| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | no| New feature? | yes| Deprecations? | no| Tickets || License | MIT| Doc PR |symfony/symfony-docs#14965This PR introduces a new `CssColor` constraint. It comes with 3 validation modes:- Long, which allows all hexadecimal representation of a color, or 9 (#EEEEEEFF) characters- Short, which only allows hexadecimal colors on 4 (#EEE), 5 (#FFF00) characters- Named colors, which matches [the official list of named colors](https://www.w3.org/TR/css-color-4/#named-color)- HTML5, which allows hexadecimal colors on 7 (#EEEEEE) characters as well as the HTML5 input type colorI know that such a color validation already exists in Symfony (in the `ColorType` class), but it's hardcoded in the FormType, and not usable as an assert Annotation. We could decide to remove this hardcoded validation in favor of the new added `CssColor` constraint. Let me know, if yes, I will make the change.Commits-------b36371c06e Added new CssColor constraint
derrabus commentedOct 6, 2021
The feature PR has been merged. |
welcoMattic commentedOct 6, 2021
It needs some work here to report the last changes (modes instead of mode) from the code. |
f395714 to10810adComparewelcoMattic commentedOct 7, 2021
I don't understand why the CI fails 🤔 |
OskarStark commentedOct 8, 2021
friendly ping@Nyholm can you help? |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
OskarStark left a comment
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.
Some minor, afterwards good to merge
Nyholm commentedOct 8, 2021
The CI is correct. The class is called “Constraint” https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Validator/Constraint.php |
Nyholm commentedOct 8, 2021
Oh. Sorry. I see now that you import partial FQCN. Ci does not support that (appearently) Feel free to ignore that :) |
10810ad to70bcc38Compare70bcc38 tofd57353Comparefd57353 tofc1539cCompareOskarStark commentedOct 8, 2021
Thanks Mathieu for working on this feature, this is much appreciated. |
…aviereguiluz)This PR was merged into the 5.4 branch.Discussion----------[Validator] Some tweaks to CssColor constraintThis tweaks the great work made by `@welcoMattic` insymfony#14965.It's mostly minor tweaks ... but I also expanded the "basic usage" example to show the case of not adding any parameters to the constraint, which is a common case when you just want to allow any of the valid CSS color formats.Commits-------07e38b7 [Validator] Some tweaks to CssColor constraint
Uh oh!
There was an error while loading.Please reload this page.
This PR introduces the new
CssColorconstraint, contributed insymfony/symfony#40168