Recenzje dodatku Stylus
Stylus Autor: Stylus Team, Jeremy Schomery, tophf
Autor recenzji: Użytkownik Firefoksa 14026981
Ocena: 5/5
Autor: Użytkownik Firefoksa 14026981, 8 lat temuStyles 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.
Odpowiedź autora
Data: 8 lat temuExcellent investigation! Indeed, Stylus runs at document start and has been doing that since forever.