class Sass::Tree::CssImportNode - sass-3.4.14 Documentation

# class Sass::Tree::CssImportNode

A node representing an `@import` rule that's importing plain CSS.

@see Sass::Tree

### Attributes

query[RW]

The media query for this rule, interspersed with {Sass::Script::Tree::Node}s representing `#{}`-interpolation. Any adjacent strings will be merged together.

@return [Array<String, Sass::Script::Tree::Node>]

resolved_query[RW]

The media query for this rule, without any unresolved interpolation. It's only set once {Tree::Visitors::Perform} has been run.

@return [Sass::Media::QueryList]

resolved_uri[RW]

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]

uri[RW]

The URI being imported, either as a plain string or an interpolated script string.

@return [String, Sass::Script::Tree::Node]

### Public Class Methods

new(uri, query = []) click to toggle source

@param uri [String, Sass::Script::Tree::Node] See {#uri} @param query [Array<String, Sass::Script::Tree::Node>] See {#query}

Calls superclass method

    # File lib/sass/tree/css_import_node.rb, line 33
    def initialize(uri, query = [])
      @uri = uri
      @query = query
      super('')
    end

resolved(uri) click to toggle source

@param uri [String] See {#resolved_uri} @return [CssImportNode]

    # File lib/sass/tree/css_import_node.rb, line 41
    def self.resolved(uri)
      node = new(uri)
      node.resolved_uri = uri
      node
    end

### Public Instance Methods

resolved_value() click to toggle source

@see Sass::Tree::DirectiveNode#resolved_value

    # File lib/sass/tree/css_import_node.rb, line 51
    def resolved_value
      @resolved_value ||=
        begin
          str = "@import #{resolved_uri}"
          str << " #{resolved_query.to_css}" if resolved_query
          str
        end
    end

value() click to toggle source

@see Sass::Tree::DirectiveNode#value

    # File lib/sass/tree/css_import_node.rb, line 48
    def value; raise NotImplementedError; end