【问题标题】:how do I gardient background with tailwind我如何用顺风渐变背景
【发布时间】:2021-05-28 09:52:13
【问题描述】:

我从这里安装了带有顺风的 React:https://github.com/altafino/react-webpack-5-tailwind-2

我想在图片中制作一个像上面一样的背景颜色。但我没有得到白色的背景颜色。但为什么呢?

上图来自tailwind.com第一或第二内容

flex items-center space-x-4 p-6 md:px-10 md:py-6 bg-gradient-to-br rounded-b-xl leading-6 font-semibold text-white from-fuchsia-500 to-purple-600

【问题讨论】:

    标签: tailwind-css


    【解决方案1】:

    fuchsia 默认不会添加到颜色中。结帐https://tailwindcss.com/docs/customizing-colors#color-palette-reference

    // tailwind.config.js
    const colors = require('tailwindcss/colors')
    
    module.exports = {
      theme: {
        colors: {
          // Build your palette here
          fuchsia: colors.fuchsia,
      }
    }
    

    然后,您的渐变from-fuchsia-500 将起作用。

    【讨论】:

      猜你喜欢
      • 2021-07-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-13
      • 1970-01-01
      • 2012-03-31
      • 2011-03-15
      • 2012-12-31
      相关资源
      最近更新 更多