variant-feature.js (450B)
1 'use strict'; 2 3 /** 4 * Add `style` and `feature` search params to the `style` attribute. 5 */ 6 if (window.location.search) { 7 const params = new URLSearchParams(window.location.search); 8 const styles = params.getAll('style'); 9 const features = params.getAll('feature'); 10 for (const feature of features) { 11 styles.push(`font-feature-settings: '${feature}'`); 12 } 13 if (styles.length) { 14 document.documentElement.style = styles.join(';'); 15 } 16 }