Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(v2): various improvements for accessibility #2442

Merged
merged 1 commit into from
Mar 23, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default ({children, className: languageClassName, metastring}) => {
{showCopied ? 'Copied' : 'Copy'}
</button>

<code ref={target} className={styles.codeBlockLines} style={style}>
<div ref={target} className={styles.codeBlockLines} style={style}>
{tokens.map((line, i) => {
if (line.length === 1 && line[0].content === '') {
line[0].content = '\n'; // eslint-disable-line no-param-reassign
Expand All @@ -120,7 +120,7 @@ export default ({children, className: languageClassName, metastring}) => {
</div>
);
})}
</code>
</div>
</pre>
)}
</Highlight>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ function DocSidebar(props) {
})}>
<button
aria-label={showResponsiveSidebar ? 'Close Menu' : 'Open Menu'}
aria-haspopup="true"
className="button button--secondary button--sm menu__button"
type="button"
onClick={() => {
Expand All @@ -177,6 +178,7 @@ function DocSidebar(props) {
</span>
) : (
<svg
aria-label="Menu"
className={styles.sidebarMenuIcon}
xmlns="http://www.w3.org/2000/svg"
height={MOBILE_TOGGLE_SIZE}
Expand Down
3 changes: 2 additions & 1 deletion packages/docusaurus-theme-classic/src/theme/Navbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ function Navbar() {
'navbar-sidebar--show': sidebarShown,
[styles.navbarHideable]: hideOnScroll,
[styles.navbarHidden]: !isNavbarVisible,
})}>
})}
role="navigation">
<div className="navbar__inner">
<div className="navbar__items">
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default ({
{showCopied ? 'Copied' : 'Copy'}
</button>

<code ref={target} className={styles.codeBlockLines} style={style}>
<div ref={target} className={styles.codeBlockLines} style={style}>
{tokens.map((line, i) => {
if (line.length === 1 && line[0].content === '') {
line[0].content = '\n'; // eslint-disable-line no-param-reassign
Expand All @@ -139,7 +139,7 @@ export default ({
</div>
);
})}
</code>
</div>
</pre>
)}
</Highlight>
Expand Down
6 changes: 5 additions & 1 deletion website/src/components/ColorGenerator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,11 @@ function ColorGenerator({children, minHeight, url}) {
return (
<div>
<p>
<strong className="margin-right--sm">Primary Color:</strong>{' '}
<label htmlFor="primary_color">
<strong className="margin-right--sm">Primary Color:</strong>
</label>{' '}
<input
id="primary_color"
className={styles.input}
defaultValue={baseColor}
onChange={event => {
Expand Down Expand Up @@ -127,6 +130,7 @@ function ColorGenerator({children, minHeight, url}) {
0
) : (
<input
aria-label={`${variableName} CSS variable name`}
className={styles.input}
type="number"
value={adjustmentInput}
Expand Down