Created type definition for Node CSS parser

This commit is contained in:
Ilya Verbitskiy
2015-11-19 21:47:10 -06:00
parent 16134c168d
commit c4a1b81320
2 changed files with 161 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
/// <reference path="./css.d.ts" />
import css = require("css");
var parserOptions: css.ParserOptions;
parserOptions = {
silent: true,
source: "test.css"
};
var stylesheet = css.parse("body { font-size: 12px; }", parserOptions);
var comment: css.Comment;
comment = {
type: "comment",
comment: "Hello World"
};
stylesheet.stylesheet.rules.push(comment);
var stringifyOptions: css.StringifyOptions;
stringifyOptions = {
indent: " "
};
var content = css.stringify(stylesheet, stringifyOptions);
console.log(content);