Skip to content

Commit

Permalink
name horizontal scrolling and change impl accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyfast committed Feb 24, 2024
1 parent e7d5835 commit 7c1f4fb
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
2 changes: 1 addition & 1 deletion nbconvert_a11y/templates/a11y/components/settings.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ settings provides multiple screen reader navigation techniques when the dialog i
treegrid
tree".split())}}</li>
{# screen overflow exists for digital magnifier users to follow long horizontal lines of text. #}
<li>{{checkbox("scroll overflow", True)}}</li>
<li>{{checkbox("horizontal scrolling", False)}}</li>
{% set priority = {"Triple A": "AAA","Double A": "AA", "Single A": "A"}%}
<li>{{select("accessibility priority", priority, resources.wcag_priority)}}</li>
<li>{{checkbox("accesskey navigation", True)}}</li>
Expand Down
4 changes: 2 additions & 2 deletions nbconvert_a11y/templates/a11y/static/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ document.forms.visibility['visually-hide'].addEventListener("change",
document.querySelector("main").classList.toggle("visually-hide");
activityLog(`${event.target.checked ? "hiding" : "showing"} main content`);
});
document.forms.settings['scroll-overflow'].addEventListener("change",
document.forms.settings['horizontal-scrolling'].addEventListener("change",
(x) => {
document.querySelector("main").classList.toggle("no-overflow");
BODY.classList.toggle("horiz-overflow", event.target.checked);
// activityLog(`${event.target.checked ? "overflow scrol" : "showing"} main content`);
});

Expand Down
34 changes: 28 additions & 6 deletions nbconvert_a11y/templates/a11y/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ the variables specify critical degrees of freedom in the notebook style.
## notebook interface specific css variables
*/

:root {
--nb-focus-width: 3px;
--nb-accent-color: auto;
--nb-background-color-dark: #2b2a33;
--nb-background-color-light: #FFFFFF;
--nb-margin: 5%;
--nb-font-size: 16px;
--nb-font-family: serif;
--nb-line-height: 1.5;
--nb-scrolled-height: 600px;
--color-light: #FFFFFF;
--color-dark: #2b2a33;
}


/* map css variables to css properties on the `body` elements.
this mapping turns out css variables into user interfaces. */

Expand All @@ -31,6 +31,22 @@ body {
margin-right: var(--nb-margin);
line-height: var(--nb-line-height);
width: calc(100% - 2*var(--nb-margin));
color: var(--color-dark);
background-color: var(--color-light);
}

body.dark {
color: var(--color-light);
background-color: var(--color-dark);
}

main:fullscreen {
overflow: auto;
background: var(--color-light);
}

.dark main:fullscreen {
background: var(--color-dark);
}

/* ## notebook settings
Expand Down Expand Up @@ -182,13 +198,19 @@ td.nb-source {
overflow-x: auto;
}

.no-overflow td.nb-source {
.horiz-overflow td.nb-outputs,
.horiz-overflow header,
.horiz-overflow footer
{
width: max-content;
}

.horiz-overflow td.nb-source {
overflow-x: visible;
}

.no-overflow td.nb-outputs {
.horiz-overflow td.nb-outputs {
min-width: 100%;
width: max-content;
}

#nb-settings li::marker,
Expand Down

0 comments on commit 7c1f4fb

Please sign in to comment.