We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basically I can convert the css to JSON ordered but not back to css. Here are the fixes I would recommend to allow for that to happen correctly:
In CSSJSON.js -> base.toJSON function
replace
} else if (!isEmpty(match[capEnd])) { // Node has finished return node; }
with
} else if (!isEmpty(match[capEnd])) { // Node has finished if (args.ordered) node.length=count; return node; }
return node;
if (args.ordered) node.length=count; return node;
In CSSJSON.js -> base.toCSS function
return cssString;
if ( typeof node.length === "number" ) { for (var j = 0; j < node.length; j++) { cssString += base.toCSS(node[j], depth); } } else if ( typeof node.value === "object" ) { cssString += strNode(node.name, node.value, depth); } else if ( typeof node.value != undefined ) { cssString += strAttr(node.name, node.value, depth); } return cssString;
In CSSJSON.js -> strNode function
var strNode = function (name, value, depth) { var cssString = '\t'.repeat(depth) + name + ' {\n'; cssString += base.toCSS(value, depth + 1); cssString += '\t'.repeat(depth) + '}\n'; return cssString; };
var strNode = function (name, value, depth) { var cssIndent = '\t'.repeat(depth), cssString = cssIndent + name.split(/\s*,\s*/gi).join( ',\n' + cssIndent ) + ' {\n'; cssString += base.toCSS(value, depth + 1); cssString += cssIndent + '}\n'; return cssString; };
The text was updated successfully, but these errors were encountered:
@svarlitskiy Hi, can you make a PR please ?
Sorry, something went wrong.
@svarlitskiy I tried but it doesn't work!
No branches or pull requests
Basically I can convert the css to JSON ordered but not back to css. Here are the fixes I would recommend to allow for that to happen correctly:
In CSSJSON.js -> base.toJSON function
replace
with
replace
with
In CSSJSON.js -> base.toCSS function
replace
with
In CSSJSON.js -> strNode function
replace
with
The text was updated successfully, but these errors were encountered: