AngleSharp by AngleSharp

<PackageReference Include="AngleSharp" Version="0.9.7" />

.NET API 1,204,224 bytes

 StyleSheetExtensions

public static class StyleSheetExtensions
Defines a set of extension methods for style sheets.
public static TRule AddNewRule<TRule>(this ICssRuleCreator creator) where TRule : ICssRule

Creates a new CSS rule and appends it to the current node.

public static ICssStyleRule AddNewStyle(this ICssRuleCreator creator, string selector = null, IDictionary<string, string> declarations = null)

Creates a new CSS style rule and appends it to the current node. The given selector and declarations are set in the beginning.

public static ICssStyleRule AddNewStyle(this ICssRuleCreator creator, string selector, object declarations)

Creates a new CSS style rule and appends it to the current node. The given selector and declarations from an anonymous object are set in the beginning.

public static IEnumerable<T> GetAll<T>(this ICssNode node) where T : IStyleFormattable

Gets all descendents of the provided node.

public static IEnumerable<ICssNode> GetAllDescendents(this ICssNode node)

Gets all descendents of the provided node.

public static IEnumerable<ICssComment> GetComments(this ICssNode node)

Gets the comments contained in the sheet, if any.

public static IDocument GetDocument(this IStyleSheet sheet)

Gets the associated document of the sheet if any.

public static bool IsAlternate(this IHtmlLinkElement link)

Gets if the link contains a stylesheet that is regarded alternate.

public static bool IsPersistent(this IHtmlLinkElement link)

Gets if the link contains a stylesheet that is regarded persistent.

public static bool IsPreferred(this IHtmlLinkElement link)

Gets if the link contains a stylesheet that is regarded preferred.

public static IEnumerable<TRule> RulesOf<TRule>(this IEnumerable<IStyleSheet> sheets) where TRule : ICssRule

Gets all rules that are of the provided type.

public static IEnumerable<ICssStyleRule> StylesWith(this IEnumerable<IStyleSheet> sheets, ISelector selector)

Gets all style rules that have the same selector text.