Skip to content

Commit 1536c3f

Browse files
committed
Add anchors to titles
1 parent 84ffb85 commit 1536c3f

3 files changed

Lines changed: 51 additions & 16 deletions

File tree

images/php8/anchor-white.svg

Lines changed: 8 additions & 0 deletions
Loading

releases/8.5/release.inc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ common_header(message('common_header', $lang));
7777
</section>
7878

7979
<!-- new features -->
80-
<section class="features" id="features">
80+
<section class="features">
8181
<svg aria-hidden="true" width="100%" height="100%" class="features-pattern">
8282
<defs>
8383
<pattern id="features-pattern" width="13" height="13" patternUnits="userSpaceOnUse">
@@ -88,7 +88,7 @@ common_header(message('common_header', $lang));
8888
</svg>
8989

9090
<div class="features-title">
91-
<h2><?= message('key_features', $lang) ?></h2>
91+
<h2 id="features"><?= message('key_features', $lang) ?></h2>
9292
<?= message('key_features_description', $lang) ?>
9393
</div>
9494

@@ -193,9 +193,9 @@ common_header(message('common_header', $lang));
193193
</section>
194194

195195
<!-- new-uri-extension -->
196-
<section id="new-uri-extension" class="before-and-after-container">
196+
<section class="before-and-after-container">
197197
<div class="before-and-after-title-and-description">
198-
<h2><?= message('uri_extension_title', $lang) ?></h2>
198+
<h2 id="new-uri-extension"><?= message('uri_extension_title', $lang) ?></h2>
199199
<?= message('uri_extension_description', $lang) ?>
200200
</div>
201201

@@ -241,9 +241,9 @@ var_dump($uri->getHost());
241241
</section>
242242

243243
<!-- pipe-operator -->
244-
<section id="pipe-operator" class="before-and-after-container">
244+
<section class="before-and-after-container">
245245
<div class="before-and-after-title-and-description">
246-
<h2><?= message('pipe_operator_title', $lang) ?></h2>
246+
<h2 id="pipe-operator"><?= message('pipe_operator_title', $lang) ?></h2>
247247
<?= message('pipe_operator_description', $lang) ?>
248248
</div>
249249

@@ -301,9 +301,9 @@ var_dump($slug);
301301
</section>
302302

303303
<!-- clone-with -->
304-
<section id="clone-with" class="before-and-after-container">
304+
<section class="before-and-after-container">
305305
<div class="before-and-after-title-and-description">
306-
<h2><?= message('clone_with_title', $lang) ?></h2>
306+
<h2 id="clone-with"><?= message('clone_with_title', $lang) ?></h2>
307307
<?= message('clone_with_description', $lang) ?>
308308
</div>
309309

@@ -378,9 +378,9 @@ $transparentBlue = $blue->withAlpha(128);
378378
</section>
379379

380380
<!-- no-discard-attribute -->
381-
<section id="no-discard-attribute" class="before-and-after-container">
381+
<section class="before-and-after-container">
382382
<div class="before-and-after-title-and-description">
383-
<h2><?= message('no_discard_title', $lang) ?></h2>
383+
<h2 id="no-discard-attribute"><?= message('no_discard_title', $lang) ?></h2>
384384
<?= message('no_discard_description', $lang) ?>
385385
</div>
386386

@@ -432,9 +432,9 @@ getPhpVersion();
432432
</section>
433433

434434
<!-- fcc-in-const-expr -->
435-
<section id="closures-in-const-expr" class="before-and-after-container">
435+
<section class="before-and-after-container">
436436
<div class="before-and-after-title-and-description">
437-
<h2><?= message('fcc_in_const_expr_title', $lang) ?></h2>
437+
<h2 id="closures-in-const-expr"><?= message('fcc_in_const_expr_title', $lang) ?></h2>
438438
<?= message('fcc_in_const_expr_description', $lang) ?>
439439
</div>
440440

@@ -498,9 +498,9 @@ final class PostsController
498498
</section>
499499

500500
<!-- persistent-curl-share-handles -->
501-
<section id="persistent-curl-share-handles" class="before-and-after-container">
501+
<section class="before-and-after-container">
502502
<div class="before-and-after-title-and-description">
503-
<h2><?= message('persistent_curl_share_handles_title', $lang) ?></h2>
503+
<h2 id="persistent-curl-share-handles"><?= message('persistent_curl_share_handles_title', $lang) ?></h2>
504504
<?= message('persistent_curl_share_handles_description', $lang) ?>
505505
</div>
506506

@@ -556,9 +556,9 @@ curl_exec($ch);
556556
</section>
557557

558558
<!-- array-first-and-last-functions -->
559-
<section id="array-first-and-last-functions" class="before-and-after-container last">
559+
<section class="before-and-after-container last">
560560
<div class="before-and-after-title-and-description">
561-
<h2><?= message('array_first_last_title', $lang) ?></h2>
561+
<h2 id="array-first-and-last-functions"><?= message('array_first_last_title', $lang) ?></h2>
562562
<?= message('array_first_last_description', $lang) ?>
563563
</div>
564564

styles/php85.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,33 @@ code[class*=language-], pre[class*=language-] {
6969

7070
}
7171

72+
.features-title h2,
73+
.before-and-after-title-and-description h2 {
74+
position: relative;
75+
overflow: visible;
76+
display: inline-block;
77+
}
78+
79+
.features-title h2 .genanchor,
80+
.before-and-after-title-and-description h2 .genanchor {
81+
position: absolute;
82+
top: 4px;
83+
left: 0;
84+
display: none;
85+
margin-left: -30px;
86+
height: 30px;
87+
width: 30px;
88+
background: url("/images/php8/anchor-white.svg") scroll no-repeat left center / 21px 16px transparent;
89+
text-decoration: none;
90+
border-bottom: none;
91+
font-size: 0;
92+
}
93+
94+
.features-title h2:hover .genanchor,
95+
.before-and-after-title-and-description h2:hover .genanchor {
96+
display: block;
97+
}
98+
7299
@layer properties {
73100
@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))) {
74101
*, :before, :after, ::backdrop {

0 commit comments

Comments
 (0)