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.

Modification of element in shadow-root only works while switching to another tab

See original GitHub issue

My Home Assistant version: 0.98.1

My lovelace configuration method (GUI or yaml): YAML

What I am doing: I modified my map card to resize the marker as described in #8 (Plugin & HASS up2date - all caches cleared)

What I expected to happen: At least to resize after some seconds - or better on page load

What happened instead: With lovelace-card-mod version 4 & 5 the style is only applied while switching to another view. As soon as I press the icon of another view, the marker resizes.

Minimal steps to reproduce: Map card with following style added:

# The least ammount of code possible to reproduce my error

      ha-entity-marker:
        $: |
          .marker {
            width: 24px!important;
            height: 24px!important;
            border: 0px!important;
            margin-top: 12px!important;
            margin-left: 12px!important;
          }

# End of code

Error messages from the browser console: No errors or warnings (even in debug_cardMod: true mode)


By putting an X in the boxes ([ ]) below, I indicate that I:

[X] Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).

[X] Have made sure I am using the latest version of the plugin.

[X] Have followed the troubleshooting steps of the “Common Problems” section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.

[X] Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Vedenebcommented, Jun 20, 2020

Any news on that? I have the same problem using the shopping-list-card. My goal is to have a more compact version by reducing the padding between each entry. But also here the list items seem to be added after card-mod kicked in, that’s why I also have to switch tabs in order to make it work…

1reaction
noxhirschcommented, Feb 28, 2021

Yeah! Now it works perfectly fine - thank you very much! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Override styles in a shadow-root element - Stack Overflow
//host is the element that holds the shadow root: var style = document. ... NB: it will work only if the Shadow DOM...
Read more >
[idea] Allow custom element naming on a per-shadow-root ...
I say on a "per-shadow-root basis", but it can be more generally just some ... while allow only selectors that don't use tag...
Read more >
Managing focus in the shadow DOM | Read the Tea Leaves
So the first challenge is to emulate whatever the browser normally does when you press Tab or Shift + Tab . In this...
Read more >
Using shadow DOM - Web Components | MDN
Shadow DOM allows hidden DOM trees to be attached to elements in the regular DOM tree — this shadow DOM tree starts with...
Read more >
Encapsulating Style and Structure with Shadow DOM
A shadow root's author can style content inside the light DOM to a limited extent using the CSS ::slotted() pseudo-selector; however, the DOM ......
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