Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
387 views
in Technique[技术] by (71.8m points)

stylus全局变量怎么使用

stylus全局变量怎么使用


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

同文件中:

$bgc=#fff
.test
    background-color $bgc

不同文件,假定全局变量定义在common.styl中:

$bgc=#fff

如在index.styl中使用:

  @import 'common.styl'
  .test
    background-color $bgc

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
...