@BenedekGagyi
✋
Péter Viola: A CSS Mágia Leleplezése
Image source: Smashing Magazine
Houdini Samples
Lea Verou
:root { --box-size: 50px; } .box { width: var(--box-size); height: var(--box-size); }
element.style.setProperty("--box-size", 100);
("--box-size", 100)
("--box-size", 100 + 'px')
CSS.registerProperty({ name: '--box-size', syntax: '<length>', initialValue: '50px', inherits: true, });
Iherits: should it be required?
element.attributeStyleMap.get('width')
{ value: 50, unit: "percent" }
(CSS.paintWorklet || paintWorklet).addModule('paintworklet.js');
registerPaint('fancy', class { paint(ctx, geom, props) { ... } });
background-image: paint(radio-button);
background-image: paint-radio-button();
By Benedek Gagyi
Web dev.