Colored icons in nested list structures are not shown in their color
See original GitHub issueBug Report
I’m migrating from semantic-ui and found a difference that works in an unexpected way to me. When using nested lists where an item is a link, that is a a
tag, icons are not colored. When using a div
they are colored. When applying to the first level (not nested), it works with both div
and a
.
I fixed it for me now by adding one more .icon
selector to the icon to make it more specific (see workaround below).
There is a jsfiddle showing the issue.
Steps to reproduce
- Create a nested list structure
- use
a
for items and add colored icons to it
Expected result
The icons should be rendered in their defined color.
Actual result
The icons are rendered in grey.
Testcase
https://jsfiddle.net/medc42zu/1/
Screenshot (if possible)
Version
2.8.7 (using the LESS package)
Workaround
I added this to site/elements/icon.overrides
(the same as default, added one more .icon
):
each(@colors, {
@color: replace(@key, '@', '');
@c: @colors[@@color][color];
@l: @colors[@@color][light];
i.@{color}.icon.icon.icon.icon.icon {
color: @c;
}
& when (@variationIconInverted) {
i.inverted.@{color}.icon.icon.icon.icon.icon {
color: @l;
}
i.inverted.bordered.@{color}.icon.icon.icon.icon.icon,
i.inverted.circular.@{color}.icon.icon.icon.icon.icon {
background-color: @c;
color: @white;
}
}
})
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
CSS: alternating list with odd even with non-repeating color in ...
So every li wich is inside of two uls will get a green background and a white font color. If its odd it...
Read more >Understanding Success Criterion 1.4.11: Non-text Contrast | WAI
For user interface components 'adjacent colors' means the colors adjacent to the component. For example, if an input has a white internal background,...
Read more >How to set Bullet colors in HTML Lists using only CSS?
First of all, there is not direct way in CSS by which we can change the color of the bullets in an unordered...
Read more >Styling Lists with CSS - WordPress Codex
1 Nested Lists Layout; 2 Styling Specific List Items ... With fairly simple changes to the style.css file, you can display the list...
Read more >Create color, text, effect and layout grid styles
Use styles to define the color, text and any effects applied to objects; or to define the structure and appearance of layout grids....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We are closing related tickets once we release the next version
Thanks. Well, I just looked at your PR, this jsfiddle idea with overriding seems better 😃