File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 <meta itemprop="url" content="<txp:site_url />">
33 <form role="search" method="get" action="<txp:site_url />" itemprop="potentialAction" itemscope itemtype="https://schema.org/SearchAction">
44 <meta itemprop="target" content="<txp:site_url />?q={q}">
5- <input name="q" type="search" itemprop="query-input" placeholder="<txp:text item="search" />"<txp:if_search> value="<txp:search_term />"</txp:if_search>>
5+ <label class="accessibility" for="search"><txp:text item="search" /></label>
6+ <input id="search" name="q" type="search" itemprop="query-input" placeholder="<txp:text item="search" />"<txp:if_search> value="<txp:search_term />"</txp:if_search>>
67 </form>
78</div>
Original file line number Diff line number Diff line change @@ -172,6 +172,25 @@ nav ol::after,
172172 word-wrap : break-word;
173173 }
174174
175+ /**
176+ * Hide text but still allow screen reader access.
177+ *
178+ * Example HTML:
179+ *
180+ * <p class="accessibility">
181+ */
182+ .accessibility {
183+ position : absolute;
184+ width : 1px ;
185+ height : 1px ;
186+ margin : -1px ;
187+ padding : 0 ;
188+ overflow : hidden;
189+ clip : rect (0 0 0 0 );
190+ border : 0 ;
191+ white-space : nowrap;
192+ }
193+
175194 /* Navigation
176195 ========================================================================== */
177196 /**
Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ <h3>My site slogan</h3>
3333 < meta itemprop ="url " content ="https://example.com/ ">
3434 < form role ="search " method ="get " action ="# " itemprop ="potentialAction " itemscope itemtype ="https://schema.org/SearchAction ">
3535 < meta itemprop ="target " content ="https://example.com/?q={q} ">
36- < input name ="q " type ="search " itemprop ="query-input " placeholder ="Search ">
36+ < label class ="accessibility " for ="search "> < txp:text item ="search " /> </ label >
37+ < input id ="search " name ="q " type ="search " itemprop ="query-input " placeholder ="Search ">
3738 </ form >
3839 </ div >
3940 </ div >
Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ <h3>My site slogan</h3>
3333 < meta itemprop ="url " content ="https://example.com/ ">
3434 < form role ="search " method ="get " action ="# " itemprop ="potentialAction " itemscope itemtype ="https://schema.org/SearchAction ">
3535 < meta itemprop ="target " content ="https://example.com/?q={q} ">
36- < input name ="q " type ="search " itemprop ="query-input " placeholder ="Search ">
36+ < label class ="accessibility " for ="search "> < txp:text item ="search " /> </ label >
37+ < input id ="search " name ="q " type ="search " itemprop ="query-input " placeholder ="Search ">
3738 </ form >
3839 </ div >
3940 </ div >
Original file line number Diff line number Diff line change @@ -119,3 +119,24 @@ body {
119119 /* 1 */
120120 word-wrap : break-word ;
121121}
122+
123+ /* *
124+ * Hide text but still allow screen reader access.
125+ *
126+ * Example HTML:
127+ *
128+ * <p class="accessibility">
129+ */
130+
131+ .accessibility {
132+ position : absolute ;
133+ width : 1px ;
134+ height : 1px ;
135+ margin : -1px ;
136+ padding : 0 ;
137+ overflow : hidden ;
138+ clip : rect (0 0 0 0 ); // TODO: Deprecated, use `clip-path` when IE11 dropped.
139+ // clip-path: inset(50%);
140+ border : 0 ;
141+ white-space : nowrap ;
142+ }
Original file line number Diff line number Diff line change 22 <meta itemprop="url" content="<txp:site_url />">
33 <form role="search" method="get" action="<txp:site_url />" itemprop="potentialAction" itemscope itemtype="https://schema.org/SearchAction">
44 <meta itemprop="target" content="<txp:site_url />?q={q}">
5- <input name="q" type="search" itemprop="query-input" placeholder="<txp:text item="search" />"<txp:if_search> value="<txp:search_term />"</txp:if_search>>
5+ <label class="accessibility" for="search"><txp:text item="search" /></label>
6+ <input id="search" name="q" type="search" itemprop="query-input" placeholder="<txp:text item="search" />"<txp:if_search> value="<txp:search_term />"</txp:if_search>>
67 </form>
78</div>
You can’t perform that action at this time.
0 commit comments