Exemplo n.º 1
0
        protected void AssertLessUnchanged(string input)
        {
            EvaluationContext context = new EvaluationContext(new LessTreeParser(), GetFileResolver(input));

            var currentStylesheet = context.ParseCurrentStylesheet(isReference: false);
            var evaluated         = currentStylesheet.EvaluateSingle <Stylesheet>(context);

            var output = new OutputContext(' ', 2);

            output.Append(evaluated);

            Assert.Equal(input.Trim(), output.GetCss().Trim());
        }
Exemplo n.º 2
0
        public void Compile(string inputFileName)
        {
            var context  = new EvaluationContext(new LessTreeParser(), new FileResolver(new FileSystem(), inputFileName));
            var rootNode = context.ParseCurrentStylesheet(isReference: false);

            var evaluated = rootNode.EvaluateSingle <Stylesheet>(context);

            var outputContext = new OutputContext(' ', 4);

            outputContext.Append(evaluated);

            Console.WriteLine(outputContext.GetCss());
        }