-
Notifications
You must be signed in to change notification settings - Fork 649
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 Solarized line number colors #1477
Merged
Anteru
merged 9 commits into
pygments:master
from
pfertyk:fix-solarized-line-number-colors
Jul 4, 2020
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6b5dad4
Add font and background colors to Style
pfertyk 17d7b8f
Move all styles to get_style_defs, add tests
pfertyk 86d477b
Remove hardcoded styles, add special lineno style
pfertyk 1f6781c
Add styles for special line numbers in tables
pfertyk 14b6675
Update noclasses documentation
pfertyk a9a9ea1
Refactor linenos elements and styles, add tests
pfertyk 6da2829
Update AUTHORS
pfertyk ea9b60d
Merge branch 'master' of github.com:pygments/pygments into fix-solari…
pfertyk 177c7c8
Fix multiple CSS prefixes, add tests
pfertyk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_0_anchor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="highlight"> | ||
<pre> | ||
<span></span> | ||
<span class="linenos">1</span><span class="c1"># a</span> | ||
<span class="linenos">2</span><span class="c1"># b</span> | ||
<span class="linenos">3</span><span class="c1"># c</span> | ||
</pre> | ||
</div> |
8 changes: 8 additions & 0 deletions
8
tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_0_noanchor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="highlight"> | ||
<pre> | ||
<span></span> | ||
<span class="linenos">1</span><span class="c1"># a</span> | ||
<span class="linenos">2</span><span class="c1"># b</span> | ||
<span class="linenos">3</span><span class="c1"># c</span> | ||
</pre> | ||
</div> |
8 changes: 8 additions & 0 deletions
8
tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_3_anchor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="highlight"> | ||
<pre> | ||
<span></span> | ||
<span class="linenos">1</span><span class="c1"># a</span> | ||
<span class="linenos">2</span><span class="c1"># b</span> | ||
<span class="linenos special">3</span><span class="c1"># c</span> | ||
</pre> | ||
</div> |
8 changes: 8 additions & 0 deletions
8
tests/html_linenos_expected_output/inline_cls_step_1_start_1_special_3_noanchor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="highlight"> | ||
<pre> | ||
<span></span> | ||
<span class="linenos">1</span><span class="c1"># a</span> | ||
<span class="linenos">2</span><span class="c1"># b</span> | ||
<span class="linenos special">3</span><span class="c1"># c</span> | ||
</pre> | ||
</div> |
8 changes: 8 additions & 0 deletions
8
tests/html_linenos_expected_output/inline_cls_step_1_start_8_special_0_anchor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="highlight"> | ||
<pre> | ||
<span></span> | ||
<span class="linenos"> 8</span><span class="c1"># a</span> | ||
<span class="linenos"> 9</span><span class="c1"># b</span> | ||
<span class="linenos">10</span><span class="c1"># c</span> | ||
</pre> | ||
</div> |
8 changes: 8 additions & 0 deletions
8
tests/html_linenos_expected_output/inline_cls_step_1_start_8_special_0_noanchor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="highlight"> | ||
<pre> | ||
<span></span> | ||
<span class="linenos"> 8</span><span class="c1"># a</span> | ||
<span class="linenos"> 9</span><span class="c1"># b</span> | ||
<span class="linenos">10</span><span class="c1"># c</span> | ||
</pre> | ||
</div> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Just curious - in which way
margin: 0
makes it look better? In my case, it looks less pretty because there is no margin after the code. This looks more obvious when you write some explanation on the top and code after that few times, for example: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.
Another example:
With
margin: 0
Without
margin: 0
I trying to override the CSS now and I was curious why this change was made.
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.
You're seeing (I guess) because your theme doesn't have margin/padding on the paragraph either. I'd try to override the style if you care about specific padding/margin. That said, the
margin: 0
was not intentional (I think) so I'll revert that for 2.7.3.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.
Removed in 4dede40
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.
Thanks @Anteru :).
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.
Hi! I'm sorry if I'm a bit too late, but I'm pretty I've introduced the
margin: 0
rule for a reason. Since I've worked on this one some time ago, I'm not sure what exactly was it, but I'd guess it had something to do with making the table and non-table styles look more similar. An alternative might be that it had something to do with highlighting lines/special lines. There was a lot of different combinations of styles and highlight rules etc. and I believemargin: 0
was introduced to make everything work better in regard to some of these combinations.Having said that, if it actually looks better without
margin: 0
and it doesn't break anything else, I'm totally OK with removing this rule :)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.
I can't find the case where it would matter, and it does break various themes -- if you can point me to a problematic case then we can revisit alternative solutions. Ideally theme authors should have a way to override Pygments CSS rules, but for now this seems to be causing too much fallout :(
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.
I tried to add all problematic cases to the test suite :P But while working on this a lot of dependencies came up and it's possible I've changed one thing too many ;) If you could just add a proper test with an explanation/justification, I would be very grateful. Right now, unfortunately, I'm not able to spend any time fixing this or checking why exactly was this change made. Reverting it seems like a good solution, as long as it's documented ;)
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.
Fair enough. I ran a bunch of manual tests and also spot-checked the test cases, and couldn't find a problematic case. Was hoping you'd remember something particularly problematic, but given the feedback we got, it seems that any rule changing the margin will cause more harm than good :(