CarveMe tries to simulate an inset text-shadow effect with CSS3.
text-shadow: rgba(255,255,255,0.5) 0 5px 6px;
- First we set the text color to transparent.
- Then we add a dark background-color.
- Then by adding background-clip: text it only shows the background within the outline of the text. It’s like a mask. Note, this is not a standard feature and only implemented in Chrome/Safari.
- And finally, if we add a bright, half transparent text-shadow on top and push it down a bit so that the dark background can be seen, it makes it look like the text is carved into the surface.
Note that it doesn’t work well on all backgrounds and you might have to adjust the colors. Also, it’s not easy to add a fallback, so make sure you use Modernizr.
See the demo.