exports = { plugins: [ function ({ addUtilities }) { const newUtilities = { '.bg-custom': { backgroundColor: 'rgb(255, 128, 0)', }, }; addUtilities(newUtilities); }, ], }; 在这个例子中,我们创建了一个自定义的背景颜色类.bg-custom,并使用了addUtilities函数来添加它。这使得在你...
plugins: [ plugin(function ({ addBase, addComponents, addUtilities, theme }) { addBase({ 'p': { lineHeight: theme('lineHeight.relaxed'), }, 'a': { color: theme('colors.blue.600'), textDecoration: 'none', }, }) addComponents({ '.alert': { backgroundColor: theme('colors.red....
复制 constcolors=require('tailwindcss/colors');constplugin=require('tailwindcss/plugin');module.exports={mode:'jit',purge:['./src/**/*.{js,jsx,ts,tsx}','./public/index.html','./src/css/safelist.txt'],theme:{extend:{animation:['animate-pulse','animate-spin','visually-hidden'],box...
添加后,插件会自动去修改添加theme.extend.colors和@tailwind base;,把主题颜色和css变量,自动注入进来。 这时候你就可以写: hello 默认的生成类名为tailwindcss变量前缀(text,bg,border...) + 自定义变量名 插件会自动生成css: :root{--color-canvas-default-transparent:325485;--color-marketing-icon-primary:5...
letplugin =require('tailwindcss/plugin')module.exports= {// ...plugins: [plugin(function({ addVariant }) {// Add a `third` variant, ie. `third:pb-0`addVariant('third','&:nth-child(3)') }) ] } All of Tailwind’s modifiers are available to use with your own custom classes as...
首先,您需要在自定义的colors文件中定义theme对象数组,因为您的顺风配置将超过默认配置。因此,请检查您...
Semantic Setup provides you a semantic default setup butyou can add your custom colors. Here you can see the default colors and the ones that are auto-generated for you: (Required - added by default) ▪️primary: The main color of your brand ...
function ({ addUtilities }) { addUtilities({ '.custom-class': { color: 'red', backgroundColor: 'blue' } }) } ] } 在HTML中直接使用: 这是一个带有自定义类的段落。 如何配置TailwindCss 配置Tailwind CSS主要通过编辑tailwind.config.js文件来实现。以下是一些常见的配置选项: 基础配置 module.expor...
These extensions are merged deeply, so if you’d like to add an additional shade to one of Tailwind’s default colors, you can do so like this: // tailwind.config.js module.exports = { theme: { extend: { colors: { blue: { 450: '#5F99F7' }, } } } } This will add classes...
Add docker folder to .gitattributes 2年前 .gitignore Added Docker configuration for local setup 2年前 CHANGELOG.md release: v2.1.0 6个月前 CONTRIBUTING.md Refactor Makefile to use composer scripts 2年前 LICENSE.md feat: first 3年前