Class: FoggyMirror::CSS

Inherits:
Exporter show all
Defined in:
lib/foggy-mirror/exporters/css.rb

Instance Method Summary collapse

Methods inherited from Exporter

#initialize

Constructor Details

This class inherits a constructor from FoggyMirror::Exporter

Instance Method Details

#render(hash: false) ⇒ Object

If hash is true it returns a Ruby Hash with the CSS properties instead of a CSS-ready string



8
9
10
11
12
13
14
15
16
17
# File 'lib/foggy-mirror/exporters/css.rb', line 8

def render(hash: false)
  if hash
    return {
      'background-color' => base_color,
      'background-image' => radial_gradients.join(', ')
    }
  end

  render(hash: true).map { |k, v| "#{k}: #{v}" }.join(";\n") + ';'
end