Skip to content

Commit 433cf5a

Browse files
use tailwindcss, update namespacing
1 parent 687db0d commit 433cf5a

File tree

17 files changed

+90
-101
lines changed

17 files changed

+90
-101
lines changed

README.md

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
1-
# Tailwind CSS preset for the Laravel framework
1+
# Laravel 5.5.x Frontend preset for Tailwind CSS
22

33
A Laravel front-end scaffolding preset for [Tailwind CSS](https://tailwindcss.com) - a Utility-First CSS Framework for Rapid UI Development.
44

5-
### Installing
6-
```bash
7-
composer require dyrynda/laravel-preset-tailwind
8-
```
5+
*Current version:* **Tailwind CSS 0.1.0**
96

10-
### Setting up the new preset
11-
```bash
12-
php artisan preset tailwind
13-
```
7+
## Usage
148

15-
### Auth scaffolding
16-
```bash
17-
php artisan preset tailwind-auth
18-
```
19-
20-
### Compiling assets
21-
```bash
22-
npm install && npm run dev
23-
```
24-
25-
Enjoy!
9+
1. Fresh install Laravel 5.5.x and cd to your app.
10+
2. Install this preset via `composer require laravel-frontend-presets/tailwindcss`. Laravel 5.5.x will automatically discover this package. No need to register the service provider.
11+
3. Use `php artisan preset tailwindcss` for the basic Tailwind CSS preset OR use `php artisan preset tailwindcss-auth` for the basic preset, auth route entry and Tailwind CSS auth views in one go. (NOTE: If you run this command several times, be sure to clean up the duplicate Auth entries in `routes/web.php`)
12+
4. `npm install`
13+
5. `npm run dev`
14+
6. Configure your favorite database (mysql, sqlite etc.)
15+
7. `php artisan migrate` to create basic user tables.
16+
8. `php artisan serve` (or equivalent) to run server and test preset.
2617

2718
### Changing colours
2819

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
2-
"name": "dyrynda/laravel-preset-tailwind",
3-
"description": "Laravel 5.5 frontend preset for Tailwind",
4-
"keywords": ["laravel", "preset", "tailwind"],
2+
"name": "laravel-frontend-presets/tailwindcss",
3+
"description": "Laravel 5.5 frontend preset for Tailwind CSS",
4+
"keywords": ["laravel", "preset", "tailwindcss"],
55
"license": "MIT",
66
"require": {
77
"laravel/framework": "5.5.*"
88
},
99
"autoload": {
1010
"psr-4": {
11-
"Dyrynda\\LaravelPresets\\Tailwind\\": "src/"
11+
"LaravelFrontendPresets\\TailwindCssPreset\\": "src/"
1212
}
1313
},
1414
"extra": {
1515
"laravel": {
1616
"providers": [
17-
"Dyrynda\\LaravelPresets\\Tailwind\\TailwindPresetServiceProvider"
17+
"LaravelFrontendPresets\\TailwindCssPreset\\TailwindCssPresetServiceProvider"
1818
]
1919
}
2020
}

src/TailwindPreset.php renamed to src/TailwindCssPreset.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

3-
namespace Dyrynda\LaravelPresets\Tailwind;
3+
namespace LaravelFrontendPresets\TailwindCssPreset;
44

55
use Illuminate\Support\Arr;
66
use Illuminate\Container\Container;
77
use Illuminate\Filesystem\Filesystem;
88
use Illuminate\Foundation\Console\Presets\Preset;
99

10-
class TailwindPreset extends Preset
10+
class TailwindCssPreset extends Preset
1111
{
1212
public static function install()
1313
{
@@ -41,21 +41,21 @@ protected static function updateStyles()
4141
mkdir(resource_path('assets/css'));
4242
}
4343

44-
copy(__DIR__.'/tailwind-stubs/resources/assets/css/main.css', resource_path('assets/css/main.css'));
44+
copy(__DIR__.'/tailwindcss-stubs/resources/assets/css/main.css', resource_path('assets/css/main.css'));
4545
}
4646

4747
protected static function updateBootstrapping()
4848
{
49-
copy(__DIR__.'/tailwind-stubs/tailwind.js', base_path('tailwind.js'));
50-
copy(__DIR__.'/tailwind-stubs/webpack.mix.js', base_path('webpack.mix.js'));
51-
copy(__DIR__.'/tailwind-stubs/bootstrap.js', resource_path('assets/js/bootstrap.js'));
49+
copy(__DIR__.'/tailwindcss-stubs/tailwind.js', base_path('tailwind.js'));
50+
copy(__DIR__.'/tailwindcss-stubs/webpack.mix.js', base_path('webpack.mix.js'));
51+
copy(__DIR__.'/tailwindcss-stubs/bootstrap.js', resource_path('assets/js/bootstrap.js'));
5252
}
5353

5454
protected static function updateWelcomePage()
5555
{
5656
(new Filesystem)->delete(resource_path('views/welcome.blade.php'));
5757

58-
copy(__DIR__.'/tailwind-stubs/views/welcome.blade.php', resource_path('views/welcome.blade.php'));
58+
copy(__DIR__.'/tailwindcss-stubs/views/welcome.blade.php', resource_path('views/welcome.blade.php'));
5959
}
6060

6161
protected static function scaffoldAuth()
@@ -68,15 +68,15 @@ protected static function scaffoldAuth()
6868
FILE_APPEND
6969
);
7070

71-
(new Filesystem)->copyDirectory(__DIR__.'/tailwind-stubs/views', resource_path('views'));
71+
(new Filesystem)->copyDirectory(__DIR__.'/tailwindcss-stubs/views', resource_path('views'));
7272
}
7373

7474
protected static function compileControllerStub()
7575
{
7676
return str_replace(
7777
'{{namespace}}',
7878
Container::getInstance()->getNamespace(),
79-
file_get_contents(__DIR__.'/tailwind-stubs/controllers/HomeController.stub')
79+
file_get_contents(__DIR__.'/tailwindcss-stubs/controllers/HomeController.stub')
8080
);
8181
}
8282
}

src/TailwindPresetServiceProvider.php renamed to src/TailwindCssPresetServiceProvider.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
<?php
22

3-
namespace Dyrynda\LaravelPresets\Tailwind;
3+
namespace LaravelFrontendPresets\TailwindCssPreset;
44

55
use Illuminate\Support\ServiceProvider;
66
use Illuminate\Foundation\Console\PresetCommand;
77

8-
class TailwindPresetServiceProvider extends ServiceProvider
8+
class TailwindCssPresetServiceProvider extends ServiceProvider
99
{
1010
public function boot()
1111
{
12-
PresetCommand::macro('tailwind', function ($command) {
12+
PresetCommand::macro('tailwindcss', function ($command) {
1313
TailwindPreset::install();
1414

15-
$command->info('Tailwind scaffolding installed successfully.');
15+
$command->info('Tailwind CSS scaffolding installed successfully.');
1616
$command->info('Please run "npm install && npm run dev" to compile your fresh scaffolding.');
1717
});
1818

19-
PresetCommand::macro('tailwind-auth', function ($command) {
19+
PresetCommand::macro('tailwindcss-auth', function ($command) {
2020
TailwindPreset::installAuth();
2121

22-
$command->info('Tailwind scaffolding with auth views installed successfully.');
22+
$command->info('Tailwind CSS scaffolding with auth views installed successfully.');
2323
$command->info('Please run "npm install && npm run dev" to compile your fresh scaffolding.');
2424
});
2525
}

src/tailwind-stubs/views/auth/passwords/reset.blade.php

Lines changed: 0 additions & 54 deletions
This file was deleted.
File renamed without changes.

src/tailwind-stubs/tailwind.js renamed to src/tailwindcss-stubs/tailwind.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ var colors = {
128128
'pink-lighter': '#ffbbca',
129129
'pink-lightest': '#ffebef',
130130

131-
'brand-darkest': '#542605',
132-
'brand-darker': '#7f4012',
133-
'brand-dark': '#de751f',
134-
'brand': '#f6993f',
135-
'brand-light': '#faad63',
136-
'brand-lighter': '#fcd9b6',
137-
'brand-lightest': '#fff5eb',
131+
get 'brand-darkest' () => this['orange-darkest'],
132+
get 'brand-darker' () => this['orange-darker'],
133+
get 'brand-dark' () => this['orange-dark'],
134+
get 'brand' () => this['orange'],
135+
get 'brand-light' () => this['orange-light'],
136+
get 'brand-lighter' () => this['orange-lighter'],
137+
get 'brand-lightest' () => this['orange-lightest'],
138138
}
139139

140140
module.exports = {

0 commit comments

Comments
 (0)