Table of Contents

Class StyleSheet

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

An object implementing the StyleSheet interface represents a single style sheet. CSS style sheets will further implement the more specialized CSSStyleSheet interface.

[Value("StyleSheet")]
public class StyleSheet
Inheritance
StyleSheet
Derived
Inherited Members

Remarks

Constructors

StyleSheet()

public StyleSheet()

Properties

Disabled

The disabled property of the
StyleSheet interface determines whether the style sheet is prevented from
applying to the document.

[Value("disabled")]
public bool Disabled { get; set; }

Property Value

bool

A boolean.

Remarks

A style sheet may be disabled by manually setting this property to true or
if it's an inactive alternative style sheet. Note that disabled === false does not guarantee the style
sheet is applied (it could be removed from the document, for instance).

See also on MDN

Href

The href property of the StyleSheet
interface returns the location of the style sheet.

[Value("href")]
public string? Href { get; }

Property Value

string

A string containing the stylesheet's URI.

Remarks

This property is read-only.

See also on MDN

Media

The read-only media property of the StyleSheet interface contains a MediaList object representing the intended destination media for style information.

[Value("media")]
public MediaList Media { get; }

Property Value

MediaList

A MediaList object. Its value is set by the media attribute on the corresponding <link> or <style> element. If the media attribute is not set or empty, it returns an empty MediaList, i.e., a MediaList with the length property equal to 0.Although the media property itself is read-only in the sense that you can't replace the MediaList object, you can still assign to the media property directly, which is equivalent to assigning to its MediaListmediaText property. You can also modify the MediaList object using the MediaListappendMedium and MediaListdeleteMedium methods.

Remarks

OwnerNode

The ownerNode property of the
StyleSheet interface returns the node that associates this style sheet
with the document.

[Value("ownerNode")]
public Union23? OwnerNode { get; }

Property Value

Union23?

A Node object.

Remarks

This is usually an HTML
<link> or
<style> element, but
can also return a processing instruction node in the case of <?xml-stylesheet ?>.

See also on MDN

ParentStyleSheet

The parentStyleSheet property of the
StyleSheet interface returns the style sheet, if any, that is including
the given style sheet.

[Value("parentStyleSheet")]
public CSSStyleSheet? ParentStyleSheet { get; }

Property Value

CSSStyleSheet

A StyleSheet object.

Remarks

Title

The title property of the StyleSheet interface returns the advisory title of the current style sheet.

[Value("title")]
public string? Title { get; }

Property Value

string

Remarks

The title is often specified in the StyleSheetOwnerNode.

See also on MDN

Type

The type property of the StyleSheet
interface specifies the style sheet language for the given style sheet.

[Value("type")]
public string Type { get; }

Property Value

string

A string.

Remarks