gpt4 book ai didi

laravel - 如何导入tailwindcss/colors?

转载 作者:行者123 更新时间:2023-12-04 14:39:27 25 4
gpt4 key购买 nike

我试图使扩展托盘在这里工作
https://tailwindcss.com/docs/customizing-colors#color-palette-reference
我已经安装了 tailwind,但只有默认颜色。
enter image description here
当我尝试使用 ; 添加代码时或者没有它不起作用。
enter image description here
我比意识到文件丢失了。
enter image description here
你怎么得到这个文件?我知道我有顺风工作,因为常规配色方案和所有其他功能都有效。我似乎无法让自定义颜色起作用,如果我能阻止它,我真的不想手动添加所有颜色,哈哈
我指的是这些扩展的
enter image description here
非常感谢任何帮助! :)

最佳答案

在您的 node_modules 内文件夹有两个 Tailwindcss 文件夹

  • @tailwindcss
  • tailwindcss

  • 这两个文件夹指的是你的 package.json 里面的包
    {
    // .. other stuff

    "devDependencies": {
    "@tailwindcss/forms": "^0.2.1",
    "@tailwindcss/typography": "^0.3.0",
    // ... other packages
    "tailwindcss": "^2.0.1"
    }
    }
    tailwindcss您可以找到一个 colors.js 的文件夹文件是在您的 tailwind.config.js 中导入的文件
    const colors = require('tailwindcss/colors');

    module.exports = {
    theme: {
    extend: {
    colors: {
    // Colors you want to add go here
    rose: colors.rose,
    cyan: colors.cyan
    }
    }
    }
    }
    在这里,我使用 extend 扩展了已经包含的颜色。 theme内的节点.
    最后,运行 npm run dev并重新加载或删除您的网络浏览器的 cookie 以查看更改。

    关于laravel - 如何导入tailwindcss/colors?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66006053/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com