简体   繁体   English

将 tailwincss 转换为正常 CSS?

[英]convert tailwincss to normal CSS?

I have been given an html file that is written using tailwindcss and I am trying to figure out how to convert all there stuff to normal CSS. I have found a convert that will just do the class but that requires me to extract thousands of classes from the code manually and then repast it.我得到了一个使用 tailwindcss 编写的 html 文件,我正在尝试弄清楚如何将所有内容转换为正常的 CSS。我找到了一个可以执行 class 的转换,但这需要我从中提取数千个类手动输入代码,然后重新粘贴。 Is there some tool where I can just upload the whole html file and it spit out a CSS version of it for me or do I have to manually do this whole conversion?有没有什么工具可以让我上传整个 html 文件,它会为我生成一个 CSS 版本,还是我必须手动完成整个转换? I would prefer something online as I don't want to go though having to install a bunch of 3rd party tools, learning there system, do the convert, and then uninstall everything.我更喜欢在线的东西,因为我不想 go 虽然必须安装一堆第三方工具,在那里学习系统,进行转换,然后卸载所有东西。

Paste your html code in tailwind-playground将您的html code粘贴到 tailwind tailwind-playground

You can access the css in the generated css files tab.您可以在generated css files选项卡中访问 css。

Example例子

在此处输入图像描述

According to tailwind-css docs根据tailwind-css 文档

Tailwind automatically injects these styles when you include @tailwind base in your CSS ( the first 552 lines of generated css )当您在 CSS 中包含 @tailwind base 时,Tailwind 会自动注入这些 styles(生成的 css 的前 552 行

You can remove those base classes by setting preflight = false in tailwind.config.cs您可以通过在tailwind.config.cs中设置preflight = false来删除这些基类

module.exports = {
  corePlugins: {
    preflight: false,
  }
}

You may use this tool: https://tailwind-to-css.vercel.app/ for converting the tailwind CSS class to normal CSS.您可以使用此工具: https://tailwind-to-css.vercel.app/将 tailwind CSS class 转换为 normal CSS。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM