当前位置: 首页 > article >正文

taiwindcss

1.安装

npm install -D tailwindcss postcss autoprefixer

npx tailwindcss init

这会创建一个 tailwind.config.js 文件。注意:一定通过px tailwindcss init方式创建

2.tailwind.config.js

module.exports = {
  content: [
    './index.html',
    './src/**/*.{js,ts,jsx,tsx,vue}', // 确保 Vue 文件被扫描
  ],
  theme: {
    extend: {},
  },
  p

3.src/assets/tailwind.css

@tailwind base;
@tailwind components;
@tailwind utilities;

4.main.ts

import './assets/tailwind.css' // 引入 Tailwind CSS 样式文件

5.因为tailwindcss是依赖于postcss

创建postcss.config.js

export default {
    plugins: {
      tailwindcss: {},
      autoprefixer: {},
    },
  }

6.问题,如果这几个步骤发现没有实现,删除包以后重新试一下

    <div class=" bg-red-900 w-[100px] h-[100px] text-[red]">
        大屏
    </div>


http://www.kler.cn/a/453388.html

相关文章:

  • 操作系统之同步与互斥的基本概念
  • ArkTs组件(2)
  • Java爬虫:速卖通(AliExpress)商品评论获取指南
  • el-date-picker 限制选择的日期
  • maven项目打包后如何保留注释
  • 振动分析-47-振动信号处理能力提升需要理解和掌握的算法知识体系
  • Bogus:.NET的假数据生成利器
  • Centos7中使用yum命令时候报错 “Could not resolve host: mirrorlist.centos.org; 未知的错误“
  • 2022 年 12 月青少年软编等考 C 语言四级真题解析
  • Docker基础知识 Docker命令、镜像、容器、数据卷、自定义镜像、使用Docker部署Java应用、部署前端代码、DockerCompose一键部署
  • 单机和微服务的区别,微服务有什么问题?数据一致性问题怎么解决?幂等问题怎么解决?
  • c++ 类似与c# 线程 AutoResetEvent 和 ManualResetEvent的实现
  • FPGA自学之路:到底有多崎岖?
  • 【ES6复习笔记】Class类(15)
  • 【解决报错】AttributeError: ‘NoneType‘ object has no attribute ‘group‘
  • Goland 安装与使用
  • 请购单一直提示需求部门不能为空无法提交
  • 深入浅出 MyBatis | Mybatis 简洁、第一个Mybatis程序
  • Flutter开发HarmonyOS 鸿蒙App的好处、能力以及把Flutter项目打包成鸿蒙应用
  • 使用TimesFM 对车辆销售进行预测