Module: Haml::Filters::Css

Includes:
Base
Defined in:
lib/haml/filters.rb

Overview

Surrounds the filtered text with <style> and CDATA tags. Useful for including inline CSS.

Instance Method Summary collapse

Methods included from Base

#compile, included, #internal_compile, #lazy_require, #render

Instance Method Details

#render_with_options(text, options)



219
220
221
222
223
224
225
226
227
# File 'lib/haml/filters.rb', line 219

def render_with_options(text, options)
  <<END
<style type=#{options[:attr_wrapper]}text/css#{options[:attr_wrapper]}>
  /*<![CDATA[*/
    #{text.rstrip.gsub("\n", "\n    ")}
  /*]]>*/
</style>
END
end