Skip to content

Commit 067948b

Browse files
committed
Sidebar arrows
Dropdown chevron and right chevron to bootstrap5 icons
1 parent fa06610 commit 067948b

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

rest_framework/static/rest_framework/docs/css/base.css

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ pre.highlight code {
115115
padding-top: 10px;
116116
padding-bottom: 10px;
117117
padding-right: 10px;
118-
padding-left: 25px;
118+
padding-left: 10px;
119119
}
120120

121121
.sidebar .menu-list ul .sub-menu li:hover,
@@ -129,19 +129,6 @@ pre.highlight code {
129129
display: block;
130130
}
131131

132-
.sidebar .menu-list ul .sub-menu li a:before,
133-
.sidebar .menu-list li .sub-menu li a:before {
134-
font-family: FontAwesome;
135-
font-size: 14px;
136-
font-weight: bold;
137-
content: "\f105";
138-
display: inline;
139-
vertical-align: middle;
140-
padding-left: 0;
141-
padding-right: 7px;
142-
margin-left: -12px;
143-
}
144-
145132
.sidebar .menu-list li {
146133
padding-left: 0px;
147134
border-left: 3px solid #2e353d;

rest_framework/templates/rest_framework/docs/sidebar.html

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,29 @@ <h3 class="brand"><a href="#">{{ document.title }}</a></h3>
88
{% if document|data %}
99
{% for section_key, section in document|data|items %}
1010
<li data-toggle="collapse" data-target="#{{ section_key }}-dropdown" class="collapsed">
11-
<a>
12-
<svg width="1.5em" height="1.5em" viewBox="0 0 16 16" class="mb-1 mr-2 ml-2 bi bi-bullseye" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
11+
<a class="d-flex align-items-center">
12+
<svg width="1.5em" height="1.5em" viewBox="0 0 16 16" class="mr-2 ml-2 bi bi-bullseye" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
1313
<path fill-rule="evenodd" d="M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
1414
<path fill-rule="evenodd" d="M8 13A5 5 0 1 0 8 3a5 5 0 0 0 0 10zm0 1A6 6 0 1 0 8 2a6 6 0 0 0 0 12z"/>
1515
<path fill-rule="evenodd" d="M8 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8z"/>
1616
<path d="M9.5 8a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"/>
1717
</svg>
18-
{% if section_key %}{{ section_key }}{% else %}API Endpoints{% endif %} <span class="arrow"></span></a>
18+
{% if section_key %}{{ section_key }}{% else %}API Endpoints{% endif %}
19+
<svg width="1em" height="1em" viewBox="0 0 16 16" class="ml-auto mr-3 bi bi-chevron-down" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
20+
<path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/>
21+
</svg>
22+
23+
</a>
1924
<ul class="sub-menu {% if section_key %}collapse{% endif %}" id="{{ section_key }}-dropdown">
2025
{% for link_key, link in section|schema_links|items %}
21-
<li><a href="#{{ section_key }}-{{ link_key|slugify }}">{{ link.title|default:link_key }}</a></li>
26+
<li>
27+
<a href="#{{ section_key }}-{{ link_key|slugify }}">
28+
<svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-chevron-right" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
29+
<path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/>
30+
</svg>
31+
{{ link.title|default:link_key }}
32+
</a>
33+
</li>
2234
{% endfor %}
2335
</ul>
2436
</li>

0 commit comments

Comments
 (0)