In most browsers this is just going to show the letter 'A' but in the latest version of Chrome it should animate between 'A' and 'B'.
Not sure how useful this might be in the future, but it seems pretty cool!
A Pen by Robin Rendle on CodePen.
/** | |
* # OnlyWhen brings Media Queries to HTML. | |
* | |
* It solves two use-cases via a simple API. | |
* | |
* ## Use case #1: remove nodes from the DOM. | |
* | |
* What's the problem this solves? With CSS Media Queries, DOM nodes are typically | |
* _hidden_ but still participate in DOM operations, like queries and IDREF resolutions. | |
* To include the nodes only when a particular media query matches, use the attributes |
(function () { | |
const capturedEvents = []; | |
let capturing = false; | |
let captureTarget = null; | |
let deferredDispatch; | |
const faultyElementSelector = [ | |
"a[href]", | |
"area[href]", | |
"audio[controls]", |
(function() { | |
var capturedEvents = []; | |
var capturing = false; | |
function getEventTarget(event) { | |
return event.composedPath()[0] || event.target; | |
} | |
function captureEvent(e) { | |
if (capturing) { |
In most browsers this is just going to show the letter 'A' but in the latest version of Chrome it should animate between 'A' and 'B'.
Not sure how useful this might be in the future, but it seems pretty cool!
A Pen by Robin Rendle on CodePen.