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

Input field: Additional Class as a textarea #19367

Open
daveloodts opened this issue Dec 30, 2019 · 12 comments
Open

Input field: Additional Class as a textarea #19367

daveloodts opened this issue Dec 30, 2019 · 12 comments
Labels
Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.

Comments

@daveloodts
Copy link

I started out with Tailwind; and it's amazing.

But the input field for additional classes in Gutenberg blocks is so small; i hope this input field could be a textarea field to have a better overview of entered classes.

Valid feature request?

@youknowriad
Copy link
Contributor

I think the field is an input because new lines are not allowed in HTML classnames.

@daveloodts
Copy link
Author

Probably, but there are PHP solutions for it, i guess.
Since i brought up this issue, i hear a few other people complaint too that the class field is way to small.

@talldan talldan added [Type] Enhancement A suggestion for improvement. Needs Design Feedback Needs general design feedback. labels Feb 4, 2020
@StevenDufresne
Copy link
Contributor

I wonder if tags would make for a better experience, either within a textarea or under the input.

@daveloodts
Copy link
Author

@StevenDufresne ; exactly this is even better. Take a look at how Editorskit plugin handles the Class field; it's amazingly good. Even more if we can add class suggestions, which add to the autocompletion.

Last week on a WordPress Meetup, i dropped this idea and someone made this autocomplete field:

I've been toying around adding @tailwindcss support to #Gutenberg after last night's meetup at @wpantwerp. Quite easy to work with, actually! pic.twitter.com/lVarpVv0m4

— Koen Van den Wijngaert (@vdwijngaert) February 18, 2020
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

In this strange are of Gutenberg, where every other Gutenberg plugin makes it's own standard; the class field can play a huge role in getting the right standard way sooner. It will not be a non-tech user feature, but it would make a foundation for it. When custom Gutenberg features spit out classes; which can be viewed over there.

@richtabor
Copy link
Member

We chatted about this in today's design meeting (Slack link). We discussed that it'd be an interesting idea to explore, as this would improve readability of individual classes added.

It's worth noting that this is an advanced usage area, that not many folks will use - but those who do use it would like to see what classes they've applied to the block. In its current form it's quite difficult to see the applied classes, as they're in a singular input field.

Let's move forward with mockups to start feeling it out. 💪

@richtabor richtabor added Needs Design Needs design efforts. and removed Needs Design Feedback Needs general design feedback. labels May 12, 2020
@daveloodts
Copy link
Author

Fantastic!

@mapk
Copy link
Contributor

mapk commented Jul 16, 2020

Alrighty, a little prettier UI for classnames.

classnames

After building this in Figma, I took a look at how tags are presented. It's very similar:

Screen Shot 2020-07-16 at 3 36 02 PM

@mapk mapk added Needs Design Feedback Needs general design feedback. and removed Needs Design Needs design efforts. labels Jul 16, 2020
@mapk
Copy link
Contributor

mapk commented Nov 17, 2020

Tags recently took on a similar design.

Screen Shot 2020-11-17 at 8 36 34 AM

@paaljoachim
Copy link
Contributor

What needs to be done here to move this issue onward?

@mapk
Copy link
Contributor

mapk commented Nov 24, 2020

@paaljoachim if there's a bit of consensus on the design proposal, we can relabel this with "needs dev" and move it on.

@paaljoachim paaljoachim added Needs Dev Ready for, and needs developer efforts and removed Needs Design Feedback Needs general design feedback. labels Nov 24, 2020
@paaljoachim
Copy link
Contributor

It looks like a good idea to move forward with. I adjusted the labels.

@coreyworrell
Copy link
Contributor

In case this ever gets traction, I've done some testing and I feel that the typical "token" or "tag" style input field is not super easy to use for adding classes. I sometimes like to add classes in a logical order, or to change a suffix (ie: justify-content-between to justify-content-around or something), and having to delete the entire class and type it all again with different suffix was annoying. So the input should allow backspace to "enter into" the token to edit instead of deleting it altogether, and allow to place cursor in-between other tokens to add a new token, or insert cursor inside an existing token to modify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

8 participants