tailwindcss typography "SassC::SyntaxError: Error: unterminated attribute selector for type"

tailwindcss typography "SassC::SyntaxError: Error: unterminated attribute selector for type"

我升级了 tailwindcss-rails gem 并在为生产编译资产时遇到此错误:

bundle exec rails assets:precompile
rails aborted!
SassC::SyntaxError: Error: unterminated attribute selector for type
        on line 1009:16 of stdin
>> .prose ol[type="A" s] {

   ---------------^
/home/circleci/project/vendor/bundle/ruby/3.0.0/bundler/gems/sassc-ruby-4fce2b635ca5/lib/sassc/engine.rb:50:in `render'
/home/circleci/project/vendor/bundle/ruby/3.0.0/gems/sassc-rails-2.1.2/lib/sassc/rails/compressor.rb:29:in `call'
/home/circleci/project/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/sass_compressor.rb:30:in `call'

问题是 libsass / sassc 不支持 CSS 规则的新语法。

所以我最终分叉了 tailwindcss-rails 并删除了额外的内容。

它在 GitHub:https://github.com/dorianmariefr/tailwindcss-rails/tree/minimal

您可以在 Gemfile:

中像这样使用它
gem "tailwindcss-rails",
    github: "dorianmariefr/tailwindcss-rails",
    branch: "minimal"

我一直有SassC::SyntaxError。在 production.rb 中添加以下行解决了问题:

config.assets.css_compressor = nil

它将阻止 sassc-rails 将 sass 设置为压缩器。

我找到了答案