如何在不使用控件注释的情况下在 create-react-app 中启用 Autoprefixer CSS Grid 翻译? [英] How do you enable Autoprefixer CSS Grid translations in create-react-app without using control comments?

查看:103
本文介绍了如何在不使用控件注释的情况下在 create-react-app 中启用 Autoprefixer CSS Grid 翻译?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Create React App 应用程序中启用 Autoprefixer Grid 翻译.

我不想弹出.

我也在使用 CSS-in-JS 解决方案,这使得无法向 CSS 添加注释.所以 /* autoprefixer grid: autoplace */ 控制注释方法是不可能的.

是否还可以在不弹出的情况下启用网格翻译?

解决方案

在询问时,这是不可能的.不过现在是.

如果在编译代码时应用 AUTOPREFIXER_GRID = autoplace 环境变量,则无需使用控制注释即可启用网格转换.

您可以在Autoprefixer 文档中了解如何执行此操作.>

I am trying to enable Autoprefixer Grid translations in a Create React App application.

I do not want to eject.

I'm also using a CSS-in-JS solution that makes it impossible to add comments to the CSS. So the /* autoprefixer grid: autoplace */ control comment method is not possible.

Is it still possible to enable grid translations without ejecting?

解决方案

At the time of asking, it was not possible. It is now though.

If you apply an AUTOPREFIXER_GRID = autoplace environment variable when you are compiling your code, you can enable grid translations without using control comments.

You can read about how to do this in the Autoprefixer documentation.

这篇关于如何在不使用控件注释的情况下在 create-react-app 中启用 Autoprefixer CSS Grid 翻译?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆