Sha256: 8b8d734686f8eeb2df03cde853e8d3557ef1def6a2572c6791306747954bc4fc
Contents?: true
Size: 472 Bytes
Versions: 2
Compression:
Stored size: 472 Bytes
Contents
require "css_parser" module Lookbook class InspectorPanel::Component < Lookbook::BaseComponent attr_reader :panel_styles, :panel_html def initialize(name:, **attrs) @name = name super(**attrs) end def id AttributeUtils.dom_id("panel", @name) end def before_render tpl = TemplateParser.new(content) @panel_styles = tpl.styles.map { |s| "##{id} #{s}" }.join("\n") @panel_html = tpl.content end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
lookbook-1.2.1 | app/components/lookbook/inspector_panel/component.rb |
lookbook-1.2.0 | app/components/lookbook/inspector_panel/component.rb |