Skip to content

Commit 2a672b9

Browse files
authored
Core-1308: Highlight markers have textContent (#2641)
[CORE-1308] Hide data-for-screenreaders
1 parent 13b26d0 commit 2a672b9

5 files changed

Lines changed: 47 additions & 51 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"@craco/craco": "<7",
1010
"@formatjs/intl-pluralrules": "^5.2.3",
1111
"@openstax/event-capture-client": "^2.0.2",
12-
"@openstax/highlighter": "https://github.com/openstax/highlighter#1.16.3",
12+
"@openstax/highlighter": "https://github.com/openstax/highlighter#1.16.4b",
1313
"@openstax/open-search-client": "0.1.0-build.7",
1414
"@openstax/ts-utils": "1.19.0",
1515
"@openstax/ui-components": "openstax/ui-components#1.14.0",

src/app/content/__snapshots__/routes.spec.tsx.snap

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,19 @@ Array [
550550
transform: rotate(90deg);
551551
}
552552
553+
.c4 [data-for-screenreaders="true"] {
554+
position: absolute;
555+
width: 1px;
556+
height: 1px;
557+
padding: 0;
558+
margin: -1px;
559+
overflow: hidden;
560+
-webkit-clip: rect(0,0,0,0);
561+
clip: rect(0,0,0,0);
562+
white-space: nowrap;
563+
border: 0;
564+
}
565+
553566
.c4 .os-figure,
554567
.c4 .os-figure:last-child {
555568
margin-bottom: 5px;
@@ -730,20 +743,6 @@ Array [
730743
.c4 .search-highlight[aria-current] .search-highlight {
731744
background-color: unset;
732745
}
733-
734-
.c4 .search-highlight [data-for-screenreaders="true"]::before {
735-
content: attr(data-message);
736-
position: absolute;
737-
width: 1px;
738-
height: 1px;
739-
padding: 0;
740-
margin: -1px;
741-
overflow: hidden;
742-
-webkit-clip: rect(0,0,0,0);
743-
clip: rect(0,0,0,0);
744-
white-space: nowrap;
745-
border: 0;
746-
}
747746
}
748747
749748
@media screen and (max-width:90em) {

src/app/content/components/Page/PageContent.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,13 @@ export default styled(MainContent)`
181181
background-color: unset;
182182
}
183183
}
184-
185-
[data-for-screenreaders="true"]::before {
186-
content: attr(data-message);
187-
${hiddenButAccessible}
188-
}
189184
}
190185
}
191186
187+
[data-for-screenreaders="true"] {
188+
${hiddenButAccessible}
189+
}
190+
192191
.os-figure,
193192
.os-figure:last-child {
194193
margin-bottom: 5px; /* fix double scrollbar bug */

src/app/content/components/__snapshots__/Content.spec.tsx.snap

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,19 @@ Array [
976976
transform: rotate(90deg);
977977
}
978978

979+
.c73 [data-for-screenreaders="true"] {
980+
position: absolute;
981+
width: 1px;
982+
height: 1px;
983+
padding: 0;
984+
margin: -1px;
985+
overflow: hidden;
986+
-webkit-clip: rect(0,0,0,0);
987+
clip: rect(0,0,0,0);
988+
white-space: nowrap;
989+
border: 0;
990+
}
991+
979992
.c73 .os-figure,
980993
.c73 .os-figure:last-child {
981994
margin-bottom: 5px;
@@ -2387,20 +2400,6 @@ Array [
23872400
.c73 .search-highlight[aria-current] .search-highlight {
23882401
background-color: unset;
23892402
}
2390-
2391-
.c73 .search-highlight [data-for-screenreaders="true"]::before {
2392-
content: attr(data-message);
2393-
position: absolute;
2394-
width: 1px;
2395-
height: 1px;
2396-
padding: 0;
2397-
margin: -1px;
2398-
overflow: hidden;
2399-
-webkit-clip: rect(0,0,0,0);
2400-
clip: rect(0,0,0,0);
2401-
white-space: nowrap;
2402-
border: 0;
2403-
}
24042403
}
24052404

24062405
@media screen and (max-width:50em) {
@@ -8288,6 +8287,19 @@ Array [
82888287
transform: rotate(90deg);
82898288
}
82908289

8290+
.c73 [data-for-screenreaders="true"] {
8291+
position: absolute;
8292+
width: 1px;
8293+
height: 1px;
8294+
padding: 0;
8295+
margin: -1px;
8296+
overflow: hidden;
8297+
-webkit-clip: rect(0,0,0,0);
8298+
clip: rect(0,0,0,0);
8299+
white-space: nowrap;
8300+
border: 0;
8301+
}
8302+
82918303
.c73 .os-figure,
82928304
.c73 .os-figure:last-child {
82938305
margin-bottom: 5px;
@@ -9546,20 +9558,6 @@ Array [
95469558
.c73 .search-highlight[aria-current] .search-highlight {
95479559
background-color: unset;
95489560
}
9549-
9550-
.c73 .search-highlight [data-for-screenreaders="true"]::before {
9551-
content: attr(data-message);
9552-
position: absolute;
9553-
width: 1px;
9554-
height: 1px;
9555-
padding: 0;
9556-
margin: -1px;
9557-
overflow: hidden;
9558-
-webkit-clip: rect(0,0,0,0);
9559-
clip: rect(0,0,0,0);
9560-
white-space: nowrap;
9561-
border: 0;
9562-
}
95639561
}
95649562

95659563
@media screen and (max-width:50em) {

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5259,9 +5259,9 @@
52595259
dependencies:
52605260
uuid "^8.3.2"
52615261

5262-
"@openstax/highlighter@https://github.com/openstax/highlighter#1.16.3":
5263-
version "1.16.3"
5264-
resolved "https://github.com/openstax/highlighter#500e0bc4331267c2b565c04c5856eefc3415acf5"
5262+
"@openstax/highlighter@https://github.com/openstax/highlighter#1.16.4b":
5263+
version "1.16.4"
5264+
resolved "https://github.com/openstax/highlighter#702b3c1241106505240df188b3113b92d29dca5b"
52655265
dependencies:
52665266
"@openstax/highlights-client" "0.2.3"
52675267
change-case "^4.0.0"

0 commit comments

Comments
 (0)