None
EN
Polyfilling CSS with CSS Parser Extensions
['View More Posts', 'Published Bramus', 'Bramus Is A Frontend Web Developer Belgium', 'Working As A Chrome Developer Relations Engineer At Google. The Moment He Discovered View-Source At The Age Of']
Bram.us
When authors create a polyfill for a CSS feature, they can’t rely on the CSS parser giving them the information about, for example, the declarations they want to polyfill. ', }) // No .computeTo … so the syntax will compute individually ; const cssPositionFixed = positionWithArgRegistration .with('position', 'fixed') // Only `position: fixed` .with('arg') // Any arg value .onMatch((match) => { const { element, specifiedValue } = match; const { position, arg } = specifiedValue; const styles = CSS.parser.getSpecifiedStyle(element); const visualViewport = determineVisualViewport(); switch (arg) { case 'layout': return { position: 'fixed', }; case 'visual': return { position: 'fixed', bottom: (() => { if (styles.bottom.toString() != 'auto') { return…