-
-
Notifications
You must be signed in to change notification settings - Fork 1k
style(docs): improve table readability #2129
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
base: main
Are you sure you want to change the base?
style(docs): improve table readability #2129
Conversation
margin-bottom: 10.5em; | ||
box-shadow: 0 1px 3px rgba(0,0,0,0.1); | ||
} | ||
table.docutils td, table.docutils th { |
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.
Could you fix the indentation on these rules?
table.docutils { | ||
border-collapse: collapse; | ||
margin-bottom: 10.5em; | ||
box-shadow: 0 1px 3px rgba(0,0,0,0.1); |
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.
Could you make the spacing with the rgba
call consistent with the rest of the file?
table.docutils tr:hover { | ||
background-color: var(--selection); | ||
} | ||
|
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.
Could you remove the extra blank line here? It looks like sections in this file are separated by a single blank line, not two.
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 and thanks for working on this. I think it's an improvement in general, but there are a few things I'm not so sure about:
- The hover color is a bit too colorful I think, and it makes text selection invisible inside the table. Also the contrast with the text color in dark mode is not great.
- The alternating background colors are a nice touch in light mode, but on my screen I barely see a difference in dark mode.
Other than these stylistic questions which might come down to personal taste (I'm open to hear what others think about it), there are a few issues with the code itself which I've marked.
Thanks again! 🎸
border-bottom: 1px solid var(--hairline-color); | ||
} | ||
table.docutils { | ||
border-collapse: collapse; |
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.
border-collapse: collapse
is already the default for this element, I don't think we need to repeat it.
} | ||
table.docutils { | ||
border-collapse: collapse; | ||
margin-bottom: 10.5em; |
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.
That margin is way too big, did you mean 1.5em
?
table.docutils { | ||
border-collapse: collapse; | ||
margin-bottom: 10.5em; | ||
box-shadow: 0 1px 3px rgba(0,0,0,0.1); |
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.
What's the rationale behind adding a box-shadow
here? Unless I'm mistaken there are no other elements in the documentation that use a box shadow, right?
table.docutils td, table.docutils th { | ||
border-bottom: 1px solid #ccc; | ||
padding: 8px 12px; | ||
line-height: 1.4; |
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.
What's the purpose of this rule? Disabling it doesn't seem to have much visual effect (it seems to reduce the height of the cell by ~1px). Is it related to the padding you added? If so, what's the relationship between the two values?
margin-bottom: 10.5em; | ||
box-shadow: 0 1px 3px rgba(0,0,0,0.1); | ||
} | ||
table.docutils td, table.docutils th { |
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.
Can you use nesting to avoid having to repeat table.docutils
?
table.docutils {
/* rules for <table> */
td, th {
/* rules for cells */
}
...
}
box-shadow: 0 1px 3px rgba(0,0,0,0.1); | ||
} | ||
table.docutils td, table.docutils th { | ||
border-bottom: 1px solid #ccc; |
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.
Can we use a theme color (see _utils.scss
in the same folder) instead of hardcoding #ccc
?
border-bottom: 1px solid #ccc; | |
border-bottom: 1px solid $gray-medium; |
} | ||
table.docutils thead th { | ||
background-color: var(--code-bg); | ||
border-bottom: 2px solid #999; |
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.
Can we use a theme color here too, maybe $gray-dark
?
@bmispelon Thank you for the review. I will make the necessary changes. |
Summary
This PR improves the readability and visual appeal of tables in Django documentation. Specifically, it addresses the following issue( #2128):
20250716-0802-23.5769416.mp4
20250716-0831-05.0014901.mp4