Getting started with .NET

After installing the Nuget package , you should be able to call Cascadium compiler from your code with:


                    string xcss = @"
                        div {
                            background-color: red;

                            > span {
                                color: yellow;
                            }
                        }
                        ";

                    string css = Cascadium.CascadiumCompiler.Compile(xcss);

                    Console.Write(css);
                

And get the output:


                    div{background-color:red}div>span{color:yellow}
                

You can also specify compilation options with:


                    string css = Cascadium.CascadiumCompiler.Compile(xcss, new CascadiumOptions()
                    {
                        Pretty = true
                    });
                

To view all compilation options, click here.