Module: Compass::BrowserSupport

### Home Classes Methods

### In Files

- lib/compass/browser_support.rb

### Methods

- #add_support
- #has_aspect?
- #remove_support
- #supports?

### Class/Module Index

Quicksearch

- Compass
- Compass::BrowserSupport
- Compass::Configuration
- Compass::Configuration::Adapters
- Compass::Configuration::Data
- Compass::Configuration::Defaults
- Compass::Configuration::Inheritance
- Compass::Configuration::Inheritance::ClassMethods
- Compass::Configuration::Inheritance::ClassMethods::ArrayProxy
- Compass::Configuration::Inheritance::InstanceMethods
- Compass::Configuration::Paths
- Compass::Configuration::Watch
- Compass::Core
- Compass::Core::CanIUse
- Compass::Core::SassExtensions
- Compass::Core::SassExtensions::Functions
- Compass::Core::SassExtensions::Functions::Colors
- Compass::Core::SassExtensions::Functions::Configuration
- Compass::Core::SassExtensions::Functions::Constants
- Compass::Core::SassExtensions::Functions::CrossBrowserSupport
- Compass::Core::SassExtensions::Functions::CrossBrowserSupport::CSS2FallbackValue
- Compass::Core::SassExtensions::Functions::Display
- Compass::Core::SassExtensions::Functions::Enumerate
- Compass::Core::SassExtensions::Functions::Env
- Compass::Core::SassExtensions::Functions::Files
- Compass::Core::SassExtensions::Functions::FontFiles
- Compass::Core::SassExtensions::Functions::GradientSupport
- Compass::Core::SassExtensions::Functions::GradientSupport::Assertions
- Compass::Core::SassExtensions::Functions::GradientSupport::CSS3AngleToSVGConverter
- Compass::Core::SassExtensions::Functions::GradientSupport::ColorStop
- Compass::Core::SassExtensions::Functions::GradientSupport::Functions
- Compass::Core::SassExtensions::Functions::GradientSupport::Gradient
- Compass::Core::SassExtensions::Functions::GradientSupport::Gradient::ClassMethods
- Compass::Core::SassExtensions::Functions::GradientSupport::LinearGradient
- Compass::Core::SassExtensions::Functions::GradientSupport::RadialGradient
- Compass::Core::SassExtensions::Functions::ImageSize
- Compass::Core::SassExtensions::Functions::ImageSize::ImageProperties
- Compass::Core::SassExtensions::Functions::ImageSize::JPEG
- Compass::Core::SassExtensions::Functions::InlineImage
- Compass::Core::SassExtensions::Functions::Lists
- Compass::Core::SassExtensions::Functions::Math
- Compass::Core::SassExtensions::Functions::SassDeclarationHelper
- Compass::Core::SassExtensions::Functions::Selectors
- Compass::Core::SassExtensions::Functions::Urls
- Compass::Core::SassExtensions::Functions::Urls::FontUrl
- Compass::Core::SassExtensions::Functions::Urls::GeneratedImageUrl
- Compass::Core::SassExtensions::Functions::Urls::ImageUrl
- Compass::Core::SassExtensions::Functions::Urls::StylesheetUrl
- Compass::Error
- Compass::Frameworks
- Compass::Frameworks::Framework
- Compass::HasDeprecatedConstantsFromCore
- Compass::SassExtensions
- Compass::SassExtensions::Functions
- Compass::Util
- Sass
- Sass::Script
- Sass::Script::CrossBrowserFunctionCall
- Sass::Script::Funcall
- Sass::Script::Functions
- Sass::Script::Functions::EvaluationContext
- Sass::Script::HasSimpleCrossBrowserFunctionSupport
- Sass::Script::List
- Sass::Script::Value
- Sass::Script::Value::ArgList
- Sass::Script::Value::Base
- Sass::Script::Value::List
- Sass::Script::Value::Map
- Sass::Tree
- Sass::Tree::Node

No matching classes.

# Compass::BrowserSupport

### Constants

ASPECTS
SIMPLE_FUNCTIONS

### Public Instance Methods

add_support(function, *aspects) click to toggle source

Adds support for one or more aspects for the given simple function Example:

    Compass::BrowserSupport.add_support("image", "moz", "webkit")
    # => Adds support for moz and webkit to the image() function.

This function can be called one or more times in a compass configuration file in order to add support for new, simple browser functions without waiting for a new compass release.

    # File lib/compass/browser_support.rb, line 23
    def add_support(function, *aspects)
      aspects.each do |aspect|
        unless ASPECTS.include?(aspect)
          Compass::Util.compass_warn "Unknown support aspect: #{aspect}"
          next
        end
        unless supports?(function, aspect)
          SIMPLE_FUNCTIONS[function.to_s] ||= []
          SIMPLE_FUNCTIONS[function.to_s] << aspect.to_s
        end
      end
    end

has_aspect?(function) click to toggle source

    # File lib/compass/browser_support.rb, line 59
    def has_aspect?(function)
      SIMPLE_FUNCTIONS.has_key?(function.to_s) && SIMPLE_FUNCTIONS[function.to_s].size > 0
    end

remove_support(function, *aspects) click to toggle source

Removes support for one or more aspects for the given simple function Example:

    Compass::BrowserSupport.remove_support("image", "o", "ms")
    # => Adds support for moz and webkit to the image() function.

This function can be called one or more times in a compass configuration file in order to remove support for simple functions that no longer need to a prefix without waiting for a new compass release.

    # File lib/compass/browser_support.rb, line 45
    def remove_support(function, *aspects)
      aspects.each do |aspect|
        unless ASPECTS.include?(aspect)
          Compass::Util.compass_warn "Unknown support aspect: #{aspect}"
          next
        end
        SIMPLE_FUNCTIONS[function.to_s].reject!{|a| a == aspect.to_s}
      end
    end

supports?(function, aspect) click to toggle source

    # File lib/compass/browser_support.rb, line 55
    def supports?(function, aspect)
      SIMPLE_FUNCTIONS.has_key?(function.to_s) && SIMPLE_FUNCTIONS[function.to_s].include?(aspect.to_s)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.