{"id":332479,"date":"2021-01-12T07:44:44","date_gmt":"2021-01-12T15:44:44","guid":{"rendered":"https:\/\/css-tricks.com\/?p=332479"},"modified":"2021-01-12T12:47:31","modified_gmt":"2021-01-12T20:47:31","slug":"building-flexible-components-with-transparency","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/building-flexible-components-with-transparency\/","title":{"rendered":"Building Flexible Components With Transparency"},"content":{"rendered":"\n

Good thinking<\/a> from Paul Hebert on the Cloudfour blog about colorizing a component. You might look at a design comp and see a card component with a header background of #dddddd<\/code>, content background of #ffffff<\/code>, on an overall background of #eeeeee<\/code>. OK, easy enough. But what if the overall background becomes #dddddd<\/code>? Now your header looks lost<\/strong> within it. <\/p>\n\n\n\n

That darker header? Design-wise, it’s not being exactly #dddddd<\/code> that’s important; it’s about looking slightly darker<\/em> than the background. When that’s the case, a background of, say rgba(0, 0, 0, 0.135)<\/code> is more resiliant. <\/p>\n\n\n\n\n\n\n\n

That will then remain resilient against backgrounds of any kind.<\/p>\n\n\n\n