Skip to content

Commit

Permalink
Add base form styles
Browse files Browse the repository at this point in the history
We're using the official Tailwind forms plugin now. These "base
form" styles will add onto what Tailwind gives us, the idea is that
these styles will get applied globally. If we need to add further
customizations (not globally) then they should be in another stylesheet
related to where it's being used, if that makes sense. Only global form
style changes should go in here.

For reference, following the pattern here:
tailwindlabs/tailwindcss-forms#33 (comment)

Refs: #3128
  • Loading branch information
shaun-technovation committed Dec 7, 2021
1 parent 2bf2e9c commit 652e1ab
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions app/javascript/stylesheets/base_forms.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@layer base {
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="time"],
input[type="search"],
input[type="tel"],
select,
select[multiple],
textarea {
@apply rounded border-gray-400 w-full focus:border-energetic-blue focus:ring-energetic-blue
}

input[type="checkbox"], input[type="radio"] {
@apply focus:ring-transparent text-energetic-blue mr-2
}

input[type="text"]:disabled, input[type="email"]:disabled {
@apply text-gray-400 bg-gray-100
}

input[type="checkbox"]:disabled, input[type="radio"]:disabled {
@apply text-gray-400
}
}

0 comments on commit 652e1ab

Please sign in to comment.