Skip to content

Commit 088b08f

Browse files
Allow linking to a specific card (#156)
Co-authored-by: Stan Ulbrych <stan@ulbrych.org>
1 parent 2619283 commit 088b08f

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

src/style.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ body {
5858
flex: 1;
5959
}
6060

61+
.card:target {
62+
scroll-margin-top: 4.5rem;
63+
border-color: #1595fe;
64+
}
65+
6166
.card-body p {
6267
margin-bottom: 0;
6368
margin-top: 0;
@@ -67,6 +72,24 @@ body {
6772
margin-bottom: 0.4rem;
6873
}
6974

75+
.card-title a {
76+
color: inherit;
77+
text-decoration: none;
78+
border-radius: 4px;
79+
padding: 0 4px;
80+
margin: 0 -4px;
81+
}
82+
83+
.card-title a::after {
84+
content: " #";
85+
font-size: 0.8em;
86+
color: #7ec3ff;
87+
}
88+
89+
.card-title a:focus, .card-title a:hover {
90+
background-color: #f5e9a8;
91+
}
92+
7093
/* ------------------------------ Index ------------------------------------- */
7194

7295
.progress-bar-container {

templates/index.html.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<div class="row">
66
{% for project in completion_progress | sort(attribute='completion') | reverse %}
77
<div class="col-12 col-sm-6 col-md-4 d-flex">
8-
<div class="card shadow mb-3 w-100">
8+
<div id="{{ project.language.code }}" class="card shadow mb-3 w-100">
99
<div class="card-body">
10-
<h3 class="card-title">{{ project.language.name }}</h3>
10+
<h3 class="card-title"><a href="#{{ project.language.code }}">{{ project.language.name }}</a></h3>
1111
<h5 class="card-subtitle mb-2 text-muted">{{ project.translated_name }}</h5>
1212
<p class="text-muted">Completion: <strong>{{ '{:.2f}%'.format(project.completion) }}</strong></p>
1313
<p class="text-muted">30-day progress: {{ '{:.2f}%'.format(project.change) }}</p>

0 commit comments

Comments
 (0)