Closed sophiajt closed 4 years ago
Looks like this comes from the to html
output including background-color for the body
and the table
element. Removing both fixes this issue.
@fdncred since you've worked on the theming and colors in to html
: Could you explain why those are there?
When I remove those styles, the table rows looks fine:
@jzaefferer All colors output by to html
are there because of the theme chosen. The them has 16 colors plus foreground and background. The theme does not output alternating row colors or understand that concept, so that is from our code here somewhere.
These hard coded colors could also be influencing what's going on. I added this because when a user has dark mode
enabled the colors were totally messed up. I think you could also override light mode
with another section like this one. But I haven't played with it.
If we want to use another theme, we can choose one. Any iterm2 color scheme in json format can be added to to html
.
@fdncred Based on your comment, I decided to simply use the body
background-color
all the time, and adjust the rest of the styles around that. But the problem now is that it sets the same background-color for body
and for table
, so besides the table border, there's zero contrast there.
There should be some contrast! As an example, see my screenshot above.
Can we adjust the theme in nu to have different background colors for body and table, to solve this also for other contexts that use to html
?
I think by default to html
shouldn't add colors, though I think we should make it easy for people to pass in a flag to configure the CSS that will be used. The theming @fdncred could be possible with a flag like --theme=theme_name
.
That makes sense, and we already have it! https://github.com/nushell/demo/blob/main/www/index.js#L45
return run_nu(input + "| to html --html_color --theme 'blulocolight'");
I suggest adjusting the theme colors to separate body and table background colors.
Now that the alternating rows are a bit lighter, it's harder to see the difference between them. I think having at least some alternative color would be nice to make the tables more readable.
Here's what it looks like for me in Linux/Firefox