-
Notifications
You must be signed in to change notification settings - Fork 249
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
CSS mirroring support PostCSS, postcss-pxtorem, postcss-px-to-viewport #2010
Comments
Thank you for filing. Marking this as tracked on our backlog. |
I am preparing to submit a PR about it @captainbrosset |
This resolves #2016 |
Thank you for opening a PR. I'll ping a reviewer on it. |
Hi @flyyuan Thanks for bringing this to our attention (and also for the PR to address it 👍). Unfortunately I'm not familiar on the internals on postCSS or the pxtorem plugin(s), but if I understand corrently the intention is to transform between different units (px and rem) while using the CSS mirroring function? do you have a minimal repro/example on the workflow you expect to see? |
@vidorteg Yes, the goal is to enable the automatic conversion of rem units back to px when using the CSS mirroring feature. To address this issue, two additional steps have been implemented on top of the existing CSS mirroring process: |
Copying and pasting from the pull request (#2016):
|
Is your feature request related to a problem? Please describe.
The current CSS mirroring functionality does not support the postcss-pxtorem plugin. This limitation becomes problematic when there's a need to maintain sizes in pixels within the file, even though the conversion to rem units is handled by the extension. The absence of support for converting rem or vw units back to pixels before saving the mirrored CSS content restricts the usability of CSS mirroring in projects that utilize PostCSS for responsive design and scaling.
reproduct issues example:
https://github.com/flyyuan/my-app-cra-ts-scss-rem
Describe the solution you'd like:
Enhance the extension to interpret configurations from the postcss.config.js file, specifically leveraging the rootValue setting. This improvement would enable the automatic conversion of rem and vw units back to pixels based on the rootValue defined, prior to saving the new content of the mirrored CSS. Such a feature would streamline the development process by ensuring that the original pixel values can be preserved and manipulated directly within the CSS files, while still benefiting from the responsive and scalable advantages of using rem and vw units through PostCSS plugins.
Describe alternatives you've considered:
N/A
Additional context:
This feature request aims to bridge the gap between the flexibility of using PostCSS for responsive design and the convenience of working with pixel values directly in CSS files. By accommodating the conversion process within the CSS mirroring functionality, developers can achieve a more seamless integration of responsive design techniques without compromising on the ease of use or the clarity of their codebase.
AB#48952824
The text was updated successfully, but these errors were encountered: