Repository navigation
Conversation
- tailwindcss-rails ~> 4.6, CSS-first config in app/assets/tailwind/application.css - run the upstream v4 template migration for renamed utilities - safelist runtime-composed colour utilities (v4 ignores Ruby comments) - keep the Inter font by self-hosting its Latin subsets - replace removed v3-only plugins and opacity utilities
celuchmarek
reviewed
Oct 16, 2026
celuchmarek
approved these changes
Oct 16, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
Tailwind je na v3.3 (gem
tailwindcss-rails2.3.0). Tailwind v4 je vonku už dlho a v3 už nedostáva nové utility; dve používané pluginy (@tailwindcss/aspect-ratio,@tailwindcss/container-queries) sú vo v4 súčasťou jadra, takže ich držíme zbytočne. Navyše font Inter sa vozil cezinter-font.cssz gemu 2.x, ktorý v 4.x už neexistuje — bez vyriešenia by appka po upgrade prišla o Inter a zmenil by sa font celej aplikácie.Solution
Upgrade na Tailwind v4 (gem
tailwindcss-rails ~> 4.6, CLI 4.3.3) a prechod na CSS-first konfiguráciu:app/assets/tailwind/application.csss@source/@theme/@plugin,config/tailwind.config.jszmazaný. Renamy tried v šablónach som nespravil ručne, ale oficiálnym nástrojomnpx @tailwindcss/upgrade@4.1.4(plusbin/rails tailwindcss:upgrade):flex-shrink-*→shrink-*,shadow→shadow-sm,outline-none→outline-hidden,rounded→rounded-sm,bg-opacity-*→/75,ring-opacity-5→ring-black/5a pod.Dve veci, ktoré nástroj nevyrieši a sú v tomto PR kľúčové:
text-#{color}-600,bg-#{color}-50,ring-#{color}-500/10), takže ich safelistujem cez@source inline(...)vapplication.css. Bez toho by štítky a boxy stratili farby.app/assets/fonts/, latin + latin-ext woff2 + OFL licencia vvendor/fonts/) ainter-fontje zmazaný z oboch layoutov, keďže ho gem 4.x už nedodáva.Pluginy
@tailwindcss/aspect-ratioa@tailwindcss/container-queriesvyhodené (vo v4 sú core),formsatypographybumpnuté na v4-kompatibilné. Zámerne bez dizajnovej zmeny — renami majú zachovať pôvodný vzhľad.Overenie:
bin/rails test:system(reálny headless Chrome) — hlavná frontend gate.test/system/frontend_assets_test.rbkontroluje vypočítané štýly premenovaných utilít (rounded-sm,shadow-xs,shrink-0,ring-black/5), že sa Inter naozaj načíta vrátane slovenskej diakritiky, a že mobilný sidebar sa dá otvoriť/zavrieť.bin/rails test,bin/rails test:integrationaSECRET_KEY_BASE=… RAILS_ENV=production bin/rails assets:precompile.Demo
Ide o vizuálnu zmenu konfigurácie, nie dizajnu — cieľom je, aby appka vyzerala rovnako ako predtým (vrátane Inter fontu). Overené lokálnym behom appky: zoznam vlákien so sidebarom a farebnými štítkami, detail vlákna a prihláška.
Testy na tejto vetve (Rails 7.1.6, Ruby 3.3.12):
bin/rails testbin/rails test:systembin/rails test:integrationassets:precompileScreenshoty z lokálneho behu doplním do popisu (zoznam vlákien + detail vlákna).