vuejs / vuepress

📝 Minimalistic Vue-powered static site generator
https://vuepress.vuejs.org
MIT License
22.51k stars 4.76k forks source link

expected rgba or hsla, but got ident:$textColor #1622

Closed LouisaNikita closed 5 years ago

LouisaNikita commented 5 years ago

Bug report

First it had an issue with using the lighten function from stylus

 129| 
   130| // lighten by the given amount
   131| 
   132| lighten(color, amount)
   133|   adjust(color, 'lightness', amount)
-------------------------------------------^
   134| 
   135| // decrease opacity by amount
   136| 

TypeError: expected rgba or hsla, but got ident:$textColor

i use 1.0.0-alpha.48, and my package management is npm

"devDependencies": {
"@babel/cli": "^7.4.4",
"@babel/core": "^7.4.5",
"@babel/plugin-proposal-object-rest-spread": "^7.4.4",
"@babel/preset-env": "^7.4.5",
"@babel/preset-es2015": "^7.0.0-beta.53",
"babel-loader": "^8.0.6",
"clean-webpack-plugin": "^1.0.0",
"css-loader": "^1.0.1",
"extract-text-webpack-plugin": "^3.0.2",
"html-webpack-plugin": "^3.2.0",
"markdown-it-vuese": "^0.4.0",
"path": "^0.12.7",
"vue-loader": "^14.2.3",
"vue-server-renderer": "^2.6.10",
"vue-template-compiler": "^2.6.10",
"vuepress": "^1.0.0-alpha.48",
"vuepress-plugin-demo-block": "^0.7.2",
"webpack": "^4.26.0",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.10"
}

Steps to reproduce

i put variables in NavLinks.vue, its fine. so i think its the problem of importing config.styl from @vuepress/core

now i manually import variable file in problem Page, like NavLinks.vue @require '../../core/lib/client/style/config.styl'

What is expected?

What is actually happening?

Other relevant information

danderozier commented 5 years ago

Try this:

@import '~@theme/styles/config.styl'

This will import the theme's config.styl if you're using the default theme. @theme is a (undocumented?) Webpack alias made available by Vuepress.