How do I create dynamic CSS in Rails?

后端 未结 6 1979
Happy的楠姐
Happy的楠姐 2020-12-13 16:21

what is the best/most efficient way of creating dynamic CSS with Rails. I am developing an admin area on a site, where I would like a user to be able to customize the style

6条回答
  •  鱼传尺愫
    2020-12-13 16:35

    Currently there is a lot of options to generate dynamic css in rails.

    You can use less css - is an extension to CSS with extra features.

    Gem Less css for rails provides integration for Rails projects using the Less stylesheet language in the asset pipeline.

    If you are using twitter bootstrap you may check this out less rails bootstrap.

    Also you can use one more CSS extension language Sass for generating CSS. Here is a Saas rails gem.

    Check out Dynamic CSS in Rails and Render Rails assets to string blog posts and article about Asset Pipeline

    Related SO questions:

    • Best way to handle dynamic css in a rails app
    • Dynamic CSS in Rails asset pipeline, compile on fly
    • Rails: change CSS property dynamically?

提交回复
热议问题