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

Fix syntax highlighting and click-to-copy buttons for code blocks #2049

Merged
merged 4 commits into from
Jan 14, 2025

Conversation

zecakeh
Copy link
Contributor

@zecakeh zecakeh commented Jan 6, 2025

It turns out that we were purging too much CSS since #2008 which broke their style.

We use a simple but lazy solution that parses the JS scripts and keeps the matching selectors. This increases the CSS file size to 59KB.

Before:

image

After:

image

Pull Request Checklist

Preview: https://pr2049--matrix-spec-previews.netlify.app

It turns out that we were purging too much CSS which broke their style.

We use a simple but lazy solution that parses the JS scripts and keeps the matching selectors.

Signed-off-by: Kévin Commaille <[email protected]>
@zecakeh zecakeh requested a review from a team as a code owner January 6, 2025 20:33
Signed-off-by: Kévin Commaille <[email protected]>
@zecakeh zecakeh changed the title Fix click-to-copy buttons for code blocks Fix syntax highlighting and click-to-copy buttons for code blocks Jan 6, 2025
Signed-off-by: Kévin Commaille <[email protected]>
Copy link
Member

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improvement is clear - thanks for catching and fixing!

@anoadragon453 anoadragon453 merged commit ba73e0d into matrix-org:main Jan 14, 2025
12 checks passed
@zecakeh zecakeh deleted the fix-click-to-copy branch January 14, 2025 19:18
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.

2 participants