-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add Additional CSS Classes to Link UI #67560
base: trunk
Are you sure you want to change the base?
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @BiDbMAK, @sarahmonster, @prasadgupte, @smerriman, @kticka, @leadclown, @ScotsScripts, @ekazda, @svedish, @frogdesk, @michaelsoriano, @Chillifish, @DougMelvin, @burnuser, @logiclink. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +179 B (+0.01%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
71312e3
to
11493c0
Compare
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.
Nice addition, thanks for working on this.
In my testing, I noticed that the classes are correctly applied on the front end:
But when I go back to the editor to change them, the classes input is empty:
The correct classes are still applied to the link markup within the editor.
Also, I think it would be good to add the same help
text used on the paragraph CSS classes input: "Separate multiple classes with spaces." And, maybe even the same input title, "Additional CSS Class(es)" rather than "Additional CSS Classes".
@mikachan Thanks for taking a look at this one. Somehow I had a mistake in the functionality. It should now be fixed. TBH it's probably worth me adding a test for this so I'll do that as well. |
Good functionality, but it looks pretty rough. Any ideas how to clean this up @WordPress/gutenberg-design? |
It is pretty imbalanced, indeed, but it has to be in an inline UI. In places like these, the density of the UI really matters, so the "additional classes" input doesn't end up being weighted similarly to the URL itself. Outside of adding a key-value-pair-like plus button to add, a compact grid that is similar to such a key/value pair UI may be useful here? This would make use of labels on the left, and 32px compact inputs. I wonder if we have some precedence for this, or is this a new pattern that needs establishing? |
This is exactly how I felt about it. Looks imbalanced but didn't want to come up with my own new pattern without getting some wider input from Design folks. I'll await some concrete guidance in order that we can land this. |
What?
Adds and
Additional CSS Classes
to the Link UI for inline links.Closes #13368
Why?
Much requested feature. Brings parity with Classic Editor.
How?
Add requisite logic to allow for rendering custom settings.
Apply to inline links.
Testing Instructions
Additional CSS Classes
fieldSave
Additional CSS Classes
fieldclass
attribute is correct added to the link.class
attribute corresponding to that which you addedTesting Instructions for Keyboard
Screenshots or screencast