home ~ socials ~ projects ~ rss

Set A Custom CSS Property Variable On A Web Component In JavaScript

February 2025
// TODO: Test with full example



this.style.setProperty('--prop-name', 'value');
end of line
Share link:
https://www.alanwsmith.com/en/2s/ge/be/qs/?set-a-custom-css-property-variable-on-a-web-component-in-javascript