Skip to content

Commit 1f7793b

Browse files
committed
replaced card and button components with tailwind custom classes
1 parent 9b7977e commit 1f7793b

37 files changed

+342
-199
lines changed

stubs/resources/sass/app.scss

Lines changed: 127 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,51 @@
1313
}
1414

1515
h1 {
16-
@apply
17-
text-2xl text-gray-600 dark:text-gray-200
16+
@apply text-2xl text-gray-600 dark:text-gray-200;
1817
}
1918

2019
h2 {
21-
@apply
22-
py-2 text-2xl text-gray-600 dark:text-gray-300
20+
@apply py-2 text-2xl text-gray-600 dark:text-gray-300;
2321
}
2422

2523
h3 {
26-
@apply
27-
py-2 text-xl text-gray-600 dark:text-gray-300
24+
@apply py-2 text-xl text-gray-600 dark:text-gray-300;
2825
}
2926

3027
p {
31-
@apply
32-
py-2 dark:text-gray-300
28+
@apply py-2 dark:text-gray-300;
29+
}
30+
31+
table {
32+
@apply w-full;
33+
}
34+
35+
th {
36+
@apply px-2 py-3;
37+
}
38+
39+
td {
40+
@apply p-2 border-t;
41+
}
42+
43+
thead tr {
44+
@apply text-left bg-gray-100 text-gray-600;
45+
}
46+
47+
tbody tr {
48+
@apply hover:bg-gray-100 dark:hover:bg-blue-500 focus-within:bg-gray-100;
49+
}
50+
51+
hr {
52+
@apply border-t border-gray-300;
53+
}
54+
55+
.input {
56+
@apply w-full dark:bg-gray-500 dark:text-gray-200 dark:placeholder-gray-200 border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none sm:text-sm;
3357
}
3458

3559
.alert {
36-
@apply
37-
rounded-md
38-
shadow-md
39-
text-sm
40-
font-medium
41-
p-4
42-
mb-5;
60+
@apply rounded-md shadow-md text-sm font-medium p-4 mb-5;
4361

4462
&.alert-green {
4563
@apply bg-green-500 text-green-200;
@@ -90,48 +108,124 @@
90108
}
91109
}
92110

93-
.button {
94-
@apply
95-
inline-flex
96-
items-center
97-
py-2
98-
px-4
99-
border
100-
rounded-md
101-
text-sm
102-
font-medium;
111+
.btn {
112+
@apply inline-flex items-center py-2 px-4 border rounded-md text-sm font-medium;
113+
114+
&.btn-green {
115+
@apply bg-green-600 hover:bg-green-500 border-green-600 text-white;
116+
}
117+
118+
&.btn-red {
119+
@apply bg-red-600 hover:bg-red-500 border-red-600 text-white;
120+
}
121+
122+
&.btn-yellow {
123+
@apply bg-yellow-600 hover:bg-yellow-500 border-yellow-600 text-white;
124+
}
125+
126+
&.btn-blue {
127+
@apply bg-blue-600 hover:bg-blue-500 border-blue-600 text-white;
128+
}
129+
130+
&.btn-gray {
131+
@apply bg-gray-600 hover:bg-gray-500 border-gray-600 text-white;
132+
}
133+
134+
&.btn-indigo {
135+
@apply bg-indigo-600 hover:bg-indigo-500 border-indigo-600 text-white;
136+
}
137+
138+
&.btn-purple {
139+
@apply bg-purple-600 hover:bg-purple-500 border-purple-600 text-white;
140+
}
141+
142+
&.btn-pink {
143+
@apply bg-pink-600 hover:bg-pink-500 border-pink-600 text-white;
144+
}
145+
}
146+
147+
.btn-sm {
148+
@apply inline-flex items-center py-1 px-2 border rounded-md text-sm font-medium;
103149

104-
&.button-green {
150+
&.btn-green {
105151
@apply bg-green-600 hover:bg-green-500 border-green-600 text-white;
106152
}
107153

108-
&.button-red {
154+
&.btn-red {
109155
@apply bg-red-600 hover:bg-red-500 border-red-600 text-white;
110156
}
111157

112-
&.button-yellow {
158+
&.btn-yellow {
113159
@apply bg-yellow-600 hover:bg-yellow-500 border-yellow-600 text-white;
114160
}
115161

116-
&.button-blue {
162+
&.btn-blue {
117163
@apply bg-blue-600 hover:bg-blue-500 border-blue-600 text-white;
118164
}
119165

120-
&.button-gray {
166+
&.btn-gray {
121167
@apply bg-gray-600 hover:bg-gray-500 border-gray-600 text-white;
122168
}
123169

124-
&.button-indigo {
170+
&.btn-indigo {
125171
@apply bg-indigo-600 hover:bg-indigo-500 border-indigo-600 text-white;
126172
}
127173

128-
&.button-purple {
174+
&.btn-purple {
129175
@apply bg-purple-600 hover:bg-purple-500 border-purple-600 text-white;
130176
}
131177

132-
&.button-pink {
178+
&.btn-pink {
133179
@apply bg-pink-600 hover:bg-pink-500 border-pink-600 text-white;
134180
}
135181
}
182+
183+
.link-green {
184+
@apply text-green-600 hover:text-green-500;
185+
}
186+
187+
.link-red {
188+
@apply text-red-600 hover:text-red-500;
189+
}
190+
191+
.link-yellow {
192+
@apply text-yellow-600 hover:text-yellow-500;
193+
}
194+
195+
.link-blue {
196+
@apply text-blue-600 hover:text-blue-500;
197+
}
198+
199+
.link-gray {
200+
@apply text-gray-600 hover:text-gray-500;
201+
}
202+
203+
.link-indigo {
204+
@apply text-indigo-600 hover:text-indigo-500;
205+
}
206+
207+
.link-purple {
208+
@apply text-purple-600 hover:text-purple-500;
209+
}
210+
211+
.link-pink {
212+
@apply text-pink-600 hover:text-pink-500;
213+
}
214+
215+
.error {
216+
@apply text-red-500
217+
}
218+
219+
.card {
220+
@apply bg-white dark:bg-gray-800 dark:text-white shadow rounded-md overflow-x-auto my-5 px-4 py-5
221+
}
222+
223+
.card-no-padding {
224+
@apply bg-white dark:bg-gray-800 dark:text-white shadow rounded-md overflow-x-auto
225+
}
226+
227+
.col2 {
228+
@apply grid md:grid-cols-2 gap-10
229+
}
136230
}
137231

stubs/resources/views/app/dashboard.blade.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
<x-slot name="title">Dashboard</x-slot>
44

5-
<x-card>
5+
<div class="card">
66
You're logged in!
7-
</x-card>
8-
9-
7+
</div>
108

119
</x-app-layout>

stubs/resources/views/auth/confirm-password.blade.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,13 @@
1818

1919
<!-- Password -->
2020
<div>
21-
<x-label for="password" :value="__('Password')" />
22-
23-
<x-input id="password" class="block mt-1 w-full"
24-
type="password"
25-
name="password"
26-
required autocomplete="current-password" />
21+
<x-form.input type="password" label="Password" name="password"></x-form.input>
2722
</div>
2823

2924
<div class="flex justify-end mt-4">
30-
<x-button>
25+
<button class="btn btn-blue">
3126
{{ __('Confirm') }}
32-
</x-button>
27+
</button>
3328
</div>
3429
</form>
3530
</x-auth-card>

stubs/resources/views/auth/forgot-password.blade.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,13 @@
2121

2222
<!-- Email Address -->
2323
<div>
24-
<x-label for="email" :value="__('Email')" />
25-
26-
<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autofocus />
24+
<x-form.input label="Email" name="email">{{ old('email') }}</x-form.input>
2725
</div>
2826

2927
<div class="flex items-center justify-end mt-4">
30-
<x-button>
28+
<button class="btn btn-blue">
3129
{{ __('Email Password Reset Link') }}
32-
</x-button>
30+
</button>
3331
</div>
3432
</form>
3533
</x-auth-card>

stubs/resources/views/auth/login.blade.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@
1717

1818
<!-- Email Address -->
1919
<div>
20-
<x-label for="email" :value="__('Email')" />
21-
<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required autofocus />
20+
<x-form.input label="Email" name="email">{{ old('email') }}</x-form.input>
2221
</div>
2322

2423
<!-- Password -->
2524
<div class="mt-4">
26-
<x-label for="password" :value="__('Password')" />
27-
<x-input id="password" class="block mt-1 w-full" type="password" name="password" required autocomplete="current-password" />
25+
<x-form.input type="password" label="Password" name="password"></x-form.input>
2826
</div>
2927

3028
<!-- Remember Me -->
@@ -35,16 +33,16 @@
3533
</label>
3634
</div>
3735

38-
<div class="flex items-center justify-end mt-4">
36+
<div class="flex justify-between mt-4">
3937
@if (Route::has('password.request'))
4038
<a class="underline text-sm text-gray-600 hover:text-gray-900" href="{{ route('password.request') }}">
4139
{{ __('Forgot your password?') }}
4240
</a>
4341
@endif
4442

45-
<x-button class="ml-3">
43+
<button class="btn btn-blue">
4644
{{ __('Log in') }}
47-
</x-button>
45+
</button>
4846
</div>
4947
</form>
5048
</x-auth-card>

stubs/resources/views/auth/register.blade.php

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,45 +14,32 @@
1414

1515
<!-- Name -->
1616
<div>
17-
<x-label for="name" :value="__('Name')" />
18-
19-
<x-input id="name" class="block mt-1 w-full" type="text" name="name" :value="old('name')" required autofocus />
17+
<x-form.input label="Name" name="name">{{ old('name') }}</x-form.input>
2018
</div>
2119

2220
<!-- Email Address -->
2321
<div class="mt-4">
24-
<x-label for="email" :value="__('Email')" />
25-
26-
<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" required />
22+
<x-form.input label="Email" name="email">{{ old('email') }}</x-form.input>
2723
</div>
2824

2925
<!-- Password -->
3026
<div class="mt-4">
31-
<x-label for="password" :value="__('Password')" />
32-
33-
<x-input id="password" class="block mt-1 w-full"
34-
type="password"
35-
name="password"
36-
required autocomplete="new-password" />
27+
<x-form.input type="password" label="Password" name="password"></x-form.input>
3728
</div>
3829

3930
<!-- Confirm Password -->
4031
<div class="mt-4">
41-
<x-label for="password_confirmation" :value="__('Confirm Password')" />
42-
43-
<x-input id="password_confirmation" class="block mt-1 w-full"
44-
type="password"
45-
name="password_confirmation" required />
32+
<x-form.input type="password" label="Comfirm Password" name="password_confirmation"></x-form.input>
4633
</div>
4734

4835
<div class="flex items-center justify-end mt-4">
4936
<a class="underline text-sm text-gray-600 hover:text-gray-900" href="{{ route('login') }}">
5037
{{ __('Already registered?') }}
5138
</a>
5239

53-
<x-button class="ml-4">
40+
<button class="ml-4 btn btn-blue">
5441
{{ __('Register') }}
55-
</x-button>
42+
</button>
5643
</div>
5744
</form>
5845
</x-auth-card>

stubs/resources/views/auth/reset-password.blade.php

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,23 @@
1717

1818
<!-- Email Address -->
1919
<div>
20-
<x-label for="email" :value="__('Email')" />
21-
22-
<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email', $request->email)" required autofocus />
20+
<x-form.input label="Email" name="email">{{ old('email') }}</x-form.input>
2321
</div>
2422

2523
<!-- Password -->
2624
<div class="mt-4">
27-
<x-label for="password" :value="__('Password')" />
28-
29-
<x-input id="password" class="block mt-1 w-full" type="password" name="password" required />
25+
<x-form.input type="password" label="Password" name="password"></x-form.input>
3026
</div>
3127

3228
<!-- Confirm Password -->
3329
<div class="mt-4">
34-
<x-label for="password_confirmation" :value="__('Confirm Password')" />
35-
36-
<x-input id="password_confirmation" class="block mt-1 w-full"
37-
type="password"
38-
name="password_confirmation" required />
30+
<x-form.input type="password" label="Confirm Password" name="password_confirmation"></x-form.input>
3931
</div>
4032

4133
<div class="flex items-center justify-end mt-4">
42-
<x-button>
34+
<button class="btn btn-blue">
4335
{{ __('Reset Password') }}
44-
</x-button>
36+
</button>
4537
</div>
4638
</form>
4739
</x-auth-card>

0 commit comments

Comments
 (0)