CssImportRule Class

https://drafts.csswg.org/cssom/#the-cssimportrule-interface

public sealed class CssImportRule : CssRule
Inheritance
CssRule CssImportRule

Properties

NameDescription
HrefGets the URL of the imported style sheet.
LayerNameGets the name of the cascade layer in which the imported style sheet is placed, an empty string for an anonymous layer, or null when the import has no layer.
MediaGets the media query list that conditions the import.
StyleSheethttps://drafts.csswg.org/cssom/#dom-cssimportrule-stylesheet: the imported style sheet, or null until it is fetched with the DocumentLoader of the browsing context (it is never fetched without a loader, for a constructed style sheet, or when the supports() condition is false).
SupportsTextGets the text of the supports() condition of the import, or null when the import has no condition.
TypeGets the legacy numeric type of the rule: CssRule.ImportRule for @import rules.

Gets the URL of the imported style sheet.

public string Href { get; }

LayerName

CSSRules.cs

Gets the name of the cascade layer in which the imported style sheet is placed, an empty string for an anonymous layer, or null when the import has no layer.

public string? LayerName { get; }

Gets the media query list that conditions the import.

public MediaList Media { get; }

StyleSheet

CSSRules.cs

https://drafts.csswg.org/cssom/#dom-cssimportrule-stylesheet: the imported style sheet, or null until it is fetched with the DocumentLoader of the browsing context (it is never fetched without a loader, for a constructed style sheet, or when the supports() condition is false).

public CssStyleSheet? StyleSheet { get; }

SupportsText

CSSRules.cs

Gets the text of the supports() condition of the import, or null when the import has no condition.

public string? SupportsText { get; }

Gets the legacy numeric type of the rule: CssRule.ImportRule for @import rules.

public override ushort Type { get; }

Property value

ushort