Closed code3z closed 3 years ago
You’re too verbose. Sorry, I think I’ll do it myself; it’ll take less effort for us both.
You mean, just include this?
Author(s): code3z (code3 on the forum) and tiosgz (potmeklecbohdan on the forum)
CSS styles are fairly easy to add to Vivaldi, and most of the time you will probably use Vivaldi's native CSS mods manager. But for JS mods that require a little bit of CSS, you may want to combine the CSS in Javascript.
The benefit is that it's all in one file, and easier for users to install. The downsides are that the CSS is harder to customize, and the code is a bit harder to write.
(function () {
let styles = document.createElement("style");
styles.type = "text/css";
styles.setAttribute("data-id", "<name-of-mod>-styles");
styles.innerHTML = `/* Add CSS styles here.
They can take up multiple lines. Example: */
* {
color: #00ff00 !important;
}
`;
document.head.append(styles);
})();
Wrt length, yes. But at this point suggesting a reword is like writing it anew…
If the code is bad, could you tell me what I should do next time?
See #31 for how I’d imagine it (feel free to criticise)
Is it good? Should it be included at all? Should I move the file into a different folder?
Resolves #26