WIP: Update Tailwindcss to 4 #58

Draft
atomaka wants to merge 4 commits from update-tailwind into main
12 changed files with 58 additions and 1523 deletions
Showing only changes of commit 8068bf2ad4 - Show all commits

View file

@ -1,19 +0,0 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
.msg-notice {
@apply bg-green-300 text-green-900;
}
.msg-alert {
@apply bg-red-300 text-red-900;
}
/*
@layer components {
.btn-primary {
@apply py-2 px-4 bg-blue-200;
}
}
*/

View file

@ -0,0 +1,39 @@
@import 'tailwindcss';
@plugin '@tailwindcss/forms';
@plugin '@tailwindcss/aspect-ratio';
@plugin '@tailwindcss/typography';
/*
The default border color has changed to `currentColor` in Tailwind CSS v4,
so we've added these compatibility styles to make sure everything still
looks the same as it did with Tailwind CSS v3.
If we ever want to remove these styles, we need to add an explicit border
color utility to any element that depends on these defaults.
*/
@layer base {
*,
::after,
::before,
::backdrop,
::file-selector-button {
border-color: var(--color-gray-200, currentColor);
}
}
.msg-notice {
@apply bg-green-300 text-green-900;
}
.msg-alert {
@apply bg-red-300 text-red-900;
}
/*
@layer components {
.btn-primary {
@apply py-2 px-4 bg-blue-200;
}
}
*/

View file

@ -12,12 +12,12 @@
<div class="my-5">
<%= form.label :description %>
<%= form.text_field :description, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
<%= form.text_field :description, class: "block shadow-sm rounded-md border border-gray-200 outline-hidden px-3 py-2 mt-2 w-full" %>
</div>
<div class="my-5">
<%= form.label :amount %>
<%= form.text_field :amount, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
<%= form.text_field :amount, class: "block shadow-sm rounded-md border border-gray-200 outline-hidden px-3 py-2 mt-2 w-full" %>
</div>
<div class="inline">

View file

@ -13,12 +13,12 @@
<div class="my-5">
<%= form.label :description %>
<%= form.text_field :description, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
<%= form.text_field :description, class: "block shadow-sm rounded-md border border-gray-200 outline-hidden px-3 py-2 mt-2 w-full" %>
</div>
<div class="my-5">
<%= form.label :payment %>
<%= form.text_field :payment, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
<%= form.text_field :payment, class: "block shadow-sm rounded-md border border-gray-200 outline-hidden px-3 py-2 mt-2 w-full" %>
</div>
<div class="my-5">
@ -27,7 +27,7 @@
form.select :period,
options_for_select(expense_periods, expense.period),
{},
class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full"
class: "block shadow-sm rounded-md border border-gray-200 outline-hidden px-3 py-2 mt-2 w-full"
%>
</div>

View file

@ -13,7 +13,7 @@
<div class="my-5">
<%= form.label :description %>
<%= form.text_field :description, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
<%= form.text_field :description, class: "block shadow-sm rounded-md border border-gray-200 outline-hidden px-3 py-2 mt-2 w-full" %>
</div>
<div class="my-5">
@ -23,7 +23,7 @@
<div class="my-5">
<%= form.label :amount %>
<%= form.text_field :amount, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
<%= form.text_field :amount, class: "block shadow-sm rounded-md border border-gray-200 outline-hidden px-3 py-2 mt-2 w-full" %>
</div>
<div class="my-5">
@ -32,7 +32,7 @@
form.select :member_id,
options_for_select(members, income.member_id),
{},
class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full"
class: "block shadow-sm rounded-md border border-gray-200 outline-hidden px-3 py-2 mt-2 w-full"
%>
</div>

View file

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
<%= stylesheet_link_tag "tailwind", "data-turbo-track": "reload" %>
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
<%= javascript_importmap_tags %>

View file

@ -13,7 +13,7 @@
<div class="my-5">
<%= form.label :name %>
<%= form.text_field :name, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
<%= form.text_field :name, class: "block shadow-sm rounded-md border border-gray-200 outline-hidden px-3 py-2 mt-2 w-full" %>
</div>
<div class="my-5">

View file

@ -13,12 +13,12 @@
<div class="my-5">
<%= form.label :email %>
<%= form.text_field :email, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
<%= form.text_field :email, class: "block shadow-sm rounded-md border border-gray-400 outline-hidden px-3 py-2 mt-2 w-full" %>
</div>
<div class="my-5">
<%= form.label :password %>
<%= form.password_field :password, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
<%= form.password_field :password, class: "block shadow-sm rounded-md border border-gray-400 outline-hidden px-3 py-2 mt-2 w-full" %>
</div>
<div class="inline">

View file

@ -13,17 +13,17 @@
<div class="my-5">
<%= form.label :email %>
<%= form.text_field :email, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
<%= form.text_field :email, class: "block shadow-sm rounded-md border border-gray-400 outline-hidden px-3 py-2 mt-2 w-full" %>
</div>
<div class="my-5">
<%= form.label :password %>
<%= form.password_field :password, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
<%= form.password_field :password, class: "block shadow-sm rounded-md border border-gray-400 outline-hidden px-3 py-2 mt-2 w-full" %>
</div>
<div class="my-5">
<%= form.label :password_confirmation %>
<%= form.password_field :password_confirmation, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
<%= form.password_field :password_confirmation, class: "block shadow-sm rounded-md border border-gray-400 outline-hidden px-3 py-2 mt-2 w-full" %>
</div>
<div class="inline">

View file

@ -2,10 +2,10 @@ const defaultTheme = require('tailwindcss/defaultTheme')
module.exports = {
content: [
'../public/*.html',
'../app/helpers/**/*.rb',
'../app/javascript/**/*.js',
'../app/views/**/*.{erb,haml,html,slim}'
'./public/*.html',
'./app/helpers/**/*.rb',
'./app/javascript/**/*.js',
'./app/views/**/*.{erb,haml,html,slim}'
],
theme: {
extend: {

1475
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,10 +0,0 @@
{
"name": "app_name",
"version": "1.0.0",
"dependencies": {
"tailwindcss": "^3.4.17",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.10",
"@tailwindcss/typography": "^0.5.16"
}
}