brikou / css-in-js-generator Goto Github PK
View Code? Open in Web Editor NEWA tool to generate trendy CSS-in-JS files from regular CSS.
License: MIT License
A tool to generate trendy CSS-in-JS files from regular CSS.
License: MIT License
On line 3073 the definition for inputGroup references formControl before it is defined.
This causes the wrong selector to be used.
Look like this is because the rule on line 3315
.btn-toolbar .input-group {
width: auto;
}
Causes input-group to be generated before form-control which is defined later in the file.
Here is a screenshot of the css.
It'd be really nice to run npx css-in-js-generator out.js
I would like to use the package on the browser. But because of the usage of prettier
, it breaks. I already use prettier after I get the output. Moving this to index.js will eventually separate the server side specific code.
Error using with emotion 10
With emotion 10 import is @emotion/core
.display2 {
color: 'red';
}
.display-2 {
font-size: 5.5rem;
font-weight: 300;
line-height: 1.1;
}
These seem to generate the same class name in JS:
export const display2 = css`
font-size: 5.5rem;
font-weight: 300;
line-height: 1.1;
`;
export const display2 = css`color: "red";`;
Not sure if there is a good solution.
So .form-check-label
no longer has it's own styling, only related styles depending on the sibling input. This creates a rather strange bit of output!
&:disabled ~ .form-check-label,
&[disabled] ~ .form-check-label {
opacity: 0.5;
}
&.${isValid} {
border-color: #198754;
}
In the following example, the transformer demonstrates the following rule:
.alert-dismissible .close {
position: relative;
top: -0.75rem;
right: -1.25rem;
padding: 0.75rem 1.25rem;
color: inherit;
}
being converted into:
export const alertDismissible = css`
& .${close} {
position: relative;
top: -0.75rem;
right: -1.25rem;
padding: 0.75rem 1.25rem;
color: inherit;
}
`
This should come with a warning as, per emotions documentation:
To nest a class selector using the class generated with
css
you can interpolate it but this is strongly recommended against and should only be used in rare circumstances because it will break when used with composition.
Meaning that it'll break when trying to force specificity using cx
This looks like a really great project.
I have developed an IDE https://transform.now.sh/ and would love to have this on the site. Let me know if you can help or else, I will be happy to do it myself when I have time.
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.