Skip to content
This repository was archived by the owner on Sep 18, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/Preset.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public static function install()
static::updateStyles();
static::updateWebpackConfiguration();
static::updateJavaScript();
static::createTailwindConfig();
static::updateTemplates();
static::removeNodeModules();
static::updateGitignore();
Expand All @@ -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',
Expand Down Expand Up @@ -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'));
}
}
2 changes: 1 addition & 1 deletion src/stubs/resources/css/app.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "tailwindcss/preflight";
@import "tailwindcss/base";

/* Add custom base styles here... */

Expand Down
7 changes: 7 additions & 0 deletions src/stubs/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
important: true,
theme: {
extend: {}
},
variants: {}
}
2 changes: 1 addition & 1 deletion src/stubs/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link rel="stylesheet" href="{{ mix('css/app.css') }}">
<title>{{ config('app.name', 'Laravel') }}</title>
</head>
<body class="font-sans antialiased text-black leading-tight">
<body class="font-sans antialiased text-gray-800 leading-tight">
<div id="app">
@yield('body')
</div>
Expand Down
5 changes: 4 additions & 1 deletion src/stubs/views/welcome.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

@section('body')
<div class="min-h-screen flex items-center justify-center">
<h1 class="text-5xl text-purple font-sans">Greetings.</h1>
<div class="text-center">
<h1 class="text-5xl text-purple-500 font-sans">Greetings.</h1>
<p>Laravel &bull; Tailwind</p>
</div>
</div>
@endsection
3 changes: 2 additions & 1 deletion src/stubs/webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down