Terminal colors for syntax themes #1373
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a draft for now but is being opened ahead of time so that I don't forget to do it later — or, worse, let these changes sit unstaged in my Pulsar project folder until I forget ever having written them.
When we ship a terminal, the colors it uses should be harmonious with those of the user's own syntax theme. The best way to do that is to have the theme be in charge of the colors used. On a superficial level, this is easy: base the terminal's foreground color on the theme's editor text color, and its background color on the theme's editor background color.
The ANSI colors, however, are where the rubber meets the road. For most themes, we can just fall back to some default color values that look decent enough in both light and dark themes. But there's no reason not to define the correct variables for all eight of our bundled syntax themes! That's what this PR does.
It also updates the fallback
syntax-variables.lessthat's present as a failsafe if your syntax theme is very rude and noncompliant and doesn't define even the most basic of syntax variables itself.