Sha256: 0d860221e1200c5a94dc0459dcdba5ee3388b712e756e1cef153b89c72da7e71

Contents?: true

Size: 1.7 KB

Versions: 79

Compression:

Stored size: 1.7 KB

Contents

module Sass::Tree
  # A node representing an `@import` rule that's importing plain CSS.
  #
  # @see Sass::Tree
  class CssImportNode < DirectiveNode
    # The URI being imported, either as a plain string or an interpolated
    # script string.
    #
    # @return [String, Sass::Script::Node]
    attr_accessor :uri

    # The text of the URI being imported after any interpolated SassScript has
    # been resolved. Only set once \{Tree::Visitors::Perform} has been run.
    #
    # @return [String]
    attr_accessor :resolved_uri

    # The media query for this rule, interspersed with {Sass::Script::Node}s
    # representing `#{}`-interpolation. Any adjacent strings will be merged
    # together.
    #
    # @return [Array<String, Sass::Script::Node>]
    attr_accessor :query

    # The media query for this rule, without any unresolved interpolation. It's
    # only set once {Tree::Node#perform} has been called.
    #
    # @return [Sass::Media::QueryList]
    attr_accessor :resolved_query

    # @param uri [String, Sass::Script::Node] See \{#uri}
    # @param query [Array<String, Sass::Script::Node>] See \{#query}
    def initialize(uri, query = nil)
      @uri = uri
      @query = query
      super('')
    end

    # @param uri [String] See \{#resolved_uri}
    # @return [CssImportNode]
    def self.resolved(uri)
      node = new(uri)
      node.resolved_uri = uri
      node
    end

    # @see DirectiveNode#value
    def value; raise NotImplementedError; end

    # @see DirectiveNode#resolved_value
    def resolved_value
      @resolved_value ||=
        begin
          str = "@import #{resolved_uri}"
          str << " #{resolved_query.to_css}" if resolved_query
          str
        end
    end
  end
end

Version data entries

79 entries across 74 versions & 11 rubygems

Version Path
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/sass-3.2.19/lib/sass/tree/css_import_node.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/sass-3.2.19/lib/sass/tree/css_import_node.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/sass-3.2.5/lib/sass/tree/css_import_node.rb
xass-0.1.0 lib/sass/tree/css_import_node.rb
oreorenasass-3.4.14 lib/sass/tree/css_import_node.rb
oreorenasass-3.4.13 lib/sass/tree/css_import_node.rb
oreorenasass-3.4.12 lib/sass/tree/css_import_node.rb
oreorenasass-3.4.11 lib/sass/tree/css_import_node.rb
oreorenasass-3.4.9 lib/sass/tree/css_import_node.rb
oreorenasass-3.4.7 lib/sass/tree/css_import_node.rb
oreorenasass-3.4.5 lib/sass/tree/css_import_node.rb
sadui-0.0.4 vendor/bundle/ruby/2.0.0/gems/sass-3.2.14/lib/sass/tree/css_import_node.rb
sadui-0.0.4 vendor/bundle/ruby/2.1.0/gems/sass-3.2.14/lib/sass/tree/css_import_node.rb
sass-3.2.19 lib/sass/tree/css_import_node.rb
sass-3.2.18 lib/sass/tree/css_import_node.rb
sass-3.2.17 lib/sass/tree/css_import_node.rb
sass-3.2.16 lib/sass/tree/css_import_node.rb
sass-3.2.15 lib/sass/tree/css_import_node.rb
sass-3.2.14 lib/sass/tree/css_import_node.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/sass-3.2.13/lib/sass/tree/css_import_node.rb