transform-it / transform-css-to-js Goto Github PK
View Code? Open in Web Editor NEWA utility to convert your CSS into JS or React Native compatible styles.
A utility to convert your CSS into JS or React Native compatible styles.
You should give credit to https://codepen.io/Cdca12/pen/xJOEqd
Your code is almost identical.
Your doc says cssToJS
will return an object. In my usage, it returns a string. and the string is not a JSON string, so i cannot parse it. Am I doing something wrong?
this is the string value i am getting:
"{
RootElement: {
eWhite: '#FFFFFF',
eBlack100: '#3c4d5c',
eBlack200: '#414c56',
eBlack300: '#364756',
eBlack400: '#304150',
eBlack500: '#304250',
}
}"
My css has the following:
.class1, .class2 { margin-left:20px; }
When transforming this pattern, no comma is generated between these two object properties:
class1Class: { margin-left:20px;} class2Class: { margin-left:20px;}
My generated css file contains this:
.btn, .link {
color: blue;
}
.btn {
padding: 10px;
}
I expected my object to be like this:
{
link: {color: blue},
btn: {color: blue, padding: 10px}
}
However, the preview style gets overridden instead of combined:
{
btn: {color: blue},
link: {color: blue},
btn: {padding: 10px}
}
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.