Last active
August 29, 2015 14:17
-
-
Save rytmis/c98925b84ecee561fe82 to your computer and use it in GitHub Desktop.
Custom parameter source for dotless engine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DictionaryParameterSource : IParameterSource { | |
public DictionaryParameterSource(IDictionary<string, string> parameters) { | |
this.parameters = new Dictionary<string, string>(parameters); | |
} | |
public IDictionary<string, string> GetParameters() { | |
return this.parameters; | |
} | |
} | |
var engine = new EngineFactory(DotlessConfiguration.GetDefault()).GetEngine(); | |
var decoratedEngine = new ParameterDecorator(engine, new DictionaryParameterSource(new Dictionary<string, string> { | |
{ "param1", "value" } | |
})); | |
decoratedEngine.TransformToCss(less, null); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment