Tailwind CSS All In One
Tailwind CSS All In One
Tailwind CSS works by scanning all of your HTML files, JavaScript components, and any other templates for class names, generating the corresponding styles and then writing them to a static CSS file.
It's fast, flexible, and reliable — with zero-runtime.
Tailwind CSS 的工作原理是扫描您的所有 HTML 文件、JavaScript 组件和任何其他模板以查找类名,生成相应的样式,然后将它们写入静态 CSS 文件。
它快速、灵活且可靠——运行时间为零。
https://tailwindcss.com/docs/installation
https://tailwindcss.com/docs/guides/vite
https://tailwindcss.com/docs/guides/nuxtjs
https://tailwindcss.com/docs/guides/create-react-app
Tailwind CLI
$ npm install -D tailwindcss
$ npx tailwindcss init
tailwind.config.js
module.exports = {
// 1. Configure your template paths
content: ["./src/**/*.{html,js}"],
theme: {
extend: {},
},
plugins: [],
}
main.css
// 2. add the Tailwind directives
@tailwind base;
@tailwind components;
@tailwind utilities;
/* css styles */
# 3. CLI build
$ npx tailwindcss -i ./src/input.css -o ./dist/output.css --watch
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- 4. using Tailwind in your HTML -->
<link href="/dist/output.css" rel="stylesheet">
</head>
<body>
<h1 class="text-3xl font-bold underline">
Hello world!
</h1>
</body>
</html>
CDN demo
refs
©xgqfrms 2012-2025
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/16199384.html
未经授权禁止转载,违者必究!
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
2021-04-27 js get mouse scroll event All In One
2021-04-27 rename object key & duplicate object key All In One
2021-04-27 Beacon API & Page Visibility API & pagehide & Front-End Monitor In Action
2021-04-27 git merge other feature branch into current feature branch
2021-04-27 新冠灭活疫苗 All In One
2020-04-27 Vue SSR in Action
2020-04-27 Node.js 如何处理一个很大的文件 All In One