background-color:rgb(404040);color: white;padding:0.5rem;margin:0.5rem; border-radius: 10px; } 改为如下写法: // 组件exportfunctionDisplayer(/* 省略 */) {// 省略return(// 功能类写法{/* 省略 */}); } 再执行npx tailwindcss -o ./src/styles/tailwind.css,生成样式文件,你会在目录下看到...
按钮 <!-- 表单组件 --> 深色模式表单
color:颜色名称 shade:色度,取值范围为 100~900,不可对黑色或白色使用 Color Black Color White Color Red 500 Color Blue 500 Color Gray 500 Color Green 500 背景颜色:bg-[color]-[shade] BgColor White BgColor Red 500 BgColor Black 下划线颜色:underline decoration-[color]-[shade] underline:...
-- 黑色背景 --><!-- ... --> 因此,使用简单的 JS 代码即可实现浅色/深色模式的切换,代码如下: // 页面加载后,设置主题样式if(localStorage.theme==='dark'||(!('theme'inlocalStorage)&&window.matchMedia('(prefers-color-scheme: dark)').matches)){document.documentElement.classList.add('dark')}e...
(1)invisible sm:visible md:text-red-500 lg:text-8xl, (2)flex flex-col text-4xl sm:flex-row, (3)m-4 rounded-md bg-red-500 px-4 py-2 text-white hover:bg-red-600 active:bg-red-400 sm:bg-indigo-500 sm:hover:bg-indigo-600 sm:active:bg-indigo-400 ...
.text-currentcolor: currentColor;Aa .text-blackcolor: #000;Aa .text-whitecolor: #fff;Aa .text-gray-100color: #f7fafc;Aa .text-gray-200color: #edf2f7;Aa .text-gray-300color: #e2e8f0;Aa .text-gray-400color: #cbd5e0;Aa .text-gray-500color: #a0aec0;Aa ...
因此,对于一个行内框来说,top是指框的上边界,bottom是指框的下边界,text-top是指内容区的上边界,text-bottom是指内容区的下边界。 行内元素 vertical-align Tailwind使用.align-{position}的形式定义vertical-align属性常用的工具类 空白(whitespace) CSS的white-space属性用于设置元素内容中空白的处理方式,这里的...
className='py-4 px-6 rounded-md text-white font-medium rounded-lg bg-purple-600 hover:bg-purple-700 outline-none' type='submit' > Sign up ); 之后,你应该会在你的网站上看到类似的内容: 原创设计演示 如何美化网站:自定义样式 虽然
<template>Current template:Base color:#96454c 500 ? 'text-white': ''}`"key="variant">{{variant}}</template>constpalettes=[50,100,200,300,400,500] 由于我们动态计算模板中的类,因此我们需要将primary颜色的类模式添加到safelistTailwindCSS 配置中。否则,TailwindCSS 将不会生成相关类,因为它认为它们...
#"class="text-gray-900 dark:text-white hover:bg-gray-200 dark:hover:bg-gray-700 px-3 py-2 rounded-md text-sm font-medium">首页<arel="nofollow"href="#"class="text-gray-600 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 px-3 py-2 rounded-md text-sm font-medium"...