티스토리 수익 글 보기
Navigation Menu
-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Refs #34038 — Improve link readability and identifiability #17419
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
Conversation
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.
Hello! Thank you for your contribution 💪
As it’s your first contribution be sure to check out the patch review checklist.
If you’re fixing a ticket from Trac make sure to set the “Has patch” flag and include a link to this PR in the ticket!
If you have any design or process questions then you can ask in the Django forum.
Welcome aboard ⛵️!
🖼️ Screenshots created You can download the generated screenshots from the workflow artifacts. Please note that artifacts are only available for download for 90 days.
|
Thank you for this! If you like, you can add a screenshot within the |
@sarahboyce done, PTAL 😄 |
Thank you @yushanfans2233! This looks right but for some reason I can’t see another screenshot generated 🤔 can you run the new selenium test with screenshots locally (https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/#running-the-selenium-tests) and see if it created screenshots? |
I ran the command
|
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.
Needs a review from the accessibility team but this looks good to me ⭐
Thanks for your help, really appreciate it 😸 . |
with self.wait_page_loaded(): | ||
self.selenium.get(self.live_server_url + change_url) | ||
|
||
self.take_screenshot("user_change") |
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.
This test doesn’t have any assertions. Instead I’d add take_screenshot
to one of existing tests, e.g. UserAdminTest.test_save_button()
.
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.
UserAdminTest
is not a AdminSeleniumTestCase
, I can’t take screenshot in it.
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.
Looks good! Thank you for your contribution @yushanfans2233 😄
I just add a comment for the accessibility team
color: var(—body-fg); | ||
text-decoration: none; | ||
color: var(—link-fg); | ||
text-decoration: underline; |
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.
@knyghty @thibaudcolas I have one concern about this change, I haven’t tested this change yet and can’t see the screenshot on my phone, but it got me thinking about titles that can also be links, are they also considered underlined or just the content?
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.
As far as I’m aware, all links in the admin will be underlined, so this is a big UI change.
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.
Argh, sorry I should have rephrase, I wanted to say : “do we want them also underlined or just the content?”
I don’t know if it’s already the case according the style, but yes all links in the admin will be underlined as you said, but I think we should agree on what we want before to merge this PR
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 for the work here, it’s definitely needed. Also sorry for the delay.
Clearly the accessibility of the links in the body is improved. I think we do need some overrides though. The main one is that buttons that act as links are currently underlined, e.g. the “delete” button and the “Add Foo” button on the list page as well as the view on site and history buttons.
There are some where I’m less certain. For example the title text (default “Django administration” probably doesn’t need to be underlined. I’d also argue that the links in the navigation sidebar don’t really need to be underlined, either. But again, interested in a second opinion here.
I also see a link that should be underlined, but isn’t:

I think unrelated to this PR, but I also notice the log out link in the header has a fainter underline than the rest of the links, because it’s using border-bottom
rather than text-decoration
:

Here are two alternative solutions: Solution 1Apply an underline and blue color to all
Solution 2Introduce a new CSS class called
|
@yushanfans2233 personally I’d give option 1 a go. It’s better to accidentally add an underline to something than it is to accidentally forget one, and if there are any they can be fixed over time as they’re noticed. |
Main points: 1. The <a> element should be colored and underlined to indicate its ability to navigate to a new page or an anchor within the current page. 2.The <a> element, when used as a button or resembling a button, should not be colored and underlined.
Hello everyone, I have made some necessary fixes based on the following principles:
|
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.
One thing I’m not sure about. Maybe it’s fine as it is or maybe not.
At the moment the filters don’t have underline, and the only blue ones are the active filters. Clearly we need to show which filter is active. I’m just not sure which is best. Maybe it’s fine how it is, but it is a bit hard to discern the text there are links.

The Today and Now controls also need something but not sure what. At the moment it’s very unclear you can interact with them. But they don’t really act like links to other pages, they are more like buttons. Again, not sure the best way forward here:

Any news on this PR? We also need that =( |
As per the latest activity, it seems that this PR needs a review from the @django/accessibility team. |
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.
We had a good chat about this at our latest @django/accessibility meeting.
We agreed that for now, we should just fix the colours and not add the underline.
We should still do the underline part, but as a new ticket, because:
- The changes can easily be done separately.
- Because of the difficulty in deciding what should and shouldn’t be underlined, it’s better to get the less contentious change out first.
Thank you @knyghty. I agree that separating the link color change from the underlining work is a good path forward. Therefore I recommend:
What do you think? |
@nessita sounds good on my end |
Dear Django community, I regret to inform you that due to my current busy schedule, I am unable to continue working on this PR for the time being. However, please know that I remain eager to assist if needed on any other project within the community. Thank you for your understanding. |
No worries @yushanfans2233, we appreciate everything you have done so far! Thank you for letting us know. |
Light
Before
After
Dark
Before
After