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.

Setting opacity to 0

See original GitHub issue

I set opacity to 0 as follows:

h( "div", { class: "", style: { width: 15, height: 15, opacity: 0 }, oninsert: function(el) { checkEl = el; } }, "✔" )

Picodom is not outputting an opacity css style prop on the element. If I set it to 0.1 or higher it does.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
acstllcommented, Nov 8, 2017

I’m gonna PR this so we can discuss over a possible solution and not about things sucking or not. ✌️

2reactions
acstllcommented, Aug 25, 2017

Here’s some interesting discussion: https://github.com/w3c/webcomponents/issues/519, https://github.com/w3c/webcomponents/issues/519#issuecomment-234302745

I think doing String(value[i]) || "" might not be the best answer, because other values like false or null would be stringified as well and you don’t want opacity = "null". Maybe something like testing against value[i] not being null or undefined?:

element.style[i] = value[i] != null ? value[i] || ""

The most important thing would be to settle on the API first, should attributes accept only strings? how should other types be handled? And make it clear on the documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

opacity - CSS: Cascading Style Sheets - MDN Web Docs
The opacity CSS property sets the opacity of an element. Opacity is the degree to which content behind an element is hidden, and...
Read more >
HTML DOM Style opacity Property - W3Schools
The opacity-level of an element describes the transparency-level, where 1 is not transperant at all, 0.5 is 50% see-through, and 0 is completely...
Read more >
How to Set Opacity of Images, Text & More in CSS
To set the opacity of a background, image, text, or other element, you can use the CSS opacity property. Values for this property...
Read more >
opacity | CSS-Tricks
The opacity property in CSS specifies how transparent an element is. Basic use: div { opacity: 0.5; }. Opacity has a default initial...
Read more >
How to Use the CSS Opacity Property | Webucator
The opacity property modifies the percent opacity of the element it's applied to. A setting of 0 means that the element should be...
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