docs icon indicating copy to clipboard operation
docs copied to clipboard

Color change labels

Open cmwilson21 opened this issue 2 years ago • 6 comments

Why:

Closes 15989

What's being changed:

After much digging and trial and error runs, three files have been changed. The code-examples.yml file has been updated so that each tag has a name and a color designated to it. The ProductLandingContext.tsx has been changed to reflect that tags attribute is no longer an array of strings, but an array of objects that are strings. The CodeExampleCard.tsx has been changed so that the map on line 23 returns a Label that includes the tag.color for the background style, and the tag.name for the actual name of the Label.

Screen Shot 2022-04-19 at 11 26 04 AM

Screen Shot 2022-04-19 at 11 26 18 AM

Check off the following:

  • [x] I have reviewed my changes in staging (look for "Automatically generated comment" and click Modified to view your latest changes).
  • [x] For content changes, I have completed the self-review checklist.

Writer impact (This section is for GitHub staff members only):

  • [ ] This pull request impacts the contribution experience
    • [ ] I have added the 'writer impact' label
    • [ ] I have added a description and/or a video demo of the changes below (e.g. a "before and after video")

cmwilson21 avatar Apr 19 '22 16:04 cmwilson21

@cmwilson21 Thanks so much for opening a PR! I'll get this triaged for review :zap:

ramyaparimi avatar Apr 19 '22 17:04 ramyaparimi

Thanks so much @cmwilson21 🙇 ! Curious if you have any thoughts on this one @joeoak? I ask because we somewhat recently removed colors from the release notes pages (e.g. https://docs.github.com/en/[email protected]/admin/release-notes -- the headings like Security fixes and Bug fixes used to be color coded but we were advised to remove the colors by the design folks).

Also going back to the issue I see the suggestion mentions:

Some visual identifier for different types of examples, so it's clearer what people will see when they click on an item.

I guess a question is does the different colored labels make it clearer what you're getting when you click on an item?

rsese avatar Apr 20 '22 18:04 rsese

Thanks for the @mention @rsese.

  • Let me track down information on the recommendation to remove color coding from headers on the release notes page.
    • I suspect these are different issues and that applying colors to labels is ok (e.g. https://primer.style/react/Label).
    • [Update] Found the Figma file for this recommendation
      • Looks like the recommendation was to avoid applying color to text rather than discouraging the use of color coding overall.
  • I think these labels are helpful indicators - but perhaps more in categorization/showing which examples are related?

Also reminds me of the label UI in search:

image

joeoak avatar Apr 20 '22 20:04 joeoak

  • I think these labels are helpful indicators - but perhaps more in categorization/showing which examples are related?

hmm yeah it does seem like if showing related examples was the intent, then the colors could be useful? But since the issue asked if there was a way to make it clear what kind of example people will get before clicking on it, I wonder if there's some other approach we could take 🤔

  • Looks like the recommendation was to avoid applying color to text rather than discouraging the use of color coding overall.

ahh right I vaguely remember some of the discussion and I think we also talked about how the color choices can be kinda arbitrary and aren't necessarily aligned with something (e.g. why color X for this category?) and wouldn't be consistent across the docs/product?

rsese avatar Apr 25 '22 16:04 rsese

Hm, so I've been working with @cmwilson21 on this, and I have couple things (all non blocking this PR):

  1. I think the different color labels are nice, and I think it still somewhat aligns with the rest of .com. As seen here we seem to be using colors to differentiate between languages: Screen Shot 2022-04-29 at 2 08 40 PM

In terms of what the colors represents, and why Go is Blue, I don't know the reason.

  1. We should also do the same to the Search label as @joeoak pointed out in a followup! I completely forgot about those.

  2. It might be a good idea to revisit the colors in a follow up as well - for example, Security advisory makes sense that it is red , but should be bundle the colors? Maybe everything in the category of security would be red, like CodeQL and Security Policy? Just a suggestion since there are quite a few colors, and maybe bundling could give the colors a bit more meaning beyond just distinction.

  3. In terms of showing the user what kind of examples these are, I agree with @rsese that we might want to rethink this section and possibly come up with a different approach that's more obvious for users.

gracepark avatar Apr 29 '22 21:04 gracepark

@gracepark FYI the language colors come from @github/linguist

janbrasna avatar May 15 '22 13:05 janbrasna

I'm going to close this PR! Priorities shifted and we moved away from this work ❤️

janiceilene avatar Jan 25 '24 13:01 janiceilene