Skip to content

Commit

Permalink
feat: adds loading spinner to submit button
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-boyd committed Nov 10, 2023
1 parent 496461f commit 188db8e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/inputs/form.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export default {
// inherits family:text classes
form: `group/form`,
input: `
focus:[&::-webkit-datetime-edit-month-field]:bg-$accentColor-100
focus:[&::-webkit-datetime-edit-year-field]:bg-$accentColor-100
Expand Down
14 changes: 14 additions & 0 deletions src/inputs/submit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ export default {
dark:disabled:bg-$colorTemperature-500
dark:disabled:text-$colorTemperature-200
dark:ring-offset-$accentColor-$baseColorShade(-1,*)
${"" /* Styles for loading state — before element */}
group-data-[loading=true]/form:before:content['']
group-data-[loading=true]/form:before:block
group-data-[loading=true]/form:before:animate-spin
group-data-[loading=true]/form:before:w-5
group-data-[loading=true]/form:before:h-5
group-data-[loading=true]/form:before:rounded-full
group-data-[loading=true]/form:before:mr-$spacing(2,*)
group-data-[loading=true]/form:before:-ml-$spacing(-1,*)
group-data-[loading=true]/form:before:border-2
group-data-[loading=true]/form:before:border-solid
group-data-[loading=true]/form:before:border-white
group-data-[loading=true]/form:before:border-r-transparent
`,
prefixIcon: `
text-$colorTemperature-100
Expand Down

0 comments on commit 188db8e

Please sign in to comment.