I am trying to make a CSS converter for inline styles using only client-side technologies.
Searching even found something, in the case is library (jquery.inlineStyler) and this is implementation , but it does not answer me how I would like it, since it converts all properties of style
of element to style
inline (including the default of the browser), which is not what I would like.
What I would like was for the only CSS properties converted to% inline to be declared in CSS, not all the default of the browser for that element.
A simple example of the result you'd like:
p {
color: green;
background-color: #ccc;
}
p.p2 {
color: blue;
font-size: 15pt;
}
<p>Paragrafo</p>
<p class="p2">Paragrafo 2</p>
Where the expected result for this HTML would be:
<p style="color: green;background-color: #ccc;">Paragrafo</p>
<p style="color: blue;background-color: #ccc;font-size: 15pt;">Paragrafo 2</p>