}, colors: { 'primary-orange': '#FAAE2B', 'offer-hov': '#E6EBE9', 'stat-col': 'rgba(1, 71, 55, 0.05)', 'custom-light': 'rgba(1, 71, 55, 0.05)', 'separator': 'rgba(1, 71, 55, 0.1)', 'icon': 'rgba(222, 247, 236, 0.6)', 'advantage-number': 'rgba(4, 108, ...
// tailwind.config.jsmodule.exports={theme:{extend:{colors:{'custom-blue':'#1c64f2','custom-gray':'#3a3a3a',},},},}; 在上面的例子中,custom-blue和custom-gray被添加到了颜色系统中,你可以在HTML中像使用默认颜色一样使用它们: 实例 自定义蓝色背景 尝试一下 » 自定义间距 (Spacing) Tailw...
假设你正在使用一个名为tailwind-plugin-colors的插件,它允许你自定义颜色调色板。你可以在配置文件中这样配置: // tailwind.config.js module.exports = { theme: { extend: { colors: { 'custom-primary': '#ff8000', 'custom-secondary': '#00ff80', 'custom-accent': '#8000ff', }, }, }, plug...
'custom-color': '#66bbfa' } 复制 将以下代码添加到您的tailwind.config.js文件中,现在您可以通过添加自己的颜色代码来自定义颜色。 tailwind.config.js const colors=require('tailwindcss/colors')module.exports={mode:'jit',theme:{extend:{colors:{//Configure your color palette here'custom-green':'#6...
你可以在tailwind.config.js配置文件中自定义背景颜色。通过在theme.extend部分的colors属性下定义颜色,你可以扩展默认的颜色集。 实例 module.exports={ theme:{ extend:{ colors:{ 'custom-blue':'#1D4ED8', 'custom-gray':'#4B5563', } } }
/** @type {import('tailwindcss').Config} */import{generateConfig}from"tailwindcss-custom-colors";constextendedColors=generateConfig(["primary","secondary"]);module.exports={content:["./src/**/*.{index,vue,js,ts,jsx,tsx}"],theme:{extend:{colors:extendedColors,},},plugins:[],}; ...
// tailwind.config.js const colors = require('tailwindcss/colors') module.exports = { theme: { colors: { primary: colors.indigo, secondary: colors.yellow, neutral: colors.gray, } } } You could even define these colors using CSS custom properties (variables) to make it easy to switch t...
theme: { extend: { colors: { customBlue:'#1d4ed8', customGreen:'#10b981', }, }, }, plugins: [ require('@tailwindcss/forms'), ], }; 在上述代码中,我们扩展了Tailwind的主题颜色,定义了customBlue和customGreen两个新颜色。随后我们引入了@tailwindcss/forms插件,使得表单组件变得更加美观且具有...
When extending colors in extend, the original colors will be inherited directly. You only need to add your colors to the corresponding color property object: /** @type {import('tailwindcss').Config} */ export default { theme: { extend: { colors: { green: { custom: '#71b468', // ...
theme: { extend: { colors: {'custom-green': '#32cd32',//自定义颜色}, }, }, } 然后您可以在 HTML 中使用: 这是一个自定义绿色边框的 div 在这个例子中,border-2 是 Tailwind 的内置类,表示边框宽度为 2px,而border-custom-green 是您自定义的边框颜色。 2. Tailwind CSS 常见前缀 Tailwind CS...