diff --git a/src/Preset.php b/src/Preset.php index 5f02d42..90400ca 100644 --- a/src/Preset.php +++ b/src/Preset.php @@ -16,6 +16,7 @@ public static function install() static::updateStyles(); static::updateWebpackConfiguration(); static::updateJavaScript(); + static::createTailwindConfig(); static::updateTemplates(); static::removeNodeModules(); static::updateGitignore(); @@ -24,10 +25,10 @@ public static function install() protected static function updatePackageArray(array $packages) { return array_merge([ - 'laravel-mix-purgecss' => '^2.2.0', - 'postcss-nesting' => '^5.0.0', - 'postcss-import' => '^11.1.0', - 'tailwindcss' => '>=0.5.3', + 'laravel-mix-purgecss' => '^4.1.0', + 'postcss-nesting' => '^7.0.1', + 'postcss-import' => '^12.0.1', + 'tailwindcss' => '>=1.1.1', ], Arr::except($packages, [ 'bootstrap', 'bootstrap-sass', @@ -75,4 +76,9 @@ protected static function updateGitignore() { copy(__DIR__.'/stubs/gitignore-stub', base_path('.gitignore')); } + + protected static function createTailwindConfig() + { + copy(__DIR__.'/stubs/tailwind.config.js', base_path('tailwind.config.js')); + } } diff --git a/src/stubs/resources/css/app.css b/src/stubs/resources/css/app.css index cb85240..bcece88 100644 --- a/src/stubs/resources/css/app.css +++ b/src/stubs/resources/css/app.css @@ -1,4 +1,4 @@ -@import "tailwindcss/preflight"; +@import "tailwindcss/base"; /* Add custom base styles here... */ diff --git a/src/stubs/tailwind.config.js b/src/stubs/tailwind.config.js new file mode 100644 index 0000000..2a95d43 --- /dev/null +++ b/src/stubs/tailwind.config.js @@ -0,0 +1,7 @@ +module.exports = { + important: true, + theme: { + extend: {} + }, + variants: {} +} \ No newline at end of file diff --git a/src/stubs/views/layouts/app.blade.php b/src/stubs/views/layouts/app.blade.php index afd9691..8774ee8 100644 --- a/src/stubs/views/layouts/app.blade.php +++ b/src/stubs/views/layouts/app.blade.php @@ -8,7 +8,7 @@ {{ config('app.name', 'Laravel') }} - +
@yield('body')
diff --git a/src/stubs/views/welcome.blade.php b/src/stubs/views/welcome.blade.php index b666d9d..4c3e3cd 100644 --- a/src/stubs/views/welcome.blade.php +++ b/src/stubs/views/welcome.blade.php @@ -2,6 +2,9 @@ @section('body')
-

Greetings.

+
+

Greetings.

+

Laravel • Tailwind

+
@endsection diff --git a/src/stubs/webpack.mix.js b/src/stubs/webpack.mix.js index b267be8..d0901ce 100644 --- a/src/stubs/webpack.mix.js +++ b/src/stubs/webpack.mix.js @@ -6,8 +6,9 @@ mix.js('resources/js/app.js', 'public/js') .options({ postCss: [ require('postcss-import')(), - require('tailwindcss')(/* './path/to/tailwind.js' */), + require('tailwindcss'), require('postcss-nesting')(), + require('autoprefixer'), ] }) .purgeCss()