The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Apply Opacity after element rendering

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #273436

    Hi, I’d like to know if it’s possible to apply an opacity (transparency) effect on an element after it has been “calculated” by the browser.
    Here’s why:

    That’s an effect that relies on the characteristic of the buttons of being opaque. When it was time to apply the concept on my page, I discovered it wasn’t usable anymore, because I had to put those buttons in a semi-transparent interface.
    And even if the opacity effect was set on the main container, in reality it was simply inherited by all the children.

    I already had to rewrote a similar effect for transparent uis

    But in the case with the buttons it’s not possible to follow the same path. Is there a way to apply the opacity effect after everything has been drawn? That would be awesome, I would be able to work easily with opaque colors, and apply the opacity effect after, on the “bitmap”.
    That would really eliminate a lot of work (for me, the gpu, and the pcu).

    Is this possible?
    If not, how would you proceed?

    Thank you!


    And using a delay on the opacity, like is possible with CSS-animations? Would that be an option?


    Maybe some svg filter?


    Delaying? From where?
    The transparency level has to be the same. I can’t have some opaque things in the middle


    The best way I come up with, was using a css mask with a solid gradient “image”, pretty ugly tho, as I had to use the -webkit vendor prefix to get it to work on chrome. (even if it has already been included as standard some years ago, as I understood here:

    Here’s the code:

    -webkit-mask-image: linear-gradient(rgba(0, 0, 0, .7), rgba(0, 0, 0, .7));
    mask-image: linear-gradient(rgba(0, 0, 0, .7), rgba(0, 0, 0, .7));

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.