2
.ql-snow .ql-tooltip{background-color:#fff;border:1px solid #ccc;box-shadow:0 0 5px #ddd;color:#444;padding:5px 12px;white-space:nowrap}.ql-snow .ql-tooltip::before{content:"Visit URL:";line-height:26px;margin-right:8px}.ql-snow .ql-tooltip input[type=text]{display:none;border:1px solid #ccc;font-size:13px;height:26px;margin:0;padding:3px 5px;width:170px}.ql-snow .ql-tooltip a.ql-preview{display:inline-block;max-width:200px;overflow-x:hidden;text-overflow:ellipsis;vertical-align:top}.ql-snow .ql-tooltip a.ql-action::after{border-right:1px solid #ccc;content:'Edit';.ql-snow .ql-tooltip a.ql-action2::after{border-right:1px solid #ccc;content:"Cancel";}
Is there an online site that converts HTML, or CSS into string, to play everything within a variable? For example:
I put in the form that:
body {
margin:0;
padding: 0;
}
He’d return something like this to me, making all the escape arrangements:
var css = 'body{margin:0;padding:0}';
If it were in PHP, I would do so:
$var = <<<END
.ql-snow .ql-tooltip{background-color:#fff;border:1px solid #ccc;box-shadow:0 0 5px #ddd;color:#444;padding:5px 12px;white-space:nowrap}.ql-snow .ql-tooltip::before{content:"Visit URL:";line-height:26px;margin-right:8px}.ql-snow .ql-tooltip input[type=text]{display:none;border:1px solid #ccc;font-size:13px;height:26px;margin:0;padding:3px 5px;width:170px}.ql-snow .ql-tooltip a.ql-preview{display:inline-block;max-width:200px;overflow-x:hidden;text-overflow:ellipsis;vertical-align:top}.ql-snow .ql-tooltip a.ql-action::after{border-right:1px solid #ccc;content:'Edit';.ql-snow .ql-tooltip a.ql-action2::after{border-right:1px solid #ccc;content:"Cancel";}
END;
I need to do this to generate a PDF:
var valor1 = 'aqui viria o css minificado com as aspas escapada';
var valor2 = 'mais CSS aqui...';
$('.main').prepend('<style type="text/css">' + [
valor1,
valor2
].join('') + '</style>');
OBS: My question is clear, the problem is that people did not understand, and so I’m having to add more information, to clarify for those who cannot understand what is obvious:
1 - I’m not looking for a solution to minify CSS
2 - I’m looking for a solution to play CSS minified inside a variable with a string inside quotes.
3 - I don’t want to do the string manually (that is, I don’t want to type it), I want to generate a string in the string format and not its value.
It is not capturing the value and removing line breaks and spaces?
– Jéf Bueno
Yes, I need this css in value... But not only this... manually, gives a lot of work.
– Ivan Ferrer
I tried to on that website, but I found nothing.
– Ivan Ferrer
It’s no trouble, see the jbueno’s answer.
– Oralista de Sistemas