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.
概要
Tailwindとsassc-railsの非互換問題を解決。
背景
Tailwindが最新のcss構文を使っているが、SASSが最新のCSS構文を理解できていないため、gem 'sassc-rail'アンインストール必要;一方はrails-adminはまだsaccに依存しているので、sassc-rail保留必要
解決方法
css compressorはsassでなく、別のモダンなcompressorCSSOを使用
yarn add csso-cli
config/initializers/csso.rb
:csso
に設定config.assets.css_compressor = :csso
(production環境とtest環境両方必要)bundle exec rake assets:precompile
追加確認方法
Github Actionsの実行結果がグリンになっている
https://github.com/Kei5665/tokyo_senkyo_matching/actions/runs/3005081206
#45
参照:
rails/tailwindcss-rails#82 (comment)
rails/tailwindcss-rails#153 (comment)
railsadminteam/rails_admin#3450