You can help users locate elements of the user interface that are difficult to find by adding screenshots to GitHub Docs.
About screenshots in GitHub DocsThere are positives and negatives to adding a screenshot. Screenshots make articles more visually scannable and make instructions easier to understand, especially for people who have difficulty reading. When supplied with alt text, screenshots help blind and low-vision users collaborate with sighted colleagues.
On the other hand, screenshots privilege sighted users, add length and load time to articles, and increase the volume of content that needs to be maintained. When captured at different pixel dimensions and degrees of zoom than the reader is using, screenshots can be confusing.
Therefore, we only add screenshots to GitHub Docs when they meet our criteria for inclusion.
Criteria for including a screenshotUse a screenshot to complement text instructions when an element of the user interface (UI) is hard to find:
Do not use screenshots for procedural steps where text alone is clear, or to show code commands or outputs.
Examples of the criteria for inclusionTo help you determine whether to add a specific screenshot, consider the following examples of screenshots that do and do not meet our criteria for inclusion.
Screenshots that meet the criteriaThe following screenshots do meet our criteria for inclusion.
The UI element is small or visually subtleThe edit button for a repository's social media preview image is small and visually unobtrusive. It may be hard to find among the other repository settings.
The screenshot also gives a visual reference for the aspect ratio required.
The UI element is not immediately visibleOptions to clone a gist are contained under a dropdown menu labeled "Embed."
The screenshot is helpful to locate the correct option in the menu, which is not visible until the dropdown is opened.
The interface has multiple choices that can cause confusionThere are three elements that could be interpreted as "settings" on the main page for a repository: the "Settings" tab, the gear icon in the "About" section of the right sidebar, and the account settings accessed via the profile picture.
The screenshot is helpful to find the correct option.
Screenshots that do not meet the criteriaThe following screenshots do not meet our criteria for inclusion.
The UI element is easy to findThe "Create repository" button is visually prominent through size, color, and placement. There are few competing choices.
Text instructions are adequate to help the user complete the step.
The UI has few, straightforward choicesSimple and straightforward options, such as selecting or deselecting a checkbox, do not need a visual support.
Text instructions are adequate to help the user complete the step.
There are also two accessibility implications of including the full sentence of text below the checkbox in the screenshot:
In addition to the criteria for inclusion, screenshots must meet the following requirements.
Technical specificationsgist-embed-link.png
instead of right_side_page_03.png
To meet the needs of more users, screenshots must:
@octocat
and to replace the URL of your avatar with https://avatars.githubusercontent.com/u/583231?v=4
.If the primary goal in showing a dropdown menu is to help the reader locate the menu itself, show the menu closed.
If the primary goal in showing a dropdown menu is to help the reader distinguish among options within the menu, show the menu open. Capture open menus without focus (cursor or hover state). Showing menu items with a white background ensures contrast with the dark orange outline, where present.
Highlighting elements in screenshotsTo highlight a specific UI element in a screenshot, use our special theme for Snagit to apply a contrasting stroke around the element.
The stroke is the color fg.severe
in the Primer Design System (HEX #BC4C00 or RGB 188, 76, 0). This dark orange has good color contrast on both white and black. To check contrast on other background colors, use the Color Contrast Analyzer.
To download the Snagit theme, navigate to snagit-theme-github-docs.snagtheme
in the github/docs
repository, then click .
Open Snagit, then select the Shape tool.
Under "Quick styles," select Import.
Select the Snagit theme from your computer's files. This will install the shape preset.
Optionally, to add the theme to your favorites, star the dark orange rectangle.
Open a screenshot in Snagit.
To set pixel depth (resolution) and pixel width, below the image canvas, open the "Resize image" dialog.
Pixel depth: 144dpi (equivalent to "2x" on Snagit for Mac)
Pixel width: 1000 pixels maximum
Note
On Windows, you may need to select Advanced to change the resolution. Ensure Use resampling is disabled.
With the GitHub Docs theme open in the Shapes sidebar, select the dark orange rectangle.
Drag and drop across the image to create a rectangle.
Adjust the rectangle's height and width by dragging edges. Do not adjust the corner rounding, which should remain 4 px. Adjust the space between the UI element and the stroke so it's about the width of the stroke itself.
Export image to PNG.
Note
A bug in Snagit may corrupt the corner rounding, causing rectangles to become ovals. If this occurs, delete and reinstall the GitHub Docs theme (Windows and Mac), or click and drag the yellow dot at the top right of the shape to reset corner rounding to 4 px (Mac only).
Replacing screenshotsWhen replacing an existing image, best practice is to retain the image's filename.
If you must change an image filename, search the repository for other references to that image and update all references to the original filename.
If the image is used in documentation for versions of GitHub Enterprise Server that are closing down, don't change the filename.
Versioning images in Markdown contentSome images apply to all GitHub plans (GitHub Free, GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server). In this case, there is no versioning required.
When an image does differ from plan to plan, or changes in a newer release of GitHub Enterprise Server, the image need to be versioned with Liquid conditional statements. You may need to add this versioning when the content is initially created, or you may need to add it when the content is updated for a feature update or GitHub Enterprise Server release.
Image locationsImages are located in the /assets/images
directory. This directory has some sub-directories that can be used to organize content by plan and release number.
/assets/images
Images that are not specific to any GitHub Enterprise product. /assets/images/enterprise/enterprise-server
Images that are applicable to all releases of GitHub Enterprise Server (GHES), or are applicable to the current release and future releases. /assets/images/enterprise/<release number>
, such as /assets/images/enterprise/3.0/
When an image is changed in a new GHES release, add the new image to the original location, and move the old image to the directory corresponding to the latest release that the image applies to. Example: An image differs between plans
When there are differences between plans, you can use Liquid conditionals to version the two images.
{% ifversion fpt or ghec %}

{% else %}

{% endif %}
Example: An image is updated in a new GitHub Enterprise Server release
If an image will change for GitHub Enterprise Server 3.10, and the updated image will be used for all future versions of GitHub Enterprise Server, move the existing image to /assets/images/enterprise/3.10
, then add the new image to the original location, /assets/images/enterprise/foo/bar.png
.
Your Liquid conditional would look like this:
{% ifversion fpt or ghec %}

{% elsif ghes < 3.10 %}

{% else %}

{% endif %}
When the 3.10 release is closing down, the /assets/images/enterprise/3.10
directory will be removed.
The numbered release directory should contain images that apply to that release number only or to that release number and earlier. For example, images in /assets/images/enterprise/2.22
should contain images that apply to 2.22 only or 2.22 and earlier.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4