question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Colored icons in nested list structures are not shown in their color

See original GitHub issue

Bug 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

  1. Create a nested list structure
  2. 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)

Selection_084

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:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
lubber-decommented, Nov 4, 2020

We are closing related tickets once we release the next version

1reaction
eikekcommented, Nov 3, 2020

Thanks. Well, I just looked at your PR, this jsfiddle idea with overriding seems better 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found