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

Add token background colors to themes #212294

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mattmundell
Copy link

@mattmundell mattmundell commented May 8, 2024

Add support for background colors to theme rules.

Closes #3429.

I did this before noticing #3429. Maybe helps someone wanting to patch their own version.

Example

id = 'patch'
tokenizer = {
  root: [
    [/^---\s.*/, "bredfill"],
    [/^\+\+\+\s.*/, "bredfill"],
    [/^\@\@\s.*/, "bredfill"],
    [/^-.*/, "minus"],
    [/^\+.*/, "plus"],
  ],
}

Mon.languages.register({ id: id,
                         firstLine: '^diff --git.*',
                         'mime-type': ['text/x-diff', 'text/x-patch', 'application/x-patch'],
                         extensions: ['.patch', '.diff'] })
Mon.languages.setMonarchTokensProvider(id, { tokenizer: tokenizer })

themeSolarized.rules.push({ "foreground": '073642',
                            "background": 'eee8d5',
                            "token": "bredfill" })

example

@mattmundell
Copy link
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[themes] Themes don't support background styling
2 participants