SAPO::Utility.CSS->set

Set CSS styles in the page using the JSON-CSS proposal as described in  http://www.featureblend.com/css-json.html

Syntax

SAPO.Utility.CSS.set(json[,cssid])

Compatibility

All browsersYes

Depends

Input Parameters

  • (json) css : CSS definitions
  • (string) cssID : optional ID for this CSS section. Important if you set the page's CSS more than once.

CSS JSON example

Our implementation has the CSSJSON-INHERIT-SELECTOR feature.

mycss={
  'h1': {
     'color':'#ff0',
     'font-size':'1.3em'
      },
  'h2': {
     'CSSJSON-INHERIT-SELECTOR':"h1",
     'font-size':'0.9em'
      }
    }

In this example, h2 inherits h1 definition plus it add it's own font-size.

Sample

 http://js.sapo.pt/SAPO/Utility/CSS/sample/css.html


Community feedback

Error: Failed to load processor AddComment
No macro or processor named 'AddComment' found