Sha256: 88223868f77e114ddbcd6493b83286a877a42807bb2b0c15b18dc8fc506319b7

Contents?: true

Size: 773 Bytes

Versions: 4

Compression:

Stored size: 773 Bytes

Contents

module Sass::Tree
  # A static node representing an unproccessed Sass `@charset` directive.
  #
  # @see Sass::Tree
  class CharsetNode < Node
    # The name of the charset.
    #
    # @return [String]
    attr_accessor :name

    # @param name [String] see \{#name}
    def initialize(name)
      @name = name
      super()
    end

    # @see Node#invisible?
    def invisible?
      !Haml::Util.ruby1_8?
    end

    protected

    # @see Node#to_src
    def to_src(tabs, opts, fmt)
      "#{'  ' * tabs}@charset \"#{name}\"#{semi fmt}\n"
    end

    # Computes the CSS for the directive.
    #
    # @param tabs [Fixnum] The level of indentation for the CSS
    # @return [String] The resulting CSS
    def _to_s(tabs)
      "@charset \"#{name}\";"
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
radiant-1.0.0.rc1 vendor/plugins/haml/lib/sass/tree/charset_node.rb
haml-3.0.25 lib/sass/tree/charset_node.rb
haml-3.0.24 lib/sass/tree/charset_node.rb
haml-3.0.23 lib/sass/tree/charset_node.rb