zed icon indicating copy to clipboard operation
zed copied to clipboard

🚧 Allow importing `base16` themes using the Theme Importer 🚧

Open iamnbutler opened this issue 1 year ago • 2 comments

This PR allows the theme importer to load and export base16-style themes. Many classic themes were initially written for this format, and it is a lightweight way to whip up a theme.

🚧 TODO 🚧:

  • [x] Decouple ZedSyntaxToken from VSCodeThemeConverter
  • [x] Allow importing base16-style themes with the -base16 flag when running the importer
  • [ ] Properly map base16 colors -> Zed theme colors
  • [ ] Figure out how to deal with states
  • [ ] General tidying, make things a bit more DRY

In-progress examples:

Hardcore - Chris Caller CleanShot 2024-02-01 at 20 17 00@2x

Sandcastle - George Essig CleanShot 2024-02-01 at 20 21 38@2x

Release Notes:

  • Added the ability to import base16-style themes using the experimental theme importer.

iamnbutler avatar Feb 02 '24 01:02 iamnbutler

Putting this up early so you can take a peek @maxdeviant. Not sure if you had some plans for making things more generic to allow more types of themes to be imported, or have any extra context since json user themes were shipped :)

iamnbutler avatar Feb 02 '24 01:02 iamnbutler

Probably out of scope for this PR, but we should maybe expose label/text colors for elements line tab_active, tab_inactive, and some way to target labels on selected background colors.

In Base16 themes you usually invert the neutrals when on one of the later 8 colors – I don't think this would be possible to do the way we have things now.

iamnbutler avatar Feb 02 '24 01:02 iamnbutler

I'm actually going to close this out for now – I don't think it is really possible to make nice base16 themes in zed yet until some additional work is done on generating state colors and exposing some more fields in the theme – I might tackle that separately before picking this back up.

iamnbutler avatar Feb 03 '24 06:02 iamnbutler