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

Refactor CSS unit transforming #231

Merged
merged 2 commits into from
Nov 29, 2023
Merged

Refactor CSS unit transforming #231

merged 2 commits into from
Nov 29, 2023

Conversation

malash
Copy link
Collaborator

@malash malash commented Nov 29, 2023

This PR introduced a new option css.unit in goji.config.js to enable CSS unit transforming.

css.unit

  • Type: undefined | 'keep' | 'to-px' | 'to-rpx'

  • Default: 'to-rpx'

There is a built-in PostCSS plugin called postcss-transform-unit that can be used to transform CSS
units in all files. In some cases, you may want to convert the usage of px to rpx or vice versa.
You can use this option.

  • keep: Do not transform any CSS unit.

  • to-px: Transform rpx to px. 2rpx equals to 1px.

  • to-rpx: Transform px to rpx. 1px equals to 2rpx.

The default will be changed to keep in the future.

@malash malash merged commit 70710b5 into main Nov 29, 2023
18 checks passed
@malash malash deleted the transform-unit branch November 29, 2023 12:37
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

Successfully merging this pull request may close these issues.

1 participant