From 96572b57d050984ff5d2a891741eaeb647bb3dc5 Mon Sep 17 00:00:00 2001 From: Bell Isabell Date: Tue, 3 Mar 2026 18:23:17 -0800 Subject: [PATCH 1/2] Fix FOUT by preloading Inter font and using font-display: optional The Inter var font was loaded with font-display: swap, causing a flash of unstyled text (wrong font) on page load, especially on the homepage. Changes: - Preload the main Inter latin roman woff2 file - Override font-display to 'optional' for the primary latin subset, which eliminates the swap flash (uses fallback silently if font isn't cached, then caches for next load) --- Gemfile.bak | 103 +++++++++++++++++++++++++ app/views/layouts/application.html.erb | 2 + 2 files changed, 105 insertions(+) create mode 100644 Gemfile.bak diff --git a/Gemfile.bak b/Gemfile.bak new file mode 100644 index 0000000..6c41bf6 --- /dev/null +++ b/Gemfile.bak @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' +git_source(:github) { |repo| "https://github.com/#{repo}.git" } + +ruby '3.2.2' + +gem 'ahoy_email', '~> 2.1', '>= 2.1.3' +gem 'ahoy_matey' +gem 'audited', '~> 5.0', '>= 5.0.2' +gem 'aws-sdk-s3' +gem 'bcrypt', '~> 3.1.7' +gem 'blazer' +gem 'clearbit', '~> 0.3.3' +gem 'dalli', '~> 3.2' +gem 'devise', '~> 4.9' +gem 'dotenv-rails', '~> 2.8' +gem 'friendly_id', '~> 5.4', '>= 5.4.2' +gem 'geocoder' +gem 'grover', '~> 1.1' +gem 'honeypot-captcha', '~> 1.0' +gem 'httparty', '~> 0.21.0' +gem 'image_processing', '~> 1.2' +gem 'importmap-rails', '~> 2' +gem 'inline_svg', '~> 1.8' +gem 'jbuilder' +gem 'local_time', '~> 2.1' +gem 'mailkick', '~> 1.0' +gem 'maxminddb' +gem 'meta-tags', '~> 2.18' +gem 'name_of_person', '~> 1.1' +gem 'omniauth', '~> 2.1' +gem 'omniauth-google-oauth2', '~> 1.1' +gem 'omniauth-rails_csrf_protection', '~> 1.0' +gem 'google-id-token', '~> 1.4' +gem 'pay', '~> 5.0' +gem 'pg', '~> 1.1' +gem 'possessive', '~> 1.0' +gem 'aws-sdk-rails', '~> 5' +gem 'aws-actionmailer-ses', '~> 1' +gem 'premailer-rails', '~> 1.11' +gem 'puma', '~> 6.4' +gem 'rails', '~> 7.1' +gem 'rails_heroicon', '~> 2.1.0' +gem 'recaptcha' +gem 'redis', '~> 4.0' +gem 'ruby-vips', '~> 2.1' +gem 'sitemap_generator', '~> 6.3' +gem 'sprockets-rails' +gem 'stimulus-rails', '~> 1.2.1' +gem 'stripe', '~> 7.0' +gem 'tailwindcss-rails', '2.0.25' +gem 'truemail', '~> 2.7' +gem 'turbo-rails', '1.4.0' +gem 'twitter', '~> 7.0' +gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] +gem 'wcag_color_contrast', '~> 0.1.0' +gem 'whois', '~> 5.1' +gem 'whois-parser', '~> 2.0' +gem 'wicked', '~> 1.4' +gem "solid_cache", "~> 0.6.0" +gem "solid_queue", "~> 0.3.2" +gem "mission_control-jobs", "~> 0.2.1" +gem "health_check", "~> 3.1" +gem "pghero" + +group :development, :test, :preview do + # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem + gem 'brakeman', '~> 5.0' + gem 'byebug', platforms: %i[mri mingw x64_mingw] + gem 'debug', platforms: %i[mri mingw x64_mingw] + gem 'faker', '~> 2.19' + gem 'rubocop', '~> 1.37' + gem 'rubocop-faker', '~> 0.2.0' + gem 'rubocop-rails', '~> 2.17.2' + gem 'solargraph', '~> 0.44.2' +end + +group :development do + # Use console on exceptions pages [https://github.com/rails/web-console] + gem 'web-console' + + # Email development tools + gem 'letter_opener' + gem 'letter_opener_web' + + # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler] + # gem "rack-mini-profiler" + + # Speed up commands on slow machines / big apps [https://github.com/rails/spring] + # gem "spring" +end + +group :test do + # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] + gem 'capybara' + gem 'selenium-webdriver' + gem 'webdrivers' +end + +group :production do + gem "cloudflare-rails" +end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 95a6378..3884f79 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -5,6 +5,8 @@ <%= csrf_meta_tags %> <%= csp_meta_tag %> <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %> + <%= preload_link_tag asset_path("Inter-roman.latin.var.woff2"), as: "font", type: "font/woff2", crossorigin: "anonymous" %> + <%= stylesheet_link_tag "application.tailwind", "data-turbo-track": "reload" %> <%# https://github.com/rails/importmap-rails/issues/65 %> From d9d80755097b5af4cd034979df6211ebaa2c131d Mon Sep 17 00:00:00 2001 From: Bell Isabell Date: Tue, 3 Mar 2026 18:23:23 -0800 Subject: [PATCH 2/2] Remove stray Gemfile.bak --- Gemfile.bak | 103 ---------------------------------------------------- 1 file changed, 103 deletions(-) delete mode 100644 Gemfile.bak diff --git a/Gemfile.bak b/Gemfile.bak deleted file mode 100644 index 6c41bf6..0000000 --- a/Gemfile.bak +++ /dev/null @@ -1,103 +0,0 @@ -# frozen_string_literal: true - -source 'https://rubygems.org' -git_source(:github) { |repo| "https://github.com/#{repo}.git" } - -ruby '3.2.2' - -gem 'ahoy_email', '~> 2.1', '>= 2.1.3' -gem 'ahoy_matey' -gem 'audited', '~> 5.0', '>= 5.0.2' -gem 'aws-sdk-s3' -gem 'bcrypt', '~> 3.1.7' -gem 'blazer' -gem 'clearbit', '~> 0.3.3' -gem 'dalli', '~> 3.2' -gem 'devise', '~> 4.9' -gem 'dotenv-rails', '~> 2.8' -gem 'friendly_id', '~> 5.4', '>= 5.4.2' -gem 'geocoder' -gem 'grover', '~> 1.1' -gem 'honeypot-captcha', '~> 1.0' -gem 'httparty', '~> 0.21.0' -gem 'image_processing', '~> 1.2' -gem 'importmap-rails', '~> 2' -gem 'inline_svg', '~> 1.8' -gem 'jbuilder' -gem 'local_time', '~> 2.1' -gem 'mailkick', '~> 1.0' -gem 'maxminddb' -gem 'meta-tags', '~> 2.18' -gem 'name_of_person', '~> 1.1' -gem 'omniauth', '~> 2.1' -gem 'omniauth-google-oauth2', '~> 1.1' -gem 'omniauth-rails_csrf_protection', '~> 1.0' -gem 'google-id-token', '~> 1.4' -gem 'pay', '~> 5.0' -gem 'pg', '~> 1.1' -gem 'possessive', '~> 1.0' -gem 'aws-sdk-rails', '~> 5' -gem 'aws-actionmailer-ses', '~> 1' -gem 'premailer-rails', '~> 1.11' -gem 'puma', '~> 6.4' -gem 'rails', '~> 7.1' -gem 'rails_heroicon', '~> 2.1.0' -gem 'recaptcha' -gem 'redis', '~> 4.0' -gem 'ruby-vips', '~> 2.1' -gem 'sitemap_generator', '~> 6.3' -gem 'sprockets-rails' -gem 'stimulus-rails', '~> 1.2.1' -gem 'stripe', '~> 7.0' -gem 'tailwindcss-rails', '2.0.25' -gem 'truemail', '~> 2.7' -gem 'turbo-rails', '1.4.0' -gem 'twitter', '~> 7.0' -gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] -gem 'wcag_color_contrast', '~> 0.1.0' -gem 'whois', '~> 5.1' -gem 'whois-parser', '~> 2.0' -gem 'wicked', '~> 1.4' -gem "solid_cache", "~> 0.6.0" -gem "solid_queue", "~> 0.3.2" -gem "mission_control-jobs", "~> 0.2.1" -gem "health_check", "~> 3.1" -gem "pghero" - -group :development, :test, :preview do - # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem - gem 'brakeman', '~> 5.0' - gem 'byebug', platforms: %i[mri mingw x64_mingw] - gem 'debug', platforms: %i[mri mingw x64_mingw] - gem 'faker', '~> 2.19' - gem 'rubocop', '~> 1.37' - gem 'rubocop-faker', '~> 0.2.0' - gem 'rubocop-rails', '~> 2.17.2' - gem 'solargraph', '~> 0.44.2' -end - -group :development do - # Use console on exceptions pages [https://github.com/rails/web-console] - gem 'web-console' - - # Email development tools - gem 'letter_opener' - gem 'letter_opener_web' - - # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler] - # gem "rack-mini-profiler" - - # Speed up commands on slow machines / big apps [https://github.com/rails/spring] - # gem "spring" -end - -group :test do - # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] - gem 'capybara' - gem 'selenium-webdriver' - gem 'webdrivers' -end - -group :production do - gem "cloudflare-rails" -end