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.
When I dye the 's in a certain region, the contextual links get the same colors an sometime almost appear nonexistent because of hue parallel.
Please see the attached img to best understand me.
Please make CL color standalone and not effected from such changes.
Comment | File | Size | Author |
---|---|---|---|
Untitled.png | 13.98 KB | Benia |
Comments
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commented@Benia, thanks for this issue. I have some problem, because css statement
#id a {color: white;}
has a higher specificity than.contextual-region .contextual .contextual-links a {color: #333}
(see also this comment). But we already had!important
part and it was removed in #2054055: Bartik inappropriately styles all links in the footer, rather than links inside blocks in the footer, breaking contextual links in the process. Therefore, I think it would be correct to mark this issue like 'works as designed'.Comment #4
Benia CreditAttribution: Benia commentedRemoving the
!important
was a mistake; This obligated users to add this...Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedThat's what I thought at first. But later learned that real mistake - use
#id
in css statements. It is bad style, which should be avoided. We should use only.class
in css statements instead#id
&.class { !important }
. Modern layout promotes this practice.Comment #6
Benia CreditAttribution: Benia commentedYou suggest not to style CSS id's at all when styling original theme files written in the Drupal coding standards?
Well, I'm not sure I always have suitable classes to edit... AFAIK not all theme owners nest classes inside the elements.
I had to add this to solve all my problems:
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedThis example is very clear draw, that css rules based on #id is incorrect way.
If to prevent the influence of user-defined rules we need add to the core:
ul.contextual-links li a {color: #333 !important;}
hence, we must add
!important
to all properties of all tags in core .css :)Because, like your example, we have problem with
ul, li, a
tags andbackground, display, color, height, line-height
properties.If no suitable classes, you can try to indicate the most specific path with #id (affecting the desired elements and only at these), or add the necessary classes as a developer.