star tailwind css migration

This commit is contained in:
Echo 2025-06-18 19:16:37 -04:00
parent 93a778948f
commit c1366d00bf
No known key found for this signature in database
10 changed files with 46 additions and 18 deletions

3
.gitignore vendored
View file

@ -37,3 +37,6 @@
.env
.env.*.local
!.env.example
/app/assets/builds/*
!/app/assets/builds/.keep

View file

@ -133,3 +133,7 @@ gem "htmlcompressor", "~> 0.4.0"
gem "doorkeeper", "~> 5.8"
gem "autotuner", "~> 1.0"
gem "tailwindcss-ruby", "~> 4.1"
gem "tailwindcss-rails", "~> 4.2"

View file

@ -490,6 +490,15 @@ GEM
stimulus-rails (1.3.4)
railties (>= 6.0.0)
stringio (3.1.7)
tailwindcss-rails (4.2.3)
railties (>= 7.0.0)
tailwindcss-ruby (~> 4.0)
tailwindcss-ruby (4.1.10)
tailwindcss-ruby (4.1.10-aarch64-linux-gnu)
tailwindcss-ruby (4.1.10-aarch64-linux-musl)
tailwindcss-ruby (4.1.10-arm64-darwin)
tailwindcss-ruby (4.1.10-x86_64-linux-gnu)
tailwindcss-ruby (4.1.10-x86_64-linux-musl)
thor (1.3.2)
thruster (0.1.14)
thruster (0.1.14-aarch64-linux)
@ -587,6 +596,8 @@ DEPENDENCIES
sqlite3 (>= 2.1)
stackprof
stimulus-rails
tailwindcss-rails (~> 4.2)
tailwindcss-ruby (~> 4.1)
thruster
turbo-rails
tzinfo-data

2
Procfile.dev Normal file
View file

@ -0,0 +1,2 @@
web: bin/rails server -b 0.0.0.0
css: bin/rails tailwindcss:watch

View file

@ -40,7 +40,7 @@ $ docker compose run --service-ports web /bin/bash
app# bin/rails db:create db:schema:load db:seed
# Now start up the app:
app# bin/rails s -b 0.0.0.0
app# bin/dev
# This hosts the server on your computer w/ default port 3000
# Want to do other things?

0
app/assets/builds/.keep Normal file
View file

View file

@ -0,0 +1 @@
@import "tailwindcss";

View file

@ -134,6 +134,8 @@
<%# Includes all stylesheet files in app/assets/stylesheets %>
<%= stylesheet_link_tag :app %>
<%= javascript_importmap_tags %>
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
<%= stylesheet_link_tag "tailwind", "data-turbo-track": "reload" %>
<%= Sentry.get_trace_propagation_meta.html_safe %>
</head>

View file

@ -1,23 +1,12 @@
<div class="container">
<% if current_user&.trust_level == "red" %>
<div class="acct-convicted">
<% if current_user&.trust_level != "red" %>
<div class="text-red-400 bg-red-500/10 border border-red-500/20 rounded-lg p-4 text-center">
<strong>Hold up!</strong> Your account has been flagged for suspicious activity.<br>
This means that you are no longer included in the public leaderboards.<br>
If this was a mistake, please email <a href="mailto:echo@hackclub.com">echo@hackclub.com</a>.
If this was a mistake, please email <a href="mailto:echo@hackclub.com" class="underline text-red-600">echo@hackclub.com</a>.
</div>
<style>
.acct-convicted {
color: #ff6467;
background: color-mix(in oklab, rgb(251, 44, 54) 10%, transparent);
border: 2px solid color-mix(in oklab, rgb(251, 44, 54) 20%, transparent);
padding: 1em;
text-align: center;
border-radius: 8px;
margin-bottom: 1em;
}
</style>
<% end %>
<p class="super">
<p class="italic underline mt-2">
<%= @flavor_text %>
</p>
<h1 class="title">

20
bin/dev
View file

@ -1,2 +1,18 @@
#!/usr/bin/env ruby
exec "./bin/rails", "server", *ARGV
#!/usr/bin/env sh
if ! gem list foreman -i --silent; then
echo "Installing foreman..."
gem install foreman
fi
# Default to port 3000 if not specified
export PORT="${PORT:-3000}"
# Let the debug gem allow remote connections,
# but avoid loading until `debugger` is called
export RUBY_DEBUG_OPEN="true"
export RUBY_DEBUG_LAZY="true"
# Use Procfile.dev, ensure web process binds to 0.0.0.0
# (Procfile.dev should have: web: bin/rails server -b 0.0.0.0)
exec foreman start -f Procfile.dev "$@"