How do I override Materialize CSS in Ruby on Rails?

假装没事ソ 提交于 2019-12-02 09:55:11

Since it's just a single override, you could add a new .css file to assets (or wherever you're storing static stuff), with a !important class:

img.darker {
  filter: brightness(50%) !important;
}

Then import it at the top of your template:

<%= stylesheet_link_tag "/path/to/css.file" %>

And add the class to your image tag:

<img src="/my/img.png" class="darker">  

Alternatively you could just style the image tags individually:

<img src="/my/img.png" style="filter:brightness(50%)">
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!