You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just trying out this form library for the first time with SvelteKit. So far so good. I wanted to share a pattern for adding an invalid field state using Tailwind classes for anyone looking:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Just trying out this form library for the first time with SvelteKit. So far so good. I wanted to share a pattern for adding an invalid field state using Tailwind classes for anyone looking:
Use @apply directive to create a custom utility such as
validated
:Add the
validated
class to your markup so Tailwind picks it up during stylesheet generation:Above leverages
use:style
and the required validator for add visual and non-visual queues something is wrong when the field is in aninvalid
state.Beta Was this translation helpful? Give feedback.
All reactions