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

Some tokens have different background color #3822

Closed
ruslaniv opened this issue Sep 2, 2024 · 1 comment
Closed

Some tokens have different background color #3822

ruslaniv opened this issue Sep 2, 2024 · 1 comment

Comments

@ruslaniv
Copy link

ruslaniv commented Sep 2, 2024

Information

  • Language: python
  • Plugins: Line Numbers, Show Language, Autoloader, Normalize Whitespace, Toolbar, Copy to clipboard

Description
Some tokens have background color that is different from the background color of the page proper which does not make for a good reading experience

Code snippet

import functools  
import time  
from typing import Callable, Any  
</br>
def async_timed():  
	def wrapper(func: Callable) -> Callable:  
	@functools.wraps(func)  
		async def wrapped(*args, **kwargs) -> Any:  
			print(f'starting {func} with args {args} {kwargs}') start = time.time()  
			try:  
				return await func(*args, **kwargs) finally:  
				end = time.time()  
				total = end - start  
				print(f'finished {func} in {total:.4f} second(s)')  
			return wrapped  
		return wrapper  

Test page

This is from the test page. As you can see some tokens have background color that is different the page background color

CleanShot 2024-09-02 at 14 27 54

This is my own local installation, and also some tokens have their own background color
CleanShot 2024-09-02 at 14 30 32

I tried to tinker with prism.css but I could not solve this problem

@Golmote
Copy link
Contributor

Golmote commented Oct 29, 2024

Hello,

The default theme indeed uses a background-color for some tokens: https://github.com/PrismJS/prism/blob/master/themes/prism.css#L109-L110

You should be able to easily override that CSS rule to remove the background on your end.

@Golmote Golmote closed this as completed Oct 29, 2024
@Golmote Golmote closed this as not planned Won't fix, can't repro, duplicate, stale Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants