Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions contentScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ function appendAccessibilityInfo() {
if (!altText) {
image.classList.add('github-a11y-img-missing-alt')
} else {
const closestParagraph = image.closest('p');
if (!closestParagraph) return;
const parentElement = image.parentElement;
if (!parentElement) return;

closestParagraph.classList.add('github-a11y-img-container');
parentElement.classList.add('github-a11y-img-container');

const subtitle = document.createElement('span');
subtitle.setAttribute('aria-hidden', 'true');
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"version": "0.3",
"content_scripts": [
{
"matches": ["https://*.github.com/*"],
"matches": ["https://github.com/*", "https://gist.github.com/*"],
"css": ["styles.css"],
"js": ["contentScript.js"]

Expand All @@ -15,5 +15,5 @@
"background": {
"scripts": ["background.js"]
},
"permissions": ["*://*.github.com/*", "tabs", "webNavigation"]
"permissions": ["*://github.com/*", "https://gist.github.com/*", "tabs", "webNavigation"]
}
20 changes: 10 additions & 10 deletions styles.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/* For image overlay positioning */
.github-a11y-img-container {
position: relative;
padding: 0;
margin: 0;
display: inline-block;
vertical-align: top;
border: 2px solid grey;
}

/* Styling for when image is missing alt text */
.github-a11y-img-missing-alt {
border: 10px solid red;
border: 5px solid red;
}

/* Styling for image overlay */
Expand All @@ -16,14 +16,13 @@
background-color: #121212;
padding: 0.5em;
color: white;
position: absolute;
bottom: 0.5em;
left: 0;
/* bottom: 0.5em;
left: 0; */
font-weight: 700;
z-index: 2;
width: 100%;
font-size: 1.0rem;
opacity: 0.6;
width: 100%;
font-size: 0.8rem;
opacity: 0.8;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes font size smaller. Also, sets opacity to 0.8 because 0.6 is too low color contrast.

}

/* Styling for heading level text. */
Expand All @@ -36,6 +35,7 @@
display: table;
width: 100%;
}

.github-a11y-heading-prefix-after {
display: table-cell;
text-align: right;
Expand Down