Progressive Enhancement¶
Curated Progressive Enhancement resources.
Source
52 resources imported from jbmoelker/progressive-enhancement-resources, dedicated to the public domain (CC0 / Unlicense). Thanks to its maintainers and contributors. Part of the KEEBOX Library · Category: Front-End Development.
The Concept¶
- Progressive Enhancement: It's about the content - Sharing content is the core of the web. Progressive Enhancement ensures access to content.
- The Role of Enhancement in Web Design - From the concept of enhancement to the criteria and rules for enriching the user interface.
- Understanding Progressive Enhancement - Apply technologies in an intelligent way, layer-upon-layer, to craft an amazing experience.
- Designing with Progressive Enhancement - The book (400+ pages) on Progressive Enhancement.
- Adaptive Web Design - Book on Progressive Enhancement from content to design and interaction.
- Detecting (HTML5) features - Intro to different feature detection techniques with examples and demos.
- Progressive Web Apps - Enhancing web sites into native-like apps (progressive, not hybrid).
Strategies¶
- The Content-out Approach - Provide wide access to content without technological restrictions.
- Make the page usable with only HTML - This sets the baseline for every device and browser.
- Test Driven Progressive Enhancement - Core functional experience enhanced after testing capabilities.
- Cut the mustard - Set a threshold for collection of enhancements.
- [Grade components, not browsers](https://www.filamentgroup.com/lab/grade-the-components.html
- Feature vs Browser vs Form factor detection - As different strategies to tune your app to its environment.
- Server-side device detection - Use user-agent and other HTTP header info combined with a device database to conditionally serve files.
- Writing polyfills - If your baseline is still too high for some browsers, consider polyfills (aka Regressive Enhancement).
- Application Shell Architecture - Setup for instant loading web apps.
Feature Detection¶
- CSS feature queries (
CSS.supports()&@supports()) - Natively test if specific CSS feature is supported using JS method or CSS declaration. - Feature Detect ES6 - Detect which ES2015 features are available.
- SVG requiredFeatures - Render SVG elements only if their
[requiredFeatures]evaluate to true. - Modernizr - Extensive feature detection suite (supports custom builds).
- Feature.js - Lightweight feature detection suite.
- Conditioner.js - Conditionally load JS modules based on directives in HTML attributes.
- EnhanceJS - Lets you asynchronously load CSS & JS after a set pre-defined feature tests.
Testing Methods¶
- Open Device Lab - Lets you test manually on actual devices (for free).
- Text browsers - Good way to test if your content is accessible at the baseline. Try Lynx for example.
- Testing in Opera Mini - Download the app, emulate on desktop, setup to test local websites. (Opera Mini accounts for over 5% browser usage world wide)
- cURL - Web page to see the pre-rendered source code of a page.
- Browserling - Lets you manually test web pages in different versions of browsers on Windows and Android platforms.
- Run Internet Explorer using Virtual Machines - To test IE browsers on other platforms.
- Device emulators and simulators
- Configure Desired Capabilities in Selenium - Run automated browser tests in different scenarios.
- Continuously run automated tests in different browsers using BrowserStack, Saucelabs or other alternatives.
- Lighthouse - Audit and meassure performance of Progressive Web Apps (via cli or Chrome extension).
- Progressive Enhancement checklist (1st edition, HTML), Checklist of 2nd edition (PDF) - Actionable list to check you've applied Progressive Enhancement best practices. Part of Adaptive Web Design book.
- CSS Feature Toggles - Chrome DevTools extension to toggle support of selected CSS features for testing progressive enhancement fallbacks.
Examples¶
Custom Form Elements¶
- Fancy radio buttons - Based on HTML radio buttons, visually enhanced using CSS pseudo classes and elements.
- Checkboxes & radio buttons - With custom focus, hover and checked state. Enhanced asynchronously.
- Toggle switch - Checkbox or radios, visually enhanced to sliding toggle switches using CSS only.
- 5-star rating - Based on HTML radio buttons, visually enhanced using CSS pseudo classes and elements.
- jQuery slider - Accessible, custom slider widget based on a standard HTML select.
- jQuery custom file input - Article and library.
- React isomorphic form - Set of React form components which can be pre-rendered & handled server-side. They are enhanced client-side without losing state.
Data Visualisations¶
- Timeline - From definition list to SVG illustration (article with demos).
- Charts - From data table to themed charts using HTML5 canvas (article and library).
Images¶
- Responsive Carousel - List of images enhanced into responsive carousel with various behaviour options.
- Lazy Progressive Enhancement - Lazy load images inside `` tags. (note: Evergreen browsers only)
Menus¶
- Progressive hamburger menu - List of links in footer enhanced to off-canvas menu.
Page Navigation¶
- Barba.js - Add page transitions with event hooks, cache and prefetch support.
- SmoothState.js - Add page transitions with event hooks, cache and prefetch support. (requires jQuery).
- jquery-pjax - Add page transitions with support for multiple containers / content slots (requires jQuery).
- MoOx/pjax - Similar tot jquery-pjax, but without the jQuery dependency.
- Turbolinks - Add page transitions with event hooks and cache support. Has adapters to bind to native navigation controls on iOS and Android.