stylus how to use global variables

css styles, such as background color, font color, and so do a global variable, each time using a reference, it is easy to maintain
created in styl suffix stylus style,
named variables that begin with $
introduced in style, you can not use direct import, must be preceded by @ comply with before they can quote
for example @import '../../../assets/styles/varibles.styl', so that references a bit tedious, it can also be used directly @ find under src directory, but here to add ~ can, @ import '~@assets/styles/varibles.styl'


1656374-0d21df8980a95ece.png
1.png

1656374-6b62ea3476d5eb06.png
2.png

Reproduced in: https: //www.jianshu.com/p/91abe7ede93c

Guess you like

Origin blog.csdn.net/weixin_34228662/article/details/91343361