Makes themes resilient to stylesheets without trailing newlines.

Also deletes a bit of unused cruft from the dark theme.

For #8490 

cc @MiguelCastillo