Use_tailwindcss
安装
hugo new theme acdiost-theme
创建主题后进入 cd themes/acdiost-theme
目录
Install Tailwind CSS Install tailwindcss via npm, and create your tailwind.config.js file.
npm install -D tailwindcss
npx tailwindcss init
Add the paths to all of your template files in your tailwind.config.js file.
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./layouts/**/*.{html,js}"],
theme: {
extend: {},
},
plugins: [],
}
Add the @tailwind directives for each of Tailwind’s layers to your main CSS file.
我将它添加在 static/css/main.css
中
@tailwind base;
@tailwind components;
@tailwind utilities;
Run the CLI tool to scan your template files for classes and build your CSS.
npx tailwindcss -i ./static/css/main.css -o ./static/css/tailwind.acdiost.css --watch
Start using Tailwind in your HTML.