Recensioni per Stylus
Stylus di Stylus Team, Jeremy Schomery
Recensione di Utente Firefox 14026981
Valutata 5 su 5
di Utente Firefox 14026981, 7 anni faStyles 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.
Replica dello sviluppatore
pubblicato il 7 anni faExcellent investigation! Indeed, Stylus runs at document start and has been doing that since forever.