0
I have a css file and I would like to generate a JSON, for this, the first step I found would be to remove the entire selector before the brackets
.meuSeletor {
propriedade: valor;
}
for
{
propriedade: valor;
}
But I have no idea how to do, I couldn’t think of any regex, nor an algorithm to select and remove this text.
As I have all selectors in one file, it complicates a little more Example:
*, *:before, *:after {
box-sizing: border-box;
}
html {
overflow-y: scroll;
}
body {
background: #c1bdba;
font-family: 'Titillium Web', sans-serif;
}
a {
text-decoration: none;
color: #1ab188;
-webkit-transition: .5s ease;
transition: .5s ease;
}
Does anyone have any idea?
I don’t think it will work to create a JSON because of the values of the properties. They would have to be in quotes, otherwise it will fail. For example, this
background: #c1bdba;
would have to staybackground: "#c1bdba;"
.– Sam
What is the idea of this JSON? You can explain the problem you are trying to solve?
– Sergio
Tries this site. Or use that library
– Ivan Ferrer