Opened 9 years ago
Closed 8 years ago
#35126 closed enhancement (fixed)
Improvements for the new .button-link CSS class
Reported by: | afercia | Owned by: | Cheffheid |
---|---|---|---|
Milestone: | 4.8 | Priority: | normal |
Severity: | normal | Version: | 4.4 |
Component: | Administration | Keywords: | semantic-buttons has-patch |
Focuses: | ui, accessibility | Cc: |
Description
Splitting this out from #31476.
The .button-link
CSS rule for link-like buttons introduced in [35636] provides a basic reset and just some basic styling.
A good question was raised on #31476, wondering if the .button-link CSS class should provide also the default/hover/active/focus colors and underline to actually look like real links.
Not doing that will force to implement them in every place the link style is used.
cc @helen, @michaelarestad
Attachments (8)
Change History (57)
#2
@
9 years ago
@psconsole hi, personally I'd make them look like buttons (not primary buttons though, just standard ones). By the way I didn't want to introduce visual changes since they should be thoroughly considered across all the admin. Open to suggestions from a UI perspective :)
This ticket was mentioned in Slack in #design by afercia. View the logs.
9 years ago
#4
@
9 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 4.5
- Owner set to michaelarestad
- Status changed from new to assigned
This ticket was mentioned in Slack in #design by afercia. View the logs.
9 years ago
This ticket was mentioned in Slack in #core by chriscct7. View the logs.
9 years ago
#7
@
9 years ago
- Milestone changed from 4.5 to Future Release
Punting per discussion in trac: https://wordpress.slack.com/archives/core/p1457560209004510
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
9 years ago
@
9 years ago
Takes the "extend what we have" approach, rather than "adjust the default and update what's affected" one.
#11
@
9 years ago
- Keywords has-patch needs-testing 2nd-opinion added; needs-patch removed
Digging through everywhere the .button-link
class is being used currently, and it looks like the impact of updating it is not that significant. For the most part, it results in underlines on modal close buttons, and a change in colour on the postbox triangles. Each of these should be fixed in patch 2, but should definitely have a second pair of eyes in case I missed something.
There are a few instances where I've left the change alone for further discussion/deciding:
The Reorder link on Menus and Widgets in the Customizer became underlined. Brings it more in line with the other button links, and so I've left it as it is.
The Press This sidebar got a noticable hover state that it didn't have before. An improvement in its own right, though maybe not exactly in an agreeable style.
#12
follow-up:
↓ 16
@
9 years ago
- Focuses accessibility added
- Milestone changed from Future Release to 4.6
Personally, I like the direction here and I think this would make the .button-link
class more useful and easier to use. A few things to consider, to improve the patch:
- usually, links inside list tables are not underlined see
.widefat a
incommon.css
I'd suggest to do the same for.button-link
when inside list tables - maybe worth searching all the CSS for
text-decoration: none;
to check if there are special cases that should be addressed - though I'd agree some styles should be consistent across all the WordPress ecosystem, I'm pretty sure the maintainers of Press This and the Customizer would like to keep the styles unchanged, since they're both sort of self-contained applications
Any thougths more than welcome. /cc @helen @michaelarestad @celloexpressions
#13
@
9 years ago
I'm fine with the added underline in the customizer, since that would match the delete buttons. I'm not sure if the button-link style is generally the best for this, but it provides nice hierarchy with the add buttons so we can keep it for now.
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
9 years ago
#16
in reply to:
↑ 12
@
9 years ago
Replying to afercia:
- maybe worth searching all the CSS for
text-decoration: none;
to check if there are special cases that should be addressed
I've added the .button-link
class to where I thought it would make sense after doing this search. I may have been a little enthusiastic with adding it in places where I thought it could have buttons instead of links in the future though.
@celloexpressions Cool, thank you sir!
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
8 years ago
#18
follow-up:
↓ 19
@
8 years ago
While reviewing this patch I was missing the red color for the menu item remove link in the customizer.
<button type="button" class="button-link item-delete submitdelete deletion">Remove</button>
The .button-link.menu-delete
has the red color, but the .button-link
class adds a color to the remove link which displays as blue only now.
Reproduce
Opening the customizer
Open a menu (or create one)
Open a menuitem (or create one)
Compare the remove button/link to the trunk version.
#19
in reply to:
↑ 18
@
8 years ago
Replying to jipmoors:
While reviewing this patch I was missing the red color for the menu item remove link in the customizer.
Yep, while it makes sense to me to have the default button-link
color set to blue, then the ones that need to be red should use a rule with a higher specificity than .wp-core-ui .button-link
. This probably needs some more thoughts.
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
8 years ago
#21
@
8 years ago
- Keywords early added
- Milestone changed from 4.6 to Future Release
Punting to future release, hoping in a big help from the next release lead ;)
This ticket was mentioned in Slack in #core by desrosj. View the logs.
8 years ago
#24
@
8 years ago
This just needs a consensus on the proposed direction, and then it should be good to go after more testing.
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
8 years ago
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
8 years ago
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
8 years ago
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
8 years ago
#29
@
8 years ago
As per the accessibility meeting last Monday, we'll continue on the "extend what we have" path for this ticket. That way we can keep the .button-link
class as it is and change the button-links that need to be blue to blue in a more controlled manner without having to worry about overriding the ones that have their style already mostly taken care of (like the red .menu-delete
ones).
I'll refresh the first patch and append the new class to buttons that need it.
Anyone have any qualms about using .like-default
as the class name for the "default blue link" style (trying to keep the class name colour agnostic, so that it can be overwritten for high-contrast admin themes and still make sense)?
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
8 years ago
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
8 years ago
#32
@
8 years ago
Sorry about that.
Opted to go with .like-core-anchor
as a modifier to turn a button link into something that resembles a core anchor more closely in most browsers. Except the ones that don't add an underline to anchor tags by default, since it does add that still.
Also added a .like-delete
as a modifier for red links.
Some testing and review appreciated, feel free to tear it apart. :)
This ticket was mentioned in Slack in #accessibility by cheffheid. View the logs.
8 years ago
#34
@
8 years ago
- Milestone changed from 4.7 to Future Release
- Type changed from defect (bug) to enhancement
I would rather see this get a full base set of styles because of its name (we went with link
and not reset
, right?) and then work on fixing places that end up broken. This also seems more like an enhancement than a bug fix, so punting.
This ticket was mentioned in Slack in #core by afercia. View the logs.
8 years ago
#36
@
8 years ago
See also the last Slack conversation linked above for a possible future direction.
#37
@
8 years ago
The .2 patch still applies fine, so that'll be a good place to continue from then.
It already includes some fixes for button links that needed some additional love to restore their look as they were before, but I imagine there'll be more at this point (and some that manually had their styles updated to links that need to be cleaned up).
Wouldn't mind some help with going through all of that. :)
This ticket was mentioned in Slack in #accessibility by afercia. View the logs.
8 years ago
#40
@
8 years ago
- Keywords needs-testing 2nd-opinion removed
- Milestone changed from Future Release to 4.8
Refreshed patch builds on the previous ones, with some adjustments discussed with @Cheffheid.
Quoting the conversation on Slack linked above (2 links above), the consensus was about:
it's way simpler to just update button-link adding color and underline, then modifier classes for red links etc.
In 35126.diff the base class just makes a button look like a regular link and then it can use modifiers as stackable classes, in the same way all the WP buttons CSS classes work. For example, button-link button-link-delete
makes a button link red.
In a few places, some button-links will be now underlined. I'd say it's not too bad and seems more consistent to me, see screenshots below. Special places to check:
- Customizer
- Media Views
- Press This: I've removed some
button-link
classes since they were mainly used to reset the buttons.
Worth noting button-link
was never intended as a "button reset" and shouldn't be used that way. There's probably the need for a button-reset
specific class, but I'd say that's material for a separate ticket.
Moving to 4.8.
#41
@
8 years ago
Refreshed patch to reset the subtle CSS transition on the media .wp-core-ui .attachment-close
.
#43
@
8 years ago
- Keywords needs-patch added; has-patch removed
- Resolution fixed deleted
- Status changed from closed to reopened
Minor visual breakages were expected. Noticed a couple so far:
In IE 11 (doesn't happen on modern browsers): the post boxes handlediv
shows the underline
In all browsers: the Customizer "reorder toggle" needs some love: the button contains some span elements that use their own colors so on some button states, text and underline have different colors:
#45
@
8 years ago
It's slightly weird that IE11 would render that underline.
text-decoration
is being set to none on the :before
with an !important and everything, but I guess having .button-link
set it to underline is enough for it to render it on the button's content.
Setting text-decoration
to none on the button seems to fix it. I'll upload a patch for that.
#47
@
8 years ago
- Keywords has-patch added; needs-patch removed
I'd rather avoid encouraging the use of the .button-link
class as a reset so I'd propose to remove it from the postboxes toggle.
About the Customizer .reorder-toggle
, it used to have a dotted border but that doesn't apply any longer since the refactoring in [35636] which also removed the class .not-a-button
. I'd say to just remove the rules specific to .reorder-toggle
and let it use the colors from .button-link
.
The new patch 35126.3.diff fixes also #38712, props to f.staude and Presskopp.
@afercia Do you want to make the links to display like buttons?