File tree Expand file tree Collapse file tree 8 files changed +479
-129
lines changed
lib/components/navigation Expand file tree Collapse file tree 8 files changed +479
-129
lines changed Original file line number Diff line number Diff line change 30
30
"applies" : " Child of <code class=\" stacks-code\" >.s-navigation</code>" ,
31
31
"description" : " The individual pill-shaped link in a navigation"
32
32
},
33
+ {
34
+ "class" : " .s-navigation--item-text" ,
35
+ "applies" : " Child of <code class=\" stacks-code\" >.s-navigation--item</code>" ,
36
+ "description" : " The element meant to contain the text of the navigation item"
37
+ },
33
38
{
34
39
"class" : " .is-selected" ,
35
40
"applies" : " <code class=\" stacks-code\" >.s-navigation--item</code>" ,
Original file line number Diff line number Diff line change 9
9
10
10
{% if site-navigation %}
11
11
< nav aria-label ="Global " class ="sm:d-none ">
12
- < ul class ="s-navigation ml8 fw-nowrap sm:d-none ">
12
+ < ul class ="s-navigation ml8 fw-nowrap ">
13
13
{% assign slug = page.url | replace:'/',' ' | truncatewords: 2 | remove:'...' %}
14
14
15
15
{% for section in site-navigation.sections %}
16
16
{% assign url = section.url | replace:'/',' ' | truncatewords: 2 | remove:'...' %}
17
- < li > < a class ="s-navigation--item{% if url == slug %} is-selected{% endif %} " href ="{{ section.url }} " {% if url == slug %} aria-current ="page "{% endif %} > {{ section.title }}</ a > </ li >
17
+ < li >
18
+ < a class ="s-navigation--item{% if url == slug %} is-selected{% endif %} " href ="{{ section.url }} " {% if url == slug %} aria-current ="page "{% endif %} >
19
+ < span class ="s-navigation--item-text " data-text ="{{ section.title }} "> {{ section.title }}</ span >
20
+ </ a >
21
+ </ li >
18
22
{% endfor %}
19
23
</ ul >
20
24
</ nav >
Original file line number Diff line number Diff line change 3
3
< div class ="d-none sm:d-block ">
4
4
< div class ="d-flex fd-column ai-center ">
5
5
{% if site-navigation %}
6
- < nav class ="s-navigation s-navigation__wrap mx8 mb12 jc-center " aria-label ="Global ">
7
- {% assign slug = page.url | replace:'/',' ' | truncatewords: 2 | remove:'...' %}
6
+ < nav aria-label ="Global " class ="sm:d-none ">
7
+ < ul class ="s-navigation s-navigation__wrap mx8 mb12 jc-center ">
8
+ {% assign slug = page.url | replace:'/',' ' | truncatewords: 2 | remove:'...' %}
8
9
9
- {% for section in site-navigation.sections %}
10
- {% assign url = section.url | replace:'/',' ' | truncatewords: 2 | remove:'...' %}
11
- < a class ="s-navigation--item{% if url == slug %} is-selected{% endif %} " href ="{{ section.url }} "> {{ section.title }}</ a >
12
- {% endfor %}
10
+ {% for section in site-navigation.sections %}
11
+ {% assign url = section.url | replace:'/',' ' | truncatewords: 2 | remove:'...' %}
12
+ < a class ="s-navigation--item{% if url == slug %} is-selected{% endif %} " href ="{{ section.url }} ">
13
+ < span class ="s-navigation--item-text " data-text ="{{ section.title }} "> {{ section.title }}</ span >
14
+ </ a >
15
+ {% endfor %}
16
+ </ ul >
13
17
</ nav >
14
18
{% endif %}
15
19
</ div >
30
34
{% if section.links %}
31
35
{% for link in section.links %}
32
36
< a class ="s-navigation--item {% if page.url == link.url %}is-selected{% endif %} " href ="{{ link.url | url }} " {% if page.url == link.url %}aria-current ="page "{% endif %} >
33
- {{ link.title }}
37
+ < span class =" s-navigation--item-text " data-text =" {{ link.title }} " > {{ link.title }} </ span >
34
38
</ a >
35
39
{% endfor %}
36
40
{% endif %}
Original file line number Diff line number Diff line change 22
22
{% if showFullNavigation %}
23
23
< li >
24
24
< a href ="# " class ="s-navigation--item ">
25
- About
25
+ < span class =" s-navigation--item-text " data-text =" About " > About </ span >
26
26
</ a >
27
27
</ li >
28
28
< li >
29
29
< a href ="# " class ="s-navigation--item is-selected ">
30
- Products
30
+ < span class =" s-navigation--item-text " data-text =" Products " > Products </ span >
31
31
</ a >
32
32
</ li >
33
33
< li >
34
34
< a href ="# " class ="s-navigation--item ">
35
- For Teams
35
+ < span class =" s-navigation--item-text " data-text =" For Teams " > For Teams </ span >
36
36
</ a >
37
37
</ li >
38
38
{% else %}
39
39
< li >
40
40
< a href ="# " class ="s-navigation--item ">
41
- Products
41
+ < span class =" s-navigation--item-text " data-text =" Products " > Products </ span >
42
42
</ a >
43
43
</ li >
44
44
{% endif %}
You can’t perform that action at this time.
0 commit comments