Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

taro next beta4: Cannot import sass variables WECHAT #6035

Closed
ionush opened this issue Apr 18, 2020 · 6 comments
Closed

taro next beta4: Cannot import sass variables WECHAT #6035

ionush opened this issue Apr 18, 2020 · 6 comments
Assignees
Milestone

Comments

@ionush
Copy link

ionush commented Apr 18, 2020

问题描述

If i use config/index.js, the sass parameters don't work

{...}
  framework: "react",
  sass: {
    resource: [path.resolve(__dirname, "..", "src/constants/constants.scss")],
    data: "$HAIRLINE_MARGIN: 1em 0em;"
  },
  mini: {
{...}

Also, I have to import in the file to use a variable.

App.scss

@import "./constants/constants.scss"; ---> doesn't work

fileWhereIUseVariable.scss

@import "../../../../../../../constants/constants.scss" ---> only this works

constants.scss

$HAIRLINE_COLOR: "red" !default;

期望行为

Want css imports to work correctly

系统信息

Taro CLI 3.0.0-beta.4 environment info:
System:
OS: macOS 10.14.6
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.16.0 - /usr/local/bin/node
Yarn: 1.22.0 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
npmPackages:
@tarojs/components: 3.0.0-beta.3 => 3.0.0-beta.3
@tarojs/taro: 3.0.0-beta.3 => 3.0.0-beta.3
@tarojs/webpack-runner: 3.0.0-beta.3 => 3.0.0-beta.3
eslint-config-taro: 3.0.0-beta.3 => 3.0.0-beta.3
react: ^16.10.0 => 16.13.1
npmGlobalPackages:
typescript: 3.8.3

@taro-bot
Copy link

taro-bot bot commented Apr 18, 2020

CC @Chen-jj

@taro-bot
Copy link

taro-bot bot commented Apr 18, 2020

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@myl0204
Copy link
Contributor

myl0204 commented Apr 21, 2020

resource字段也不起作用,全局注入无效, 编译也不报错,即使文件不存在

@yuche yuche added this to the 3.0.0-beta.5 milestone Apr 21, 2020
@Chen-jj
Copy link
Contributor

Chen-jj commented Apr 21, 2020

@Chen-jj
Copy link
Contributor

Chen-jj commented Apr 21, 2020

@ionush @myl0204 sass. resource & sass.data will be resolved in next beta version: 3.0.0-beta5.

Besides, this usage was unsupported:

Also, I have to import in the file to use a variable.

App.scss

@import "./constants/constants.scss"; ---> doesn't work

@taro-bot
Copy link

taro-bot bot commented Apr 21, 2020

Hello~

您的问题楼上已经提供了解决方案,如果没有更多的问题这个 issue 将在 15 天后被自动关闭。

如果您在这 15 天中更新更多信息自动关闭的流程会自动取消,如有其他问题也可以发起新的 Issue。

Good luck and happy coding~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants