Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

editoryInlayHint.foreground/background doesn't apply when extension is enabled #400

Closed
crd2333 opened this issue Jun 8, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@crd2333
Copy link

crd2333 commented Jun 8, 2024

I'm not sure if I have done something wrong, but it seems the color for inlay hint didn't take effect, in contrast to built-in themes.

Settings for theme Macchiato(one of the setting is useful, though):
1
Settings for built-in theme:
2

@sgoudham
Copy link
Contributor

sgoudham commented Aug 5, 2024

Hey 👋,

Thanks for raising this. I'm running VSCode v1.92.0 with Catppuccin v3.15.0 and I can confirm that I can reproduce this issue.

Interestingly, I'm able to workaround this by targeting the parameter and type options. See below for the config and a screenshot for how it looks.

config

  "catppuccin.customUIColors": {
    "latte": {
      "editorInlayHint.parameterBackground": "red",
      "editorInlayHint.parameterForeground": "crust",
      "editorInlayHint.typeBackground": "pink",
      "editorInlayHint.typeForeground": "crust",
    }
  },

screenshot
image

I'll need to investigate further to find out why the normal editorInlayHint.foreground and editorInlayHint.background options don't work when the extension is enabled.

@sgoudham sgoudham changed the title workbench elements custom color didn't take effect editoryInlayHint.foreground/background doesn't apply when extension is enabled Aug 5, 2024
@sgoudham sgoudham added the bug Something isn't working label Aug 5, 2024
@sgoudham
Copy link
Contributor

sgoudham commented Nov 8, 2024

Hey again 👋,
I've looked into this again and I think I've figured out why.

The Catppuccin theme defines the following keys:

"editorInlayHint.foreground": palette.surface2,
"editorInlayHint.background": opacity(palette.mantle, 0.75),
"editorInlayHint.typeForeground": palette.subtext1,
"editorInlayHint.typeBackground": opacity(palette.mantle, 0.75),
"editorInlayHint.parameterForeground": palette.subtext0,
"editorInlayHint.parameterBackground": opacity(palette.mantle, 0.75),

typeForeground, typeBackground, parameterForeground & parameterBackground are all higher in specificity than just the plain foreground and background. This means that if you want to override the values for Catppuccin, you'll need to override all of the keys. For example:

"catppuccin.customUIColors": {
  "all": {
    "editorInlayHint.foreground": "#000000",
    "editorInlayHint.background": "#ffffff",
    "editorInlayHint.parameterForeground": "#ffffff",
    "editorInlayHint.parameterBackground": "#000000",
    "editorInlayHint.typeForeground": "#ffffff",
    "editorInlayHint.typeBackground": "#000000",
  }
},
image

I'll be closing this issue now as it's not necessarily a bug. I think it might be worth looking into ways on "unsetting" the key to avoid duplication but I'll raise another issue for to investigate that, should we want that behaviour.

@sgoudham sgoudham closed this as completed Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants