Skip navigation
For your stacked elements:
0:00 / 0:21

For your stacked elements:

Brotzky

20K followers

Visit on X
2,099 likesDownloadOriginal post

192,283 views

For your stacked elements: Stop using border or box-shadow. Start using mask.

10 Comments

Comments from the original post on X (Twitter)

  • Brotzky's profile picture

    @brotzky_

    There are always issues when you use box-shadow, border, or outline for this. You forget to change the color so it mismatches the background. You want to add hover interactions so you need to transition both. The CSS is quite simple:

    82 likes

  • Λbstract's profile picture

    @theAbstract_co

    RT @InstaMAT_io: 👀 Are you looking for an alternative to Adobe Substance tools? Do not miss out on InstaMAT from killer node-based material…

  • Brotzky's profile picture

    @brotzky_

    Another wonderful trick: clip-path with SVGs. It's a lot easier to customize in tools like Figma as well.

    39 likes

  • Adam Wathan's profile picture

    @adamwathan

    I had to give up on this approach when I wanted to be able to make an avatar translate up on hover and stuff like that — found any solution to that set of problems?

    33 likes

  • alex's profile picture

    @alexkayaian

    elite

    3 likes

  • Brotzky's profile picture

    @brotzky_

    now u r too

    2 likes

  • Vini's profile picture

    @vinikloppel

    mask is also pretty good to create that fade out effect

    3 likes

  • T. Costa's profile picture

    @tcosta_co

    This is the way

    2 likes

  • Robert Menke's profile picture

    @RobertBMenke

    ✍️✍️✍️

    2 likes

  • matt's profile picture

    @mattsafaii

    Working on a stacked cards design and gonna get rid of the box-shadows and try this!

    1 like