Commit 7bac3902 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Move CSS processing from TagRegistry to Web:Css.

Another responsibility that doesn't belong to TagRegistry.
parent 77a0b380
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ module JsDuck
      @html_renderers = []
      @html_renderers_sorted = false
      @member_types = []
      @css = []
      @tags = []

      instantiate_tags(TagLoader.new(load_paths).load_all)
@@ -62,10 +61,6 @@ module JsDuck
          @html_renderers << tag
        end

        if tag.css
          @css << tag.css
        end

        @tags << tag
      end
    end
@@ -119,11 +114,6 @@ module JsDuck
      @html_renderers
    end

    # Returns all the CSS gathered from @css attributes of tags.
    def css
      @css.join("\n")
    end

    #
    # Accessors for a single tag
    #
+6 −1
Original line number Diff line number Diff line
@@ -23,12 +23,17 @@ module JsDuck

      def all_css
        [
          TagRegistry.css,
          css_from_tags,
          Web::ClassIcons.css,
          Web::MemberIcons.css,
          @opts.css,
        ].join
      end

      # Returns all the CSS gathered from @css attributes of tags.
      def css_from_tags
        TagRegistry.tags.map(&:css).compact.join("\n")
      end
    end

  end