-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
document.documentElement.style.setProperty #1192
Comments
It's not clear what this question is asking. |
I just wanted to achieve javascript functionality in lit element. Like dynamically set width using document.documentElement.style.setProperty is available in javascript. In the same way, I need to implement a lit element. |
Within a lit element you can call Live example of using However, for dynamic styles prefer |
Closing issue as I think I've answered above. Please re-open or open a new issue if you still have questions. |
How to achieve functionality for document.documentElement.style.setProperty
const documentWidth =
window.innerWidth - document.documentElement.clientWidth;
const scrollBarValue = documentWidth >= 0 ? documentWidth : 0;
document.documentElement.style.setProperty(
'--scrollbar-width',
${scrollBarValue}px
);
The text was updated successfully, but these errors were encountered: