CSS is absolutely the right tool for constructing layouts because it allows you to make your components with a class (like "commandLine") and then control exactly how that input box lays out on the screen, not only its font and color but also height, scrolling, expanding or not with the window and content, and everything else that affects the look.
Ideally, JS is only for computation, HTML only for making content containers, and all layout and appearance is in CSS.
Attributing behaviors through names is not unique to css and it’s not particularly the right tool. It’s the only tool you have in browser, yes. But let it invent ways to avoid things like negative margins, harmfully cascading layout rules, etc, before calling it “right”.
And gp is absolutely correct about it being fragile, cause it’s fragile as hell.
Am also investigating xterm.js currently.
Anything that uses too much CSS (eg tries to 'construct' layouts with it rather than just rending text) seems a little fragile.