class Sass::Supports::Negation - sass-3.2.19 Documentation

# class Sass::Supports::Negation

A negation condition (`not CONDITION`).

### Attributes

condition[RW]

The condition being negated.

@return [Sass::Supports::Condition]

### Public Class Methods

new(condition) click to toggle source

    # File lib/sass/supports.rb, line 100
    def initialize(condition)
      @condition = condition
    end

### Public Instance Methods

deep_copy() click to toggle source

    # File lib/sass/supports.rb, line 116
    def deep_copy
      copy = dup
      copy.condition = condition.deep_copy
      copy
    end

options=(options) click to toggle source

    # File lib/sass/supports.rb, line 122
    def options=(options)
      condition.options = options
    end

perform(env) click to toggle source

    # File lib/sass/supports.rb, line 104
    def perform(env)
      @condition.perform(env)
    end

to_css() click to toggle source

    # File lib/sass/supports.rb, line 108
    def to_css
      "not #{parens @condition.to_css}"
    end

to_src(options) click to toggle source

    # File lib/sass/supports.rb, line 112
    def to_src(options)
      "not #{parens @condition.to_src(options)}"
    end

### Private Instance Methods

parens(str) click to toggle source

    # File lib/sass/supports.rb, line 128
    def parens(str)
      return "(#{str})" if @condition.is_a?(Negation) || @condition.is_a?(Operator)
      return str
    end