Forum How do I...?

Conditional CSS imports

yet
I have this print-css.rocks lessons

https://github.com/zopyx/print-css-rocks/blob/master/lessons/lesson-footnotes-multi-columns

where I need to inject the specific "prince.css" CSS.

I don't want to include it within the index.html because this should not contain any converter specific CSS.

Passing "-s prince.css" through the commandline also does not help because the CSS file is loaded as first instead of as last CSS (it contains overrides for span.footnote).

Any idea?
dauwhe
Could you just import with a media query. so it's print-only?

@import url("prince.css") print;
yet
nah...as written, the test is for all PrintCSS converters and I need one more extra style specific to Prince
mikeday
You could add it with some JavaScript:
<script>
if (Prince) {
    var style = document.createElement("style");
    document.body.appendChild(style);
    style.textContent = "...";
}