Skip to main content
100%

CSS Mask test

✓ Published0🌍 Public
TThanaporn-sk
Last edited Mar 9, 2017
Created on Mar 9, 2017

This example demonstrates CSS masking by using a sprite sheet of glyph icons as a mask image, with separate icon classes that shift the mask position to reveal different shapes. The code defines `.maskicon` and `.maskicon-alpha` classes that apply the `-webkit-mask-image` property with a Bootstrap halflings sprite, coloring the masked areas green or semi-transparent black, while a parallel `.icon` class shows the traditional background-position sprite technique. The example directly compares the two approaches, highlighting how CSS masks can recolor icons without altering the source image. It relies solely on CSS styling and the Bootstrap sprite asset, with no JavaScript libraries involved.

AI-generated description

Playing with CSS masking sprites.

forked from <a href='http://bl.ocks.org/nmu/'>nmu</a>'s block: <a href='http://bl.ocks.org/nmu/7997037'>CSS Sprite Mask</a>

mit Licensed

Similar vizzes