Sha256: cdabb9a17f3ffc05ce7d221350ef354ca3f7d87d02337909869eee34b2a8e057

Contents?: true

Size: 700 Bytes

Versions: 38

Compression:

Stored size: 700 Bytes

Contents

module LucidApp
  module Api
    def self.included(base)
      base.instance_exec do
        def theme(theme_hash = nil, &block)
          theme_hash = block.call if block_given?
          if theme_hash
            %x{
              let css;
              if (typeof theme_hash.$to_n === 'function') { css = theme_hash.$to_n(); }
              else { css = theme_hash; }
              let nano_styles = Opal.global.NanoCSSInstance.sheet(css, "LucidAppTheme");
              base.css_theme = #{::LucidComponent::StylesWrapper.new(`nano_styles`)};
            }
          end
          `base.css_theme`
        end
        alias_method :theme=, :theme
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
isomorfeus-preact-10.6.25 lib/isomorfeus_preact/lucid_app/api.rb
isomorfeus-preact-10.6.24 lib/isomorfeus_preact/lucid_app/api.rb
isomorfeus-preact-10.6.23 lib/isomorfeus_preact/lucid_app/api.rb
isomorfeus-preact-10.6.22 lib/isomorfeus_preact/lucid_app/api.rb
isomorfeus-preact-10.6.21 lib/isomorfeus_preact/lucid_app/api.rb
isomorfeus-preact-10.6.20 lib/isomorfeus_preact/lucid_app/api.rb
isomorfeus-preact-10.6.19 lib/isomorfeus_preact/lucid_app/api.rb
isomorfeus-preact-10.6.18 lib/isomorfeus_preact/lucid_app/api.rb
isomorfeus-preact-10.6.17 lib/isomorfeus_preact/lucid_app/api.rb
isomorfeus-preact-10.6.16 lib/isomorfeus_preact/lucid_app/api.rb
isomorfeus-preact-10.6.15 lib/isomorfeus_preact/lucid_app/api.rb
isomorfeus-preact-10.6.14 lib/isomorfeus_preact/lucid_app/api.rb
isomorfeus-preact-10.6.13 lib/isomorfeus_preact/lucid_app/api.rb
isomorfeus-preact-10.6.12 lib/isomorfeus_preact/lucid_app/api.rb
isomorfeus-preact-10.6.11 lib/isomorfeus_preact/lucid_app/api.rb
isomorfeus-preact-10.6.10 lib/isomorfeus_preact/lucid_app/api.rb
isomorfeus-preact-10.6.9 lib/isomorfeus_preact/lucid_app/api.rb
isomorfeus-preact-10.6.8 lib/isomorfeus_preact/lucid_app/api.rb
isomorfeus-preact-10.6.7 lib/isomorfeus_preact/lucid_app/api.rb
isomorfeus-preact-10.6.6 lib/isomorfeus_preact/lucid_app/api.rb