Skip to content

Commit db7ea8b

Browse files
committed
Fallback to Tailwind V3, I had to bump a major version
1 parent 43fb10b commit db7ea8b

File tree

5 files changed

+28
-12
lines changed

5 files changed

+28
-12
lines changed

config/tailwindcss.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@
3939
| @see https://github.com/tailwindlabs/tailwindcss/releases to know the version availables.
4040
|
4141
*/
42-
'version' => env('TAILWINDCSS_CLI_VERSION', 'v4.0.0'),
42+
'version' => env('TAILWINDCSS_CLI_VERSION', 'v3.4.17'),
4343
];

src/Commands/InstallCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ protected function phpBinary()
4545
private function ensureTailwindConfigExists()
4646
{
4747
$this->copyStubToApp(
48-
stub: __DIR__ . '/../../stubs/postcss.config.js',
49-
to: base_path('postcss.config.js'),
48+
stub: __DIR__ . '/../../stubs/tailwind.config.js',
49+
to: base_path('tailwind.config.js'),
5050
);
5151

5252
if (! File::exists($appCssFilePath = resource_path('css/app.css')) || empty(trim(File::get($appCssFilePath))) || $this->mainCssIsDefault($appCssFilePath)) {
@@ -113,7 +113,7 @@ private function installMiddlewareAfter($after, $name, $group = 'web')
113113
private function appendTailwindStylesToLayouts()
114114
{
115115
$this->existingLayoutFiles()
116-
->each(fn ($file) => File::put(
116+
->each(fn($file) => File::put(
117117
$file,
118118
(new AppendTailwindTag())(File::get($file)),
119119
));
@@ -122,8 +122,8 @@ private function appendTailwindStylesToLayouts()
122122
private function existingLayoutFiles()
123123
{
124124
return collect(['app', 'guest'])
125-
->map(fn ($file) => resource_path("views/layouts/{$file}.blade.php"))
126-
->filter(fn ($file) => File::exists($file));
125+
->map(fn($file) => resource_path("views/layouts/{$file}.blade.php"))
126+
->filter(fn($file) => File::exists($file));
127127
}
128128

129129
private function installMiddleware(string $middleware)

stubs/postcss.config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

stubs/resources/css/app.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
@import "tailwindcss";
1+
@import "tailwindcss/base";
2+
@import "tailwindcss/components";
3+
@import "tailwindcss/utilities";
24

stubs/tailwind.config.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const defaultTheme = require("tailwindcss/defaultTheme");
2+
3+
module.exports = {
4+
content: [
5+
"./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php",
6+
"./vendor/laravel/jetstream/**/*.blade.php",
7+
"./storage/framework/views/*.php",
8+
"./resources/views/**/*.blade.php",
9+
"./resources/js/**/*.js",
10+
],
11+
theme: {
12+
extend: {
13+
fontFamily: {
14+
sans: ["Figtree", ...defaultTheme.fontFamily.sans],
15+
},
16+
},
17+
},
18+
plugins: [require("@tailwindcss/forms")],
19+
};

0 commit comments

Comments
 (0)