Sha256: cc17bc7e72b2069ca915819b8c4c191b1aec632c7a9bf9d492c51bd7f21fa986

Contents?: true

Size: 928 Bytes

Versions: 2

Compression:

Stored size: 928 Bytes

Contents

module LucidApp
  module Context
    def self.create_application_context
      nano_css = `null`
      css_server = `null`
      css_server = `document.getElementById('css-server-side')` unless on_ssr?
      %x{
        let og = Opal.global;
        nano_css = (css_server) ? og.NanoCSS.create({ sh: css_server }) : og.NanoCSS.create();
        og.NanoCSSAddOns.rule(nano_css);
        og.NanoCSSAddOns.sheet(nano_css);
        og.NanoCSSAddOns.nesting(nano_css);
        og.NanoCSSAddOns.hydrate(nano_css);
        og.NanoCSSAddOns.unitless(nano_css);
        og.NanoCSSAddOns.global(nano_css);
        og.NanoCSSAddOns.keyframes(nano_css);
        og.NanoCSSAddOns.fade_in(nano_css);
        og.NanoCSSAddOns.fade_out(nano_css);
        og.NanoCSSInstance = nano_css;
      }
      Preact.create_context('LucidApplicationContext', { iso_store: Isomorfeus.store, nano_css: nano_css })
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
isomorfeus-preact-10.5.1 lib/lucid_app/context.rb
isomorfeus-preact-10.5.0 lib/lucid_app/context.rb