Reviews for Stylus
Stylus by Stylus Team, Jeremy Schomery
Review by Firefox user 14026981
Rated 5 out of 5
by Firefox user 14026981, 7 years agoStyles are applied when page load is finished, however loading time of page may be long.
If Stylus can run at document start, I don't need to wait page load finished.
Can Stylus run at document start?
updated:
Oh, I find the problem. It is my fault.
I used 'max-width: calc(100vw - var(--scrollbar_vertical_width));' in Stylus.
And the value of '--scrollbar_vertical_width' is set using javascript (Tampermonkey).
i.e. window.addEventListener("load", function() {/* calculate scroll bar size */})
The value is set on loaded, so before loaded the value is invalid and the style will go wrong.
Now I change 'load' to 'DOMContentLoaded', it is fine.
If Stylus can run at document start, I don't need to wait page load finished.
Can Stylus run at document start?
updated:
Oh, I find the problem. It is my fault.
I used 'max-width: calc(100vw - var(--scrollbar_vertical_width));' in Stylus.
And the value of '--scrollbar_vertical_width' is set using javascript (Tampermonkey).
i.e. window.addEventListener("load", function() {/* calculate scroll bar size */})
The value is set on loaded, so before loaded the value is invalid and the style will go wrong.
Now I change 'load' to 'DOMContentLoaded', it is fine.
Developer response
posted 7 years agoExcellent investigation! Indeed, Stylus runs at document start and has been doing that since forever.