Recenze doplňku Stylus
Stylus od Stylus Team, Jeremy Schomery
Recenze od uživatele Uživatel Firefoxu - 14026981
Hodnocení: 5 z 5
od uživatele Uživatel Firefoxu - 14026981, před 8 letyStyles 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.
Odpověď vývojáře
zveřejněno před 8 letyExcellent investigation! Indeed, Stylus runs at document start and has been doing that since forever.