Skip to content

Commit da2f0ad

Browse files
Reduce page size and number of DOM elements on clippy lints page (#15140)
This is the first pass of "reducing the size of the clippy lints page" I'm currently going through. This first one reduces the size page but mostly reduces the number of DOM elements. Page size change: * Before this PR: 1938957 * With this PR: 1876167 * Reduction: -3.2% r? @Alexendoo changelog: Reduce page size and number of DOM elements on clippy lints page
2 parents 876e05d + ecb397a commit da2f0ad

File tree

2 files changed

+29
-18
lines changed

2 files changed

+29
-18
lines changed

util/gh-pages/index_template.html

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -149,25 +149,21 @@ <h1>Clippy Lints <span id="lint-count" class="badge"></span></h1> {# #}
149149
<article class="panel panel-default" id="{{lint.id}}"> {# #}
150150
<input id="label-{{lint.id}}" type="checkbox"> {# #}
151151
<label for="label-{{lint.id}}"> {# #}
152-
<header class="panel-heading"> {# #}
153-
<h2 class="panel-title"> {# #}
154-
<div class="panel-title-name" id="lint-{{lint.id}}"> {# #}
155-
<span>{{lint.id}}</span> {#+ #}
156-
<a href="#{{lint.id}}" class="lint-anchor anchor label label-default">&para;</a> {#+ #}
157-
<a href="" class="copy-to-clipboard anchor label label-default"> {# #}
158-
&#128203; {# #}
159-
</a> {# #}
160-
</div> {# #}
152+
<h2 class="lint-title"> {# #}
153+
<div class="panel-title-name" id="lint-{{lint.id}}"> {# #}
154+
<span>{{lint.id}}</span> {#+ #}
155+
<a href="#{{lint.id}}" class="lint-anchor anchor label label-default">&para;</a> {#+ #}
156+
<a href="" class="copy-to-clipboard anchor label label-default"> {# #}
157+
&#128203; {# #}
158+
</a> {# #}
159+
</div> {# #}
161160

162-
<div class="panel-title-addons"> {# #}
163-
<span class="label label-lint-group label-default label-group-{{lint.group}}">{{lint.group}}</span> {#+ #}
161+
<span class="label label-lint-group label-default label-group-{{lint.group}}">{{lint.group}}</span> {#+ #}
164162

165-
<span class="label label-lint-level label-lint-level-{{lint.level}}">{{lint.level}}</span> {#+ #}
163+
<span class="label label-lint-level label-lint-level-{{lint.level}}">{{lint.level}}</span> {#+ #}
166164

167-
<span class="label label-doc-folding"></span> {# #}
168-
</div> {# #}
169-
</h2> {# #}
170-
</header> {# #}
165+
<span class="label label-doc-folding"></span> {# #}
166+
</h2> {# #}
171167
</label> {# #}
172168

173169
<div class="list-group lint-docs"> {# #}

util/gh-pages/style.css

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,23 @@ div.panel div.panel-body button.open {
5050

5151
.panel-heading { cursor: pointer; }
5252

53-
.panel-title { display: flex; flex-wrap: wrap;}
54-
.panel-title .label { display: inline-block; }
53+
.lint-title {
54+
cursor: pointer;
55+
margin-top: 0;
56+
margin-bottom: 0;
57+
font-size: 16px;
58+
display: flex;
59+
flex-wrap: wrap;
60+
background: var(--theme-hover);
61+
color: var(--fg);
62+
border: 1px solid var(--theme-popup-border);
63+
padding: 10px 15px;
64+
border-top-left-radius: 3px;
65+
border-top-right-radius: 3px;
66+
gap: 4px;
67+
}
68+
69+
.lint-title .label { display: inline-block; }
5570

5671
.panel-title-name { flex: 1; min-width: 400px;}
5772
.panel-title-name span { vertical-align: bottom; }

0 commit comments

Comments
 (0)