Stylus 的评价
Stylus 作者: Stylus Team, Jeremy Schomery
Firefox 用户 14026981 的评价
评分 5 / 5
来自 Firefox 用户 14026981,7 年前Styles 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.
开发者回应
发布于 7 年前Excellent investigation! Indeed, Stylus runs at document start and has been doing that since forever.