kesla / css2json Goto Github PK
View Code? Open in Web Editor NEWConvert style sheets to json
Home Page: http://kesla.github.com/css2json/
License: MIT License
Convert style sheets to json
Home Page: http://kesla.github.com/css2json/
License: MIT License
A css like below :
.test { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6+R8AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NCNwAAAC5JREFUKFNjGIKgvLz8P5RJPABpIlkjTBNJGpE1Ea2RZA0gQLIGECBZw2ACDAwAhS4mQZAuqGcAAAAASUVORK5CYII=); }
it will splite by ";"
It can be solve by code below:
var reg = new RegExp("image/png;base64", "g"); var regback = new RegExp("image/png+&+base64", "g");; var declarations = css.substring(lbracket + 1, rbracket).replace(reg, "image/png+&+base64") .split(";") .map(function(declaration){ return declaration.trim().replace(regback, "image/png;base64"); }) .filter(function(declaration) { return declaration.length > 0; }); // Remove any empty ("") values from the array
I change the code in node models and it work well.
Hi guys,
Thanx for this library has been a very good tool for my team's projects.
It works fine on our project but today I was testing the prism
library and I got a broken attribute.
This is the code:
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
Output
'@media print': {
'code[class*=language-],pre[class*=language-]{text-shadow': 'none'
},
'}pre[class*=language-]': { '': '}pre[class*=language-]{' },
This is the original css file:
https://cdnjs.cloudflare.com/ajax/libs/prism/1.16.0/themes/prism.css
Please take a look to it, and thanx again!
Hi!
I'm using this package, and I noticed there is no license specified. If you get the chance, can you please add one?
Thank you very much!
Hey Kesla,
Could you update the node version in package.json with something like
"engines": { "node": ">= 0.4.11} ?
otherwise your package is not installable
thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.