Skip to content

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

Merged
anoadragon453 merged 4 commits intomatrix-org:mainfrom
zecakeh:fix-click-to-copy
Jan 14, 2025
Merged

Fix syntax highlighting and click-to-copy buttons for code blocks#2049
anoadragon453 merged 4 commits intomatrix-org:mainfrom
zecakeh:fix-click-to-copy

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 <zecakeh@tedomum.fr>
@zecakeh zecakeh requested a review from a team as a code owner January 6, 2025 20:33
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
@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 <zecakeh@tedomum.fr>
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
@zecakeh zecakeh deleted the fix-click-to-copy branch January 14, 2025 19:18
@Johennes Johennes mentioned this pull request Jul 2, 2025
30 tasks
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