簡體   English   中英

我可以用另一種方式生成順風 css 嗎?

[英]Can I generate tailwind css in another way?

我想使用tailwind.config.js文件將所有與網格相關的css生成到一個帶有一些修改(如前綴和媒體查詢)的文件中,不必在html,js,框架文件中指定它們?

那可能嗎?

如我所見,現在可以選擇使用正則表達式清除/安全列表嗎?

喜歡

module.exports = {
  purge: {
    enabled: true,
    options: {
      safelist: ['/place-/g', '/justify-/g']
    }
  }
}

感謝您對此的任何幫助。

請注意,我不喜歡設置帶有類的“假 html 頁面”,因為我的用例可能會隨着時間的推移而增長。

如果我正確理解您的問題,認為您只是缺少安全列表 object 的content標准和standard密鑰?

  purge: {
        content: ["./src/**/*.{html,js,svelte,ts}",],
        enabled: true,
        options: {
            safelist: {
                standard: [/^grid-col/, /^grid-row/]
            }
        }
    },

這可能對您有用: https://purgecss.com/safelisting.html#in-the-css-directly

--

如果您只需要順風網格,也許這樣的替代方案可能會有所幫助: https://github.com/VeronQ/tailwind-grid

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM