Skip to content

Commit ccfe786

Browse files
authored
Elements template (#105)
* Remove `autoprefixer` * Update Bun dependencies * Update Composer dependencies * Remove autoprefixer form Vite config * Update app.css * Remove `@tailwindcss/typography` * Add simple template for testing elements * Add form elements * Add toggle button * Add text content * Update forms.css * Move toggle styles to forms file * Style content * Style tables * Refactor transition usage * Add hover state to toggle * Update App.vue * Fix code style
1 parent f61baab commit ccfe786

27 files changed

+589
-313
lines changed

bun.lockb

-23.2 KB
Binary file not shown.

composer.lock

Lines changed: 188 additions & 186 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
{
22
"devDependencies": {
3-
"@inertiajs/vue3": "^2.0.3",
4-
"@sentry/vue": "^8.54.0",
3+
"@inertiajs/vue3": "^2.0.5",
4+
"@sentry/vue": "^8.55.0",
55
"@tailwindcss/forms": "^0.5.10",
6-
"@tailwindcss/typography": "^0.5.16",
7-
"@tailwindcss/vite": "^4.0.4",
8-
"@vitejs/plugin-vue": "^5.2.1",
9-
"autoprefixer": "^10.4.20",
6+
"@tailwindcss/vite": "^4.0.17",
7+
"@vitejs/plugin-vue": "^5.2.3",
108
"laravel-vite-plugin": "^1.2.0",
11-
"tailwindcss": "^4.0.0",
12-
"vite": "^6.1.0",
9+
"tailwindcss": "^4.0.17",
10+
"vite": "^6.2.3",
1311
"vue": "^3.5.13"
1412
},
1513
"private": true,
@@ -19,7 +17,7 @@
1917
},
2018
"type": "module",
2119
"dependencies": {
22-
"caniuse-lite": "^1.0.30001697",
20+
"caniuse-lite": "^1.0.30001707",
2321
"lucide-vue-next": "^0.479.0"
2422
}
2523
}

resources/css/app.css

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,19 @@
33

44
@import "tailwindcss";
55

6+
@plugin '@tailwindcss/forms';
7+
8+
@import "./variables.css";
9+
610
@import "./typography.css";
11+
@import "./utilities.css";
712
@import "./forms.css";
813
@import "./buttons.css";
14+
@import "./tables.css";
915
@import "./content.css";
1016

11-
@plugin '@tailwindcss/forms';
12-
@plugin '@tailwindcss/typography';
13-
14-
@theme {
15-
--font-*: initial;
16-
--font-text: "Arial", sans-serif;
17-
--font-heading: "Arial", sans-serif;
18-
19-
--breakpoint-xs: 321px;
20-
--breakpoint-sm: 451px;
21-
--breakpoint-md: 671px;
22-
--breakpoint-lg: 769px;
23-
--breakpoint-xl: 1025px;
24-
--breakpoint-2xl: 1281px;
25-
--breakpoint-3xl: 1441px;
26-
--breakpoint-4xl: 1901px;
27-
28-
--color-brand-50: #f3f6fb;
29-
--color-brand-100: #e5e9f4;
30-
--color-brand-200: #d0d9ed;
31-
--color-brand-300: #b0c0e0;
32-
--color-brand-400: #8a9fd0;
33-
--color-brand-500: #6a7fc1;
34-
--color-brand-600: #5b6bb5;
35-
--color-brand-700: #505aa5;
36-
--color-brand-800: #464c87;
37-
--color-brand-900: #3c416c;
38-
--color-brand-950: #282a43;
39-
}
40-
41-
#app {
42-
@apply h-full;
17+
@layer base {
18+
#app {
19+
@apply h-full;
20+
}
4321
}

resources/css/buttons.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@utility button {
2-
@apply cursor-pointer rounded-md bg-brand-800 px-6 py-3 text-sm font-semibold text-white inline-flex shadow-xs hover:bg-brand-600 transition-all ease-in-out duration-200;
2+
@apply cursor-pointer rounded-md bg-brand-800 px-6 py-3 text-sm font-semibold text-white inline-flex shadow-xs hover:bg-brand-600 transition-colors;
33

44
&[disabled] {
55
@apply pointer-events-none opacity-50;

resources/css/content.css

Lines changed: 53 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,110 @@
11
@utility content {
2-
@apply prose text-neutral-700;
2+
strong {
3+
@apply font-bold;
4+
}
35

46
h1,
57
h2,
68
h3,
79
h4,
810
h5,
911
h6 {
10-
@apply font-heading font-bold text-neutral-900;
12+
@apply heading;
1113
}
1214

1315
h1 {
14-
@apply text-4xl md:text-5xl;
16+
@apply h1;
1517
}
1618

1719
h2 {
18-
@apply text-3xl;
20+
@apply h2;
1921
}
2022

2123
h3 {
22-
@apply text-2xl;
24+
@apply h3;
2325
}
2426

2527
h4 {
26-
@apply text-xl;
28+
@apply h4;
2729
}
2830

2931
h5 {
30-
@apply text-lg;
32+
@apply h5;
3133
}
3234

3335
h6 {
34-
@apply text-base;
36+
@apply h6;
3537
}
3638

37-
li {
38-
@apply ml-8;
39+
a:not(.button) {
40+
@apply text-link;
3941
}
4042

41-
a {
42-
@apply hover:underline;
43+
blockquote {
44+
@apply pl-6 py-3 border-l-3 border-brand-300;
45+
46+
p {
47+
@apply text-xl font-serif italic;
48+
}
4349
}
4450

45-
ul li {
46-
@apply list-disc;
51+
table {
52+
@apply table;
4753
}
4854

49-
ol li {
50-
@apply list-decimal;
55+
tr:first-child th {
56+
@apply pt-0;
5157
}
5258

53-
strong {
54-
@apply font-bold;
59+
ol,
60+
ul {
61+
@apply list-inside;
5562
}
5663

57-
blockquote {
58-
@apply pl-4 py-3 my-4 border-s-4 border-gray-300 text-xl italic;
64+
ol li {
65+
@apply list-decimal;
5966
}
6067

61-
table {
62-
@apply w-full text-sm text-left;
68+
ul li {
69+
@apply list-disc;
6370
}
6471

65-
th {
66-
@apply p-4 font-bold bg-brand-200;
72+
> * + * {
73+
@apply mt-12;
6774
}
6875

69-
td {
70-
@apply p-4 font-medium;
76+
p + p,
77+
p + ol,
78+
ol + p,
79+
p + ul,
80+
ul + p,
81+
ul + ul,
82+
ol + ol,
83+
ul + ol,
84+
ol + ul {
85+
@apply mt-6;
7186
}
7287

73-
tr:not(:last-child) td {
74-
@apply border-b border-brand-200;
88+
li + li {
89+
@apply mt-2;
7590
}
7691

77-
* {
92+
h1,
93+
h2,
94+
h3,
95+
h4,
96+
h5,
97+
h6 {
98+
& + p,
99+
& + ul,
100+
& + ol,
78101
& + h1,
79102
& + h2,
80103
& + h3,
81104
& + h4,
82105
& + h5,
83106
& + h6 {
84-
@apply mt-8;
107+
@apply mt-6;
85108
}
86109
}
87110
}

resources/css/forms.css

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
}
2626

2727
@utility inline-label {
28-
@apply flex items-center gap-x-2;
28+
@apply flex items-center gap-x-2 text-sm;
2929
}
3030

3131
@utility field {
32-
@apply block rounded-md border-brand-300 shadow-xs outline-hidden hover:ring-3 hover:ring-brand-200/50 focus:border-brand-300 focus:ring-3 focus:ring-brand-200/50 focus:ring-offset-0 transition ease-in-out duration-200;
32+
@apply block rounded-md border-brand-300 shadow-xs outline-hidden hover:ring-3 hover:ring-brand-200/50 focus:border-brand-300 focus:ring-3 focus:ring-brand-200/50 focus:ring-offset-0 transition;
3333
}
3434

3535
@utility input {
@@ -45,7 +45,7 @@
4545
}
4646

4747
@utility option {
48-
@apply field cursor-pointer size-5 text-brand-800;
48+
@apply field cursor-pointer size-5 text-brand-800 checked:border-transparent;
4949
}
5050

5151
@utility checkbox {
@@ -55,3 +55,18 @@
5555
@utility radio {
5656
@apply option rounded-full;
5757
}
58+
59+
@utility toggle {
60+
@apply inline-flex items-center gap-3 cursor-pointer;
61+
62+
div {
63+
@apply relative w-9 h-5 bg-brand-200 rounded-full transition;
64+
@apply peer-hover:ring-3 peer-hover:ring-brand-200/50 peer-focus:ring-3 peer-focus:ring-brand-200/50 peer-focus:outline-hidden;
65+
@apply peer-checked:after:translate-x-full peer-checked:rtl:after:-translate-x-full peer-checked:after:border-white peer-checked:bg-brand-800;
66+
@apply after:bg-white after:rounded-full after:size-4 after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:transition-all;
67+
}
68+
69+
span {
70+
@apply text-sm;
71+
}
72+
}

resources/css/tables.css

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
@utility table {
2+
@apply w-full text-left;
3+
4+
th,
5+
td {
6+
@apply border-b;
7+
}
8+
9+
th:first-child,
10+
td:first-child {
11+
@apply pl-0;
12+
}
13+
14+
th:last-child,
15+
td:last-child {
16+
@apply pr-0;
17+
}
18+
19+
th {
20+
@apply p-3 font-bold border-b-2 border-brand-950;
21+
}
22+
23+
td {
24+
@apply p-3 border-brand-950/15;
25+
}
26+
}
27+
28+
@utility table-wrap {
29+
@apply w-full overflow-auto;
30+
31+
table {
32+
@apply min-w-[500px];
33+
}
34+
}

resources/css/typography.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@utility heading {
2-
@apply text-neutral-900 font-semibold leading-none;
2+
@apply text-neutral-900 font-medium leading-none;
33
}
44

55
@utility h1 {

resources/css/utilities.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@utility text-link {
2+
@apply underline hover:decoration-transparent transition-colors;
3+
}

0 commit comments

Comments
 (0)