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.

How to do background overlay without opacity?

See original GitHub issue

Hey,

I’m using this lib for Android, and I know a lot of sidebar menus have a black semi-transparent overlay behind the menu but above the initial content.

I’ve tried doing this with the tweenHandler thats in the docs (via opacity), but the problem is all my position: absolute elements all switch to semi-transparent, and creates tons of discordance and confusion because every single element becomes semi see-through rather than a black semi-transparent black overlay on top.

Do you have any idea how I could solve this?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
dgladkovcommented, Mar 24, 2016

This is possible with version 2.0.0-wip1. Example:

<Drawer
...
  styles={{
    mainOverlay: {
      backgroundColor: 'black',
      opacity: 0,
    },
  }}
  tweenHandler={(ratio) => ({
    mainOverlayProps: {
      opacity: ratio / 2,
    },
>

Example above has a black overlay that will become half transparent when drawer is fully open.

0reactions
lastantcommented, Dec 24, 2016

Should be mainOverlay instead of mainOverlayProps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change background-image opacity in CSS without ...
This is accomplished by setting the background-color property using the rgba() syntax, where the first three characters are the RGB color ...
Read more >
Semi-transparent color layer over background-image?
So to make it a little more nice, I would like to put a light transparent color "layer" over. Below is what I...
Read more >
How to make semitransparent layers backgrounds without ...
Adding an overlay #​​ We're going to add a linear-gradient to our background-image . We'll use the rgba() color declaration, with 0, 0,...
Read more >
How to overlay your background images - DEV Community ‍ ‍
The first background image is a linear gradient that goes from and to the same color. That color is a semi-transparent black, which...
Read more >
Use CSS ::before and ::after for simple, spicy image overlays
We make the overlay slightly transparent utilizing the opacity property. ... Our friendly overlay is covering not just the background image, ...
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