Table of Contents

Class CssGenerator

Namespace
SunamoCssGenerator
Assembly
SunamoCssGenerator.dll

Generates CSS code with proper indentation and formatting

public class CssGenerator
Inheritance
CssGenerator
Derived
Inherited Members
Extension Methods

Methods

AddClass(int, string, params CssProperty[])

Adds a CSS class selector with properties

public void AddClass(int tabCount, string name, params CssProperty[] cssProps)

Parameters

tabCount int

Number of tabs for indentation

name string

Class name without the . prefix

cssProps CssProperty[]

CSS properties to apply

AddId(int, string, params CssProperty[])

Adds a CSS ID selector with properties

public void AddId(int tabCount, string name, params CssProperty[] cssProps)

Parameters

tabCount int

Number of tabs for indentation

name string

ID name without the # prefix

cssProps CssProperty[]

CSS properties to apply

AddMediaMinMaxWidth(int, int, Func<int, int>)

Adds a media query with min-width and max-width screen constraints

public void AddMediaMinMaxWidth(int tabCount, int maxWidth, Func<int, int> getMinFromMax)

Parameters

tabCount int

Number of tabs for indentation

maxWidth int

Maximum width in pixels

getMinFromMax Func<int, int>

Function to calculate minimum width from maximum width

AddTab(int)

Adds tabs for indentation

public void AddTab(int tabCount)

Parameters

tabCount int

Number of tabs to add

End(int)

Adds a closing brace with proper indentation

public void End(int tabCount)

Parameters

tabCount int

Number of tabs for indentation

ToString()

Returns the generated CSS as a string

public override string ToString()

Returns

string

The generated CSS code