如何在纯 PHP 项目中使用 Tailwind CSS
(图片来源)
要开始在纯 php 项目中使用 tailwind css,您可以在项目中安装 tailwind css。方法如下:
module.exports = { plugins: [ require('tailwindcss'), require('autoprefixer'), ],};
@tailwind base;@tailwind components;@tailwind utilities;
"scripts": { "build:css": "npx postcss src/styles.css -o public/styles.css" },
<link href="./public/styles.css" rel="stylesheet">
/** @type {import('tailwindcss').Config} */module.exports = { darkMode: 'class', // or 'media' content: [ "./**/*.php", "./**/*.html" ], theme: { extend: {... } }, plugins: [],}
祝大家编码快乐!