在 Laravel 中不用 Node / npm 使用 Tailwind CSS
Tailwind CSS
是用 JavaScript
编写的,并作为 npm
包分发,这意味着您必须始终安装 Node.js
和 npm
才能使用它。
一个新的 独立 CLI 版本,它在一个独立的可执行文件中为您提供 Tailwind CLI 的全部功能 - 无需 Node.js 或 npm。
安装
composer require tonysm/tailwindcss-laravel
该软件包 Tailwind CSS Laravel 提供了方便的命令,例如通过独立 CLI 安装、搭建、构建和缩小 Tailwind 构建:
# Download the correct CLI based on OS/CPU arch
php artisan tailwindcss:download
# Install the scaffolding (tailwindcss.config.js, app.css, etc.)
php artisan tailwindcss:install
# Build styles
php artisan tailwindcss:build [--digest|--minify]
# Watch for changes during development
php artisan tailwindcss:watch
这个包还带有一个tailwindcss()
辅助函数:
<link rel="stylesheet" href="{{ tailwindcss('css/app.css') }}" >
原文链接:laravel-news.com/tailwind-css-lara...
本作品采用《CC 协议》,转载必须注明作者和本文链接