- A shim is any piece of code that performs interception of an API call and provides a layer of abstraction. It isn’t necessarily restricted to a web application or HTML5/CSS3.
- A polyfill is a type of shim that retrofits legacy browsers with modern HTML5/CSS3 features usually using Javascript or Flash.
A shim is a library that brings a new API to an older environment, using only the means of that environment. Thus, a polyfill is a shim for a browser API.