Skip to content

Commit c0dd9e4

Browse files
author
Emmanouil Konstantinidis
committed
Style accordions
1 parent adf9050 commit c0dd9e4

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

rest_framework_docs/static/less/style.less

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/* @group Colours */
22

3+
@ThemeAlt: #c9c9c9;
4+
35
@BgColor: #FEFEFE;
6+
@AccordionBgColor: #ecf0f1;
47

58
@GetColor: #18bc9c;
69
@PostColor: #f39c12;
@@ -37,13 +40,26 @@ body {
3740
margin: 0;
3841
background-color: #ecf0f1;
3942

43+
&:hover {
44+
background-color: darken(@AccordionBgColor, 10%);
45+
46+
.panel-heading {
47+
background-color: darken(@AccordionBgColor, 10%);
48+
}
49+
}
50+
4051
.panel-heading {
4152
padding: 5px;
53+
cursor: pointer;
4254

4355
.title {
4456
margin-top: 6px;
4557
font-family: Menlo,Monaco,Consolas,"Courier New",monospace;
4658
word-wrap: break-word;
59+
60+
.fa {
61+
color: darken(@AccordionBgColor, 15%);
62+
}
4763
}
4864

4965
.methods {
@@ -66,6 +82,8 @@ body {
6682
.panel-body {
6783
padding: 0;
6884
}
85+
86+
> .panel-heading +.panel-collapse > .panel-body { border: 0; }
6987
}
7088

7189
/* @end Endpoint */

rest_framework_docs/templates/rest_framework_docs/home.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ <h1 id="{{ group.grouper|lower }}">{{group.grouper}}</h1>
2525
{% for endpoint in group.list %}
2626

2727
<div class="panel panel-default endpoint">
28-
<div class="panel-heading" role="tab" id="headingOne">
28+
29+
<div class="panel-heading" role="tab" id="headingOne" data-toggle="collapse" data-target="#{{ endpoint.path|slugify }}">
2930
<div class="row">
3031
<div class="col-md-7">
3132
<h4 class="panel-title title">
32-
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#{{ endpoint.path|slugify }}" aria-expanded="true" aria-controls="{{ endpoint.path|slugify }}">{{ endpoint.path }}</a>
33+
<i class="fa fa-link"></i> {{ endpoint.path }}
3334
</h4>
3435
</div>
3536

@@ -42,7 +43,8 @@ <h4 class="panel-title title">
4243
</div>
4344
</div>
4445
</div>
45-
<div id="{{ endpoint.path|slugify }}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
46+
47+
<div id="{{ endpoint.path|slugify }}" class="panel-collapse collapse" role="tabpanel">
4648
<div class="panel-body">
4749
{% if endpoint.fields %}
4850
<p>Fields:</p>

0 commit comments

Comments
 (0)