Skip to content

Commit f5b8c32

Browse files
replace Bootstrap with Tailwind
1 parent cb446a8 commit f5b8c32

File tree

7 files changed

+60
-65
lines changed

7 files changed

+60
-65
lines changed

src/InertiaJsPreset.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ public static function install($command)
1717
static::$command = $command;
1818

1919
static::updatePackages();
20-
static::installBootstrapDefault();
2120
static::updateComposer(false);
2221
static::updateBootstrapping();
2322
static::updateWelcomePage();
@@ -87,23 +86,6 @@ protected static function scaffoldRoutes()
8786
copy(__DIR__.'/inertiajs-stubs/routes/web.php', base_path('routes/web.php'));
8887
}
8988

90-
protected static function installBootstrapDefault()
91-
{
92-
if (! file_exists(base_path('composer.json'))) {
93-
return;
94-
}
95-
96-
tap(new Process('composer require --dev laravel/ui=^1.0', base_path()), function ($process) {
97-
$process->run();
98-
99-
Artisan::call('preset bootstrap', [], static::$command->getOutput());
100-
});
101-
102-
tap(new Process('composer remove --dev laravel/ui', base_path()), function ($process) {
103-
$process->run();
104-
});
105-
}
106-
10789
protected static function updateComposer($dev = true)
10890
{
10991
if (! file_exists(base_path('composer.json'))) {

src/inertiajs-stubs/resources/js/Pages/About.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<layout>
3-
<h1>About</h1>
3+
<h1 class="text-2xl font-semibold mb-3">About</h1>
44
<p>About my first Inertia.js app!</p>
55
</layout>
66
</template>

src/inertiajs-stubs/resources/js/Pages/Contact.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<layout>
3-
<h1>Contact</h1>
3+
<h1 class="text-2xl font-semibold mb-3">Contact</h1>
44
<p>Contact me about my first Inertia.js app!</p>
55
</layout>
66
</template>

src/inertiajs-stubs/resources/js/Pages/Welcome.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<layout>
3-
<h1>Welcome</h1>
3+
<h1 class="text-2xl font-semibold mb-3">Welcome</h1>
44
<p>Welcome to my first Inertia.js app!</p>
55
</layout>
66
</template>
Lines changed: 19 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,23 @@
11
<template>
2-
<div>
3-
<header>
4-
<nav class="navbar navbar-expand-md navbar-light navbar-laravel">
5-
<div class="container">
6-
<inertia-link class="navbar-brand" href="/">Inertia.js</inertia-link>
2+
<div>
3+
<navbar />
74

8-
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#mainNav" aria-controls="mainNav" aria-expanded="false" aria-label="Toggle navigation">
9-
<span class="navbar-toggler-icon"></span>
10-
</button>
11-
12-
<div class="collapse navbar-collapse" id="mainNav">
5+
<main>
6+
<div class="w-full max-w-6xl mx-auto p-4">
7+
<article>
8+
<slot />
9+
</article>
10+
</div>
11+
</main>
12+
</div>
13+
</template>
1314

14-
<ul class="navbar-nav mr-auto">
15-
<li class="nav-item">
16-
<inertia-link class="nav-link" href="/about">About</inertia-link>
17-
</li>
18-
<li class="nav-item">
19-
<inertia-link class="nav-link" href="/contact">Contact</inertia-link>
20-
</li>
21-
</ul>
15+
<script>
16+
import Navbar from '@/Shared/Navbar'
2217
23-
</div>
24-
</div>
25-
</nav>
26-
</header>
27-
<main class="py-4">
28-
<div class="container">
29-
<div class="row">
30-
<div class="col">
31-
<article>
32-
<slot />
33-
</article>
34-
</div>
35-
</div>
36-
</div>
37-
</main>
38-
</div>
39-
</template>
18+
export default {
19+
components: {
20+
Navbar,
21+
}
22+
}
23+
</script>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<template>
2+
<header class="bg-white shadow">
3+
<div class="w-full max-w-6xl mx-auto sm:flex sm:justify-between sm:items-center sm:px-4 sm:py-3">
4+
<div class="flex justify-between items-center px-4 py-3 sm:p-0">
5+
<div>
6+
<inertia-link class="navbar-brand" href="/">Inertia.js</inertia-link>
7+
</div>
8+
9+
<div class="sm:hidden">
10+
<button @click="isOpen = !isOpen" type="button" class="block text-gray-700 hover:text-gray-600 focus:text-gray-600 focus:outline-none">
11+
<svg class="h-6 w-6 fill-current" viewBox="0 0 24 24">
12+
<path v-if="isOpen" fill-rule="evenodd" d="M18.278 16.864a1 1 0 0 1-1.414 1.414l-4.829-4.828-4.828 4.828a1 1 0 0 1-1.414-1.414l4.828-4.829-4.828-4.828a1 1 0 0 1 1.414-1.414l4.829 4.828 4.828-4.828a1 1 0 1 1 1.414 1.414l-4.828 4.829 4.828 4.828z"/>
13+
<path v-if="!isOpen" fill-rule="evenodd" d="M4 5h16a1 1 0 0 1 0 2H4a1 1 0 1 1 0-2zm0 6h16a1 1 0 0 1 0 2H4a1 1 0 0 1 0-2zm0 6h16a1 1 0 0 1 0 2H4a1 1 0 0 1 0-2z"/>
14+
</svg>
15+
</button>
16+
</div>
17+
</div>
18+
19+
<nav :class="isOpen ? 'block' : 'hidden'" class="px-2 pb-4 sm:flex sm:p-0">
20+
<inertia-link class="block px-2 py-1 text-gray-700 font-semibold rounded hover:bg-gray-100 focus:bg-gray-100 focus:outline-none" href="/about">About</inertia-link>
21+
<inertia-link class="mt-1 block px-2 py-1 text-gray-700 font-semibold rounded hover:bg-gray-100 focus:bg-gray-100 focus:outline-none sm:mt-0 sm:ml-2" href="/contact">Contact</inertia-link>
22+
</nav>
23+
</div>
24+
</header>
25+
</template>
26+
27+
<script>
28+
export default {
29+
data() {
30+
return {
31+
isOpen: false,
32+
}
33+
}
34+
}
35+
</script>
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11

2+
// Tailwind
3+
@import url('https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css');
4+
25
// Fonts
36
@import url('https://fonts.googleapis.com/css?family=Nunito');
47

58
// Variables
6-
@import 'variables';
79
@import 'nprogress';
8-
9-
// Bootstrap
10-
@import '~bootstrap/scss/bootstrap';
11-
12-
.navbar-laravel {
13-
background-color: #fff;
14-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
15-
}

0 commit comments

Comments
 (0)