Skip to content

peterprins/CSStoJSObjectParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CSStoJSObjectParser Javascript Class

Description

A fast JavaScript Class to Parse a CSS Style String into a Javascript Object.

You could dynamically load a CSS file with the liteAjax Javascript Library and then parse it with this class into a JavaScript object.

Class Syntax

CSStoJSObjectParser(string)

string:

string - a css styles string

'body{background-color:#ffffff;}'

Class Usage

var css_str = "\n \t /* this is a test */   #nav.ul, \t #stuff li, .cool #div.mystuff { background: url(\"myfile.jpg\") no-repeat; text-align: center; } \t \n    container, #div.contents, ul.li { background: url(\"myfile.jpg\") no-repeat; }";

var test = new CSStoJSObjectParser(css_str);

console.log("input:\n", test.input);
console.log("output:\n", test.output);
console.log("jsobject:\n", test.jsobject);

About

CSStoJSObjectParser - parse a CSS file into a Javascript Object with this Library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published