Home Reference Source Repository
import AbstractCSSStyleDeclaration from 'html-document/src/Abstract/AbstractCSSStyleDeclaration.js'
public class | source

AbstractCSSStyleDeclaration

Direct Subclass:

CSSStyleDeclaration

CSSStyleDeclaration represents a collection of CSS property-value pairs. It is used in a few APIs

  • HTMLElement.style - to manipulate the style of a single element (<elem style="...">);
  • (TODO: reword) is an interface to the declaration block returned by the style property of a cssRule in a stylesheet, when the rule is a CSSStyleRule.
  • CSSStyleDeclaration is also a read-only interface to the result of window.getComputedStyle().

Member Summary

Public Members
public get
public set

cssText(style: string): *

Method Summary

Public Methods
public

getPropertyPriority(propertyName: string, important: String | undefined | false): *

Returns the optional priority, "important".

public

getPropertyValue(propertyName: string): *

Returns the optional priority, "important".

public

item(index: number): string

Returns a property name.

public

removeProperty(propertyName: string): *

Returns the value deleted.

public

setProperty(propertyName: string, value: string, important: string)

No return.

Public Members

public get cssText: string source

public set cssText(style: string): * source

Public Methods

public getPropertyPriority(propertyName: string, important: String | undefined | false): * source

Returns the optional priority, "important". Example: priString= styleObj.getPropertyPriority('color')

Params:

NameTypeAttributeDescription
propertyName string
important String | undefined | false

Return:

*

public getPropertyValue(propertyName: string): * source

Returns the optional priority, "important". Example: priString= styleObj.getPropertyPriority('color')

Params:

NameTypeAttributeDescription
propertyName string

Return:

*

propertyValue

public item(index: number): string source

Returns a property name. Example: nameString= styleObj.item(0) Alternative: nameString= styleObj[0]

Params:

NameTypeAttributeDescription
index number

Return:

string

propertyName

public removeProperty(propertyName: string): * source

Returns the value deleted. Example: valString= styleObj.removeProperty('color')

Params:

NameTypeAttributeDescription
propertyName string

Return:

*

propertyValue

public setProperty(propertyName: string, value: string, important: string) source

No return. Example: styleObj.setProperty('color', 'red', 'important')

Params:

NameTypeAttributeDescription
propertyName string
value string
important string