【问题标题】:Colors not working on TailwindCSS on Rails颜色在 Rails 上的 TailwindCSS 上不起作用
【发布时间】:2021-05-18 22:24:01
【问题描述】:

我使用 Rails 6.2.1 创建了一个全新的项目,并添加了tailwindcss-rails。其中一些有效,但例如颜色似乎不起作用。当我将来自https://play.tailwindcss.com/ 的 sn-p 嵌入到我的项目中时,它看起来像这样:

我所有的源代码都在这里https://github.com/pupeno/imok

有什么想法吗?

谢谢。

【问题讨论】:

    标签: ruby-on-rails tailwind-css


    【解决方案1】:

    您必须将颜色cyanlight-blue(在默认的playground 代码中使用)添加到tailwind.config.js,因为它们是don't come with the default theme

    const colors = require('tailwindcss/colors')
    
    module.exports = {
      theme: {
        extend: {
          colors: {
            'light-blue': colors.lightBlue,
            cyan: colors.cyan,
          },
        },
      },
      variants: {},
      plugins: [],
    }
    

    【讨论】:

    猜你喜欢
    • 2021-11-19
    • 1970-01-01
    • 2018-05-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-03
    相关资源
    最近更新 更多