Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Style callout delimiters in discussion for HTML output #282

Merged
merged 3 commits into from
Jun 1, 2021
Merged

Conversation

mattt
Copy link
Contributor

@mattt mattt commented May 18, 2021

Fixes #281

This PR adopts the following color coding for annotation types, but I'm very much open to changing this around:

  • Error (bug): Pink
  • Warning (attention, important, warning): Orange
  • Metadata (author[s], copyright, date): Gray
  • Informational (everything else): Blue

This 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

Copy link
Member

@Lukas-Stuehrk Lukas-Stuehrk left a 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)

@mattt
Copy link
Contributor Author

mattt commented Jun 1, 2021

@Lukas-Stuehrk Thanks for pointing out the contrast ratios for that and suggesting more accessible alternatives. These look a lot more reasonable:

Screen Shot 2021-06-01 at 11 36 09

@mattt mattt force-pushed the style-callouts branch from cd0797d to a188b4a Compare June 1, 2021 18:37
@mattt mattt requested a review from Lukas-Stuehrk June 1, 2021 18:37
@mattt
Copy link
Contributor Author

mattt commented Jun 1, 2021

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:

@mattt mattt merged commit 6d338d2 into master Jun 1, 2021
@mattt mattt deleted the style-callouts branch June 1, 2021 20:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add designs to accommodate all types of callout in discussion in HTML output
2 participants