question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider moving CSS file into JS

See original GitHub issue

Moving all the CSS rules into JS to be applied at the time Terminal.open is called would simplify use of the library and prevent people experiencing issues like this https://github.com/xtermjs/xterm.js/issues/3045. Overriding would also still be possible via !important.

This would need some verification work after (checking VS Code still works) and documentation updates.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Tyriarcommented, Sep 17, 2020

Sounds good, let’s close this out with as designed then since we already call it out pretty prominently in the readme 👌

1reaction
jerchcommented, Sep 16, 2020

@Tyriar Thb I dont like this idea for a simple reason - CSS is there for styling, we should not move things that can be styled with predefined rules away from the domain, that is meant for that purpose. (I’d go a step further and actually think that terminal themes should be in CSS as well.)

If ppl have issues to get CSS correctly loaded, then either our documentation is bad in this regard, or they should learn how to correctly embed CSS. Sorry if this sounds harsh, but for me moving away from CSS and doing everything in JS is a clear antipattern.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Many Ways to Include CSS in JavaScript Applications
Let us count the ways · Option 1: A dang ol' stylesheet · Option 2: CSS Modules · Option 3: CSS-in-JS.
Read more >
How to load CSS files using JavaScript? - GeeksforGeeks
How to load CSS files using JavaScript? · Use document.getElementsByTagName() method to get HTML head element. · Create new link element using ...
Read more >
Should CSS always precede JavaScript? - Stack Overflow
I believe that it is subjective, but I have a reason to explain you that it is better to put in CSS before...
Read more >
How To Include CSS And Run JavaScript In HTML ... - YouTube
0:00 Where to enter / put / insert CSS code in HTML 0:10 Inline CSS with style attribute 1:04 user agent css stylesheet...
Read more >
How to add CSS & Javascript to your HTML - YouTube
In this video, we create a starter template and link external CSS and Javascript files into our HTML file. We also look into...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found