diff --git a/lib/haml/util.rb b/lib/haml/util.rb
index <HASH>..<HASH> 100644
--- a/lib/haml/util.rb
+++ b/lib/haml/util.rb
@@ -292,6 +292,34 @@ module Haml
       warn(msg)
     end
 
+    # Try loading Sass. If the `sass` gem isn't installed,
+    # print a warning and load from the vendored gem.
+    #
+    # @return [Boolean] True if Sass was successfully loaded from the `sass` gem,
+    #   false otherwise.
+    def try_sass
+      begin
+        require 'sass/version'
+        loaded = Sass.respond_to?(:version) && Sass.version[:major] &&
+          Sass.version[:minor] && ((Sass.version[:major] > 3 && Sass.version[:minor] > 1) ||
+          ((Sass.version[:major] == 3 && Sass.version[:minor] == 1) &&
+            (Sass.version[:prerelease] || Sass.version[:name] != "Bleeding Edge")))
+      rescue LoadError => e
+        loaded = false
+      end
+
+      unless loaded
+        haml_warn(<<WARNING)
+Sass is in the process of being separated from Haml,
+and will no longer be bundled at all in Haml 3.2.0.
+Please install the 'sass' gem if you want to use Sass.
+WARNING
+        $".delete('sass/version')
+        $LOAD_PATH.unshift(scope("vendor/sass/lib"))
+      end
+      loaded
+    end
+
     ## Cross Rails Version Compatibility
 
     # Returns the root of the Rails application,
Add a util method to load Sass.