dojox/html/styles (version 1.10)

See the dojox/html/styles reference documentation for more information.

Property Summary

Method Summary

  • _ContentSetter()
  • activeStyleSheet(title) Getter/Setter
  • disableStyleSheet(styleSheetName) Disables the dynamic style sheet with the name passed in the argument.
  • enableStyleSheet(styleSheetName) Enables the style sheet with the name passed in the argument.
  • getDynamicStyleSheet(styleSheetName) Creates and returns a dynamically created style sheet used for dynamic styles
  • getPreferredStyleSheet() Returns the style sheet that was initially enabled on document launch.
  • getStyleSheet(styleSheetName) Returns a style sheet based on the argument.
  • getStyleSheets() Collects all the style sheets referenced in the HTML page, including any included via @import.
  • getToggledStyleSheets() Searches HTML for style sheets that are "toggle-able" - can be enabled and disabled.
  • insertCssRule(selector,declaration,styleSheetName) Creates a style and attaches it to a dynamically created stylesheet
  • modifyCssRule(selector,declaration,styleSheetName) Not implemented - it seems to have some merit for changing some complex selectors.
  • removeCssRule(selector,declaration,styleSheetName) Removes a cssRule base on the selector and declaration passed The declaration is needed for cases of dupe selectors

Properties

entities
Defined by: dojox/html/entities
ext-dojo
metrics
Defined by: dojox/html/metrics

Methods

_ContentSetter()
Defined by dojox/html/_base
activeStyleSheet(title)
Defined by dojox/html/styles

Getter/Setter

If passed a title, enables a that style sheet. All other toggle-able style sheets are disabled. If no argument is passed, returns currently enabled style sheet.

Parameter Type Description
title String
Optional
disableStyleSheet(styleSheetName)
Defined by dojox/html/styles

Disables the dynamic style sheet with the name passed in the argument. If no arg is passed, defaults to the default style sheet.

Parameter Type Description
styleSheetName String
enableStyleSheet(styleSheetName)
Defined by dojox/html/styles

Enables the style sheet with the name passed in the argument. Deafults to the default style sheet.

Parameter Type Description
styleSheetName String
getDynamicStyleSheet(styleSheetName)
Defined by dojox/html/styles

Creates and returns a dynamically created style sheet used for dynamic styles

Parameter Type Description
styleSheetName String
Optional

The name given the style sheet so that multiple style sheets can be created and referenced. If no argument is given, the name "default" is used.

Returns:undefined
getPreferredStyleSheet()
Defined by dojox/html/styles

Returns the style sheet that was initially enabled on document launch. TODO, does not work.

getStyleSheet(styleSheetName)
Defined by dojox/html/styles

Returns a style sheet based on the argument. Searches dynamic style sheets first. If no matches, searches document style sheets.

Parameter Type Description
styleSheetName String
Optional

A title or an href to a style sheet. Title can be an attribute in a tag, or a dynamic style sheet reference. Href can be the name of the file. If no argument, the assumed created dynamic style sheet is used.

getStyleSheets()
Defined by dojox/html/styles

Collects all the style sheets referenced in the HTML page, including any included via @import.

Returns:any

An hash map of all the style sheets.

getToggledStyleSheets()
Defined by dojox/html/styles

Searches HTML for style sheets that are "toggle-able" - can be enabled and disabled. These would include sheets with the title attribute, as well as the REL attribute.

Returns:any

An array of all toggle-able style sheets

insertCssRule(selector,declaration,styleSheetName)
Defined by dojox/html/styles

Creates a style and attaches it to a dynamically created stylesheet

Parameter Type Description
selector String

A fully qualified class name, as it would appear in a CSS dojo.doc. Start classes with periods, target nodes with '#'. Large selectors can also be created like:

"#myDiv.myClass span input"
declaration String

A single string that would make up a style block, not including the curly braces. Include semi-colons between statements. Do not use JavaScript style declarations in camel case, use as you would in a CSS dojo.doc:

"color:#ffoooo;font-size:12px;margin-left:5px;"
styleSheetName String
Optional

Name of the dynamic style sheet this rule should be inserted into. If is not found by that name, it is created. If no name is passed, the name "default" is used.

Returns:string
modifyCssRule(selector,declaration,styleSheetName)
Defined by dojox/html/styles

Not implemented - it seems to have some merit for changing some complex selectors. It's not much use for changing simple ones like "span". For now, simply write a new rule which will cascade over the first.

Modifies an existing cssRule

Parameter Type Description
selector undefined
declaration undefined
styleSheetName undefined
removeCssRule(selector,declaration,styleSheetName)
Defined by dojox/html/styles

Removes a cssRule base on the selector and declaration passed The declaration is needed for cases of dupe selectors

Only removes DYNAMICALLY created cssRules. If you created it with dh.insertCssRule, it can be removed.

Parameter Type Description
selector String
declaration String
styleSheetName String
Error in the documentation? Can’t find what you are looking for? Let us know!