@@ -44,13 +44,66 @@ async function onSubmit(event: FormSubmitEvent<Schema>) {
44
44
</script >
45
45
46
46
<template >
47
- <UForm :schema =" schema" :state =" formState" class =" flex flex-col gap-4" @submit =" onSubmit" >
48
- <UFormGroup name =" title" >
49
- <UInput size =" lg" v-model =" formState.title" placeholder =" Title" />
50
- </UFormGroup >
51
- <UFormGroup name =" description" >
52
- <UTextarea size =" lg" v-model =" formState.description" placeholder =" Description (Markdown supported)" autoresize :maxrows =" 3" />
53
- </UFormGroup >
54
- <UButton size =" lg" type =" submit" label =" Add Habit" block />
55
- </UForm >
47
+ <div class =" p-8" >
48
+ <UForm :schema =" schema" :state =" formState" class =" flex flex-col gap-4" @submit =" onSubmit" >
49
+ <UFormGroup name =" title" >
50
+ <div class =" input-container" >
51
+ <input v-model =" formState.title" placeholder =" Title..." />
52
+ </div >
53
+ </UFormGroup >
54
+ <UFormGroup name =" description" >
55
+ <div class =" input-container" >
56
+ <textarea rows =" 5" v-model =" formState.description" placeholder =" Description (Markdown supported)..." ></textarea >
57
+ </div >
58
+ </UFormGroup >
59
+ <button type =" submit" class =" button bg-green-400 px-2.5 py-3 font-semibold text-green-950 outline-none hover:bg-green-300" >Add Habit</button >
60
+ </UForm >
61
+ </div >
56
62
</template >
63
+
64
+ <style lang="postcss" scoped>
65
+ .input-container {
66
+ @apply relative flex w-full items-center;
67
+ }
68
+
69
+ input ,
70
+ textarea {
71
+ box-shadow :
72
+ inset 0.5 px 0.5 px 1 px 0 px rgba (255 , 255 , 255 , 0.1 ),
73
+ inset -0.5 px -0.5 px 1 px 0 px rgba (0 , 0 , 0 , 0.1 ),
74
+ rgba (0 , 0 , 0 , 0.2 ) 0 px 3 px 10 px -5 px ;
75
+ @apply w-full rounded-2xl bg-white/ 10 p-4 outline-none transition-all placeholder :text-white/ 35 ;
76
+ &:focus {
77
+ @apply bg-white/ 15 ;
78
+ }
79
+ }
80
+
81
+ textarea {
82
+ resize : none;
83
+ --sb-track-color : rgba (0 , 0 , 0 , 0 );
84
+ --sb-thumb-color : #666 ;
85
+ --sb-size : 12 px ;
86
+ }
87
+
88
+ textarea::-webkit-scrollbar {
89
+ width : var (--sb-size );
90
+ }
91
+
92
+ textarea::-webkit-scrollbar-track {
93
+ background : var (--sb-track-color );
94
+ margin-top : 10 px ;
95
+ margin-bottom : 10 px ;
96
+ }
97
+
98
+ textarea::-webkit-scrollbar-thumb {
99
+ background : var (--sb-thumb-color );
100
+ border-radius : 12 px ;
101
+ border : 4 px solid #242724 ;
102
+ }
103
+
104
+ textarea {
105
+ &:focus::-webkit-scrollbar-thumb {
106
+ border : 4 px solid #333633 ;
107
+ }
108
+ }
109
+ </style >
0 commit comments