com.vaadin.sass.internal
Class ScssContext

java.lang.Object
  extended by com.vaadin.sass.internal.ScssContext

public class ScssContext
extends Object


Nested Class Summary
static class ScssContext.UrlMode
          Url mode specifies how urls appearing in an scss style sheet are interpreted.
 
Constructor Summary
ScssContext()
           
ScssContext(ScssContext.UrlMode urlMode)
           
 
Method Summary
 void addExtension(Extension extension)
           
 void addVariable(Variable node)
          Add a scope specific local variable, typically a function or mixin parameter.
 void closeVariableScope()
          End a scope for variables, removing all active variables that only existed in the new scope.
 void closeVariableScope(Scope newScope)
          End a scope for variables, removing all active variables that only existed in the new scope.
 void defineFunction(FunctionDefNode function)
           
 void defineMixin(MixinDefNode mixin)
           
 Scope getCurrentScope()
          Returns the current scope.
 Iterable<Extension> getExtensions()
           
 FunctionDefNode getFunctionDefinition(String name)
           
 MixinDefNode getMixinDefinition(String name)
           
 ScssContext.UrlMode getUrlMode()
           
 Variable getVariable(String string)
           
 Iterable<Variable> getVariables()
           
 void openVariableScope()
          Start a new scope for variables.
 Scope openVariableScope(Scope parent)
          Switch to a new sub-scope of a specific scope.
 void setUrlMode(ScssContext.UrlMode urlMode)
           
 void setVariable(Variable node)
          Set the value of a variable that may be in the innermost scope or an outer scope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScssContext

public ScssContext()

ScssContext

public ScssContext(ScssContext.UrlMode urlMode)
Method Detail

defineFunction

public void defineFunction(FunctionDefNode function)

defineMixin

public void defineMixin(MixinDefNode mixin)

openVariableScope

public Scope openVariableScope(Scope parent)
Switch to a new sub-scope of a specific scope. Any variables created after opening a new scope are only valid until the scope is closed, whereas variables from the parent scope(s) that are modified will keep their new values even after closing the inner scope. When using this method, the scope must be closed with closeVariableScope(Scope) with the return value of this method as its parameter.

Returns:
previous scope

closeVariableScope

public void closeVariableScope(Scope newScope)
End a scope for variables, removing all active variables that only existed in the new scope.


getCurrentScope

public Scope getCurrentScope()
Returns the current scope. The returned value should be treated as opaque and only used as a parameter to openVariableScope(Scope).

Returns:
current scope

openVariableScope

public void openVariableScope()
Start a new scope for variables. Any variables created after opening a new scope are only valid until the scope is closed, at which time they are replaced with their old values, whereas variables from outside the current scope that are modified will keep their new values even after closing the inner scope.


closeVariableScope

public void closeVariableScope()
End a scope for variables, removing all active variables that only existed in the new scope.


setVariable

public void setVariable(Variable node)
Set the value of a variable that may be in the innermost scope or an outer scope. The new value will be set in the scope in which the variable was defined, or in the current scope if the variable was not set.

Parameters:
node - variable to set

addVariable

public void addVariable(Variable node)
Add a scope specific local variable, typically a function or mixin parameter.

Parameters:
node - variable to add

getVariable

public Variable getVariable(String string)

getVariables

public Iterable<Variable> getVariables()

getMixinDefinition

public MixinDefNode getMixinDefinition(String name)

getFunctionDefinition

public FunctionDefNode getFunctionDefinition(String name)

addExtension

public void addExtension(Extension extension)

getExtensions

public Iterable<Extension> getExtensions()

getUrlMode

public ScssContext.UrlMode getUrlMode()

setUrlMode

public void setUrlMode(ScssContext.UrlMode urlMode)


Copyright © 2013–2015 Vaadin. All rights reserved.