我尝试将文本设为白色,但为什么不起作用?
html.erb
<h1 class="text-3xl text-center pt-5 bg-green-800 text-white">Epicery</h1> <!-- here it works very well the text-white -->
<div class="flex pt-5 pb-5 bg-green-800">
<div class="mx-auto">
<ul class="flex">
<li class="mr-6 text-white"> <!-- here it does not work text-white -->
<a class="text-white text-sm hover:text-gray-900 hover:bg-white p-4 rounded" href="#">Link</a>
</li>
</ul>
</div>
</div>
我导入了 tailwind cdn
应用程序.html.erb
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
原文由 user15609912 发布,翻译遵循 CC BY-SA 4.0 许可协议
如果您想在 Tailwind 中包含所有默认颜色,则必须在“扩展”括号中包含新颜色,这样它就不会覆盖其他所有颜色。
这是一个例子: