Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
#3083850: Darker blue color for :hover & :active broke the hover and the active styles of the default link buttons.
To reproduce:
- Visit
/admin/structure/block
with Claro theme set as admin theme. - Hover (or long-click) any of the Place block buttons next to the region name.
Proposed resolution
Don't change the text color of link buttons.
Comments
Comment #2
sd9121 CreditAttribution: sd9121 at QED42 commentedComment #3
sd9121 CreditAttribution: sd9121 at QED42 commentedFixed default link button styles issue.
Comment #4
sd9121 CreditAttribution: sd9121 at QED42 commentedComment #5
ant1Needs reroll because of commit #3088805: Simplify Claro's CSS directory structure.
Also it is requested to fix the styling of only the link button. The provided patch removes the styling for all links.
Comment #6
sd9121 CreditAttribution: sd9121 at QED42 commentedRerolled the patch and fixed the styling of only the link button.
Comment #7
sd9121 CreditAttribution: sd9121 at QED42 commentedComment #8
asmita26 CreditAttribution: asmita26 as a volunteer and at QED42 commentedComment #9
asmita26 CreditAttribution: asmita26 as a volunteer and at QED42 commentedTested the styling issue and it is working fine as intended.
Comment #10
asmita26 CreditAttribution: asmita26 as a volunteer and at QED42 commentedComment #11
lauriiiThe patch needs a reroll against Drupal Core
Comment #12
hash6 CreditAttribution: hash6 at QED42 commentedI am working on adding a patch reroll @lauriii
Comment #13
hash6 CreditAttribution: hash6 at QED42 commentedComment #14
hash6 CreditAttribution: hash6 at QED42 commentedUpdated the patch for Drupal Core.
Comment #15
hash6 CreditAttribution: hash6 at QED42 commentedComment #16
lauriiiWe need to also add these changes to the source file
button.pcss.css
.Comment #17
hash6 CreditAttribution: hash6 at QED42 commentedUpdated the code to source file button.pcss.css. Thanks @lauriii
Comment #18
lauriiiSorry but I just realized that all different button states use the same color. 🤦I would convert this into a single rule set that is using
var(--button-fg-color);
to set the color.We will also have to take into account different variations such as
.button--danger
and.button--primary
.Comment #19
hash6 CreditAttribution: hash6 at QED42 commentedAdded the css code for button links and it will prevent affecting button--primary , button--danger classes as new css code's placement is before css added for button--primary and button--danger.
Comment #20
hash6 CreditAttribution: hash6 at QED42 commentedUpdated the styling to include
a.button--primary
anda.button--danger
styling which will be of higher weight and tested it on pages like custom block library page where we havebutton--primary
for add custom block.Comment #21
lauriiiThank you! This looks very close to done!
Nit: let's move this after other rules related to this.
Let's group this together with the other
.button--danger
rules.Wouldn't the
.button:hover
styles override the default styles for.button--primary
if we removed this?Comment #22
hash6 CreditAttribution: hash6 at QED42 commentedUpdated the styling as per the suggestions.
Comment #23
lauriiiWe should remove the focus state from here given that the
a
element doesn't set color for this state. This causes some issues with the other variations.Comment #24
hash6 CreditAttribution: hash6 at QED42 commentedremoved the
:focus
as per the suggestion.Comment #25
hash6 CreditAttribution: hash6 at QED42 commentedComment #26
lauriiiAwesome! Tested default, primary and danger variations of
a.button
in all states (hover, active and focus) and all worked as expected. Thank you @hash6 for the persistence on this issue! 🙏 I'm unassigning this issue since I believe this is ready for a committer review.Comment #27
hash6 CreditAttribution: hash6 at QED42 commentedThanks @lauriii for continuous support and guidance on every stage. Highly appreciated !!!
Comment #28
alexpottCommitted and pushed 4b74e91fe3 to 9.0.x and 492fd1e3d0 to 8.9.x and 5a5d78365c to 8.8.x. Thanks!
Backported to 8.8.x since Claro is experimental.
Removed unnecessary new lines on commit.