-
-
Notifications
You must be signed in to change notification settings - Fork 835
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
Remove color validation in appearance admin page & add color indicator #3140
Conversation
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.
I love this!
After making this I thought this might be a good use for a new component like ColorInput or something? That way it also avoids using ::after for the box... though a component would have to be an entire form group.
I think a ColorInput
would be perfect, though why would it have to be a Form-group
? if it's about wrapping the input itself, I guess we can just wrap it in a Color-input
div and have that within the form group. Would be consistent with Search-input
as well.
Perhaps a setting type instead? Though type="color" is also a valid input type.
my experience with type=color
(at least on chrome) is that it's not great, it does provide a native color picker which is nice but.. can be a pain to use.
Nevermind, it doesn't. I thought the CSS stylings were from it lol. But there's also FormControl class.
What I meant with mentioning |
Oh yeah that's a good point. Hmm.. I think it'd be fine to go with whatever naming, |
Made it a component instead + the validation. One can click through both the box & icon. I tested adding a padding so text doesn't go underneath but then you can't click through the box to the input as it's no longer there... and so I decided against it. My only concern with the code is how it obtains the |
The only other way I can think of is a data attribute, which you can then use with the |
Oh, true, but I wasn't referring to the CSS value. I meant the input value from the JS side that is then passed - I don't like using the Tried to override |
I think if we wrap it in a |
Should do, most definitely with |
They already have this :P
👍 |
Re-requested reviews just to clear them 👍 |
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.
Looks good!
a nitpick though, the class naming,
as per the convention we follow, Color-input--preview
should be Color-input-preview
, same for Color-input--icon
. I'd also rename Color-input
to ColorInput
.
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.
Phenomenal, thank you so much! I'm very excited to see continued growth of Flarum's component library :)
Only thing is, we should probably export it in compat so extensions can use it too.
Can't wait till we never have to deal with compat
again...
c109229
to
02a4748
Compare
Fixes #2121
Changes proposed in this pull request:
Reviewers should focus on:
ColorInput
or something? That way it also avoids using::after
for the box... though a component would have to be an entire form group.type="color"
is also a valid input type.input::after
is not valid so that's why I had to add it to Form-groupScreenshot
Necessity
Confirmed
composer test
).