在 Laravel 中不用 Node / npm 使用 Tailwind CSS

Tailwind CSS 是用 JavaScript 编写的,并作为 npm 包分发,这意味着您必须始终安装 Node.jsnpm 才能使用它。

一个新的 独立 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 协议》,转载必须注明作者和本文链接
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!