You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using <Prism> with colorScheme="dark" and highlighted lines, the per-line highlight is defaulting to the "light mode" colors instead of "dark mode" colors.
What version of @mantine/hooks page do you have in package.json?
^5.1.1
If possible, please include a link to a codesandbox with the reproduced problem
Are you willing to participate in fixing this issue and create a pull request with the fix
No
Possible fix
If I'm reading the code correctly, the reason is that the following lines are referring to the theme's colorScheme instead of the passed colorScheme value for highlighted lines:
What package has an issue
@mantine/prism
Describe the bug
When using
<Prism>
withcolorScheme="dark"
and highlighted lines, the per-line highlight is defaulting to the "light mode" colors instead of "dark mode" colors.What version of @mantine/hooks page do you have in package.json?
^5.1.1
If possible, please include a link to a codesandbox with the reproduced problem
https://codesandbox.io/s/happy-johnson-uheyg9
Do you know how to fix the issue
Yes
Are you willing to participate in fixing this issue and create a pull request with the fix
No
Possible fix
If I'm reading the code correctly, the reason is that the following lines are referring to the theme's
colorScheme
instead of the passedcolorScheme
value for highlighted lines:mantine/src/mantine-prism/src/Prism/Prism.tsx
Line 161 in 15b29b6
mantine/src/mantine-prism/src/Prism/Prism.tsx
Line 181 in 15b29b6
mantine/src/mantine-prism/src/Prism/Prism.tsx
Line 201 in 15b29b6
I believe that in all three cases, referencing the passed
colorScheme
variable instead oftheme.colorScheme
would produce the desired behavior.My current workaround is to create a "temporary theme" using a
MantineProvider
e.g.:... instead of
Here's a link to a code sandbox with the simulated workaround: https://codesandbox.io/s/currying-brook-bei9um
The text was updated successfully, but these errors were encountered: