-
Notifications
You must be signed in to change notification settings - Fork 77
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
Add space around code #223
Conversation
Hum. I think it's better for cases with a contrast color in the block and without line number (WP-admin > Settings > SyntaxHighlighter - Color Theme and Display line numbers settings). But for the same color with line numbers (screenshots from the PR description), it seems very spaced. Also, with contrast and line numbers, I think it seems a little weird: Maybe we could add the space only when it doesn't have the line numbers. And for the other case, we could just add |
I think we can do even more straightforward: remove padding only on the left of the line. Or do those spaces around the block look weird for you? 🤔 As an development of the idea of removing/adding padding:
However, it doesn't solve the problem with seemingly too large padding when the code and the page have the same background. But we can set padding to 0.5em for top&bottom: The main problem here (from my perspective) is that we can't rely only on the theme of SyntaxHighlighter :-/ Otherwise, we could set different padding for different themes. Aw, and I think 1px would look not so good in your example (I mean dark background for code and light background for the rest of the page, or vice versa). Better than #131 but too close to edges from my point of view. Unfortunately, 1px is not enough to recognize underscore. Here is how it looks with 2px: |
The spacings you added now look good to me! I just noticed that with the new approach, the title is misaligned (we can add it through the settings too). I think the less we can change there would be better because the users can have CSS overriding some styles. So if we change less, there are less chances to break site customizations. :) |
424bc9b
to
939887c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Looks good and works well!
Fixes #168 #131
Changes proposed in this Pull Request
Testing instructions
Screenshot / Video
Before:
![CleanShot 2021-11-16 at 15 22 02@2x](https://user-images.githubusercontent.com/329356/141984875-98333ad7-8996-40f0-af4c-f0e8bf756832.png)
![CleanShot 2021-11-16 at 15 22 49@2x](https://user-images.githubusercontent.com/329356/141984896-9ecad9a8-3bb5-414a-aa77-a206bb0b8a47.png)
After:
![CleanShot 2021-11-16 at 15 17 44@2x](https://user-images.githubusercontent.com/329356/141984940-0ec094c8-b9d6-48c4-9415-dad82b0b206c.png)
![CleanShot 2021-11-16 at 15 17 23@2x](https://user-images.githubusercontent.com/329356/141984946-db35bb88-15ca-4ef4-a610-5e8e7d0c55ca.png)