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

[@mantine/prism] Prism: use higher specificity for pre element margin #4452

Merged
merged 1 commit into from Jul 4, 2023

Conversation

mrbnclt
Copy link
Contributor

@mrbnclt mrbnclt commented Jun 22, 2023

This fixes #4429

Wrapping Prism within a TypographyStylesProvider that has a selector with the margin values:

<class> pre: {
  marginTop: theme.spacing.md,
  marginBottom: theme.spacing.md
}

has a higher specificity than Prism's selector with the margin set to 0

code: {
  .......
  marginTop: 0,
  marginBottom: 0
}

this causes the margin styles from TypographyStylesProvider to be utilized by Prism's pre element and causes the copy button to move higher than it's normal position.

@rtivital rtivital merged commit 9cf1c51 into mantinedev:master Jul 4, 2023
1 check passed
@rtivital
Copy link
Member

rtivital commented Jul 4, 2023

Thanks!

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.

copy button not rendering properly when using Prism component inside TypographyStylesProvider
2 participants