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).
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.
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
mediaattribute on the corresponding<link>or<style>element. If themediaattribute is not set or empty, it returns an emptyMediaList, i.e., aMediaListwith thelengthproperty equal to0.Although themediaproperty itself is read-only in the sense that you can't replace theMediaListobject, you can still assign to themediaproperty directly, which is equivalent to assigning to its MediaListmediaText property. You can also modify theMediaListobject 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
Remarks
This is usually an HTML<link> or<style> element, but
can also return a processing instruction node in the case of <?xml-stylesheet ?>.
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
Remarks
The title is often specified in the StyleSheetOwnerNode.
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.