Polyfills and Shims
A shim (sometimes called a shiv) is a piece of code that intercepts an API call and provides a layer of abstraction, and a polyfill is a specific type of shim that adds support for new or experimental features in browsers that don’t support them natively. CSS multi-columns aren’t supported in many older browsers, for example, so a multi-column polyfill would use JavaScript to replicate their functionality in those browsers.
The idea behind a polyfill is that it happens invisibly; other than including a link to the polyfill file, no (or very little) more should be required from the author. In the case of multi-columns, the CSS to create the columns should be all you need. Of course, multi-columns create a dependency on JavaScript ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access