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

px 2 vw #7637

Closed
soulcm opened this issue Sep 17, 2020 · 3 comments · Fixed by #13650
Closed

px 2 vw #7637

soulcm opened this issue Sep 17, 2020 · 3 comments · Fixed by #13650
Labels
enhancement New feature or request

Comments

@soulcm
Copy link

soulcm commented Sep 17, 2020

这个特性解决了什么问题?

现在taro默认将px转成了rem,小程序转为rpx,但我们h5页面使用的是vw单位,希望能指定转的单位

这个 API 长什么样?

指定转化的单位为vw

@shenghanqin
Copy link
Collaborator

这个特性解决了什么问题?

现在taro默认将px转成了rem,小程序转为rpx,但我们h5页面使用的是vw单位,希望能指定转的单位

这个 API 长什么样?

指定转化的单位为vw

rem是很好控制最大字体大小的,但vw很难控制。

@soulcm
Copy link
Author

soulcm commented Sep 22, 2020

这个特性解决了什么问题?

现在taro默认将px转成了rem,小程序转为rpx,但我们h5页面使用的是vw单位,希望能指定转的单位

这个 API 长什么样?

指定转化的单位为vw

rem是很好控制最大字体大小的,但vw很难控制。

嗯,但我们H5项目用的vw,有配置方式可以转换成vw吗,或让我们自己定义

@rottenpen
Copy link
Contributor

// ./config/index.js
designWidth: 750,
  deviceRatio: {
    '640': 2.34 / 2 * 375 / 100,
    '750': 1 * 375 / 100,
    '828': 1.81 / 2 * 375 / 100,
  },

猜的

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

Successfully merging a pull request may close this issue.

3 participants