-
Notifications
You must be signed in to change notification settings - Fork 97
Style callout delimiters in discussion for HTML output #282
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.
Nice addition, @mattt. This is one of the features where you immediately realise how much this was missing before! This makes the use of callouts so much clearer and useful – and also more familiar for users of Apple's documentations.
I think we should change the color values a little bit. I find the general color scheme and which color is used good and reasonable. But for all three callout styles, the rendered text has a contrast ratio to its background of 1 or slightly above. This is not very nice for people with visual impairment. We should try to go with a contrast ratio of at least 4.5.
My suggestion: We can separate the text color and the color of the left border ("accent"). We keep the accent colors with the values of this pull request. And for the text we go with a black that contains some parts of the accent color, so for example:
- text for pink: rgb(78, 0, 41)
- text for orange: rgb(76, 37, 2)
- text for gray: rgb(51, 51, 51)
- text for blue: rgb(0, 0, 73)
@Lukas-Stuehrk Thanks for pointing out the contrast ratios for that and suggesting more accessible alternatives. These look a lot more reasonable:
cd0797d
to
a188b4a
Compare
Still some room for improvement, possibly using text shadows to preserve contrast without compromising the color palette as much. And some work to do to make this work with dark mode (#160 I know, sorry for the delay 🙇). But I think this is good enough for now. :shipit:
Uh oh!
There was an error while loading. Please reload this page.
Fixes #281
This PR adopts the following color coding for annotation types, but I'm very much open to changing this around:
bug
): Pinkattention
,important
,warning
): Orangeauthor[s]
,copyright
,date
): GrayThis doesn't handle custom callouts, but those are Xcode Playgrounds-specific, and the default rendering is good enough.
Screen Shot 2021年05月18日 at 10 20 51
Screen Shot 2021年05月18日 at 10 20 33
Screen Shot 2021年05月18日 at 10 21 00
Screen Shot 2021年05月18日 at 10 20 25