mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
css: replace presentational class selectors with semantic element selectors
Replace 6 CSS class selectors across tfe.css, main.css, and search.css with semantic element-based selectors, removing the corresponding classes from the HTML templates entirely. tfe.css: - .tfe-meta-list → article dl / article dl > div / article dl dt / article dl dd - .tfe-media-block → aside figure (+ img, video, embed children) - .tfe-file-caption → aside figcaption main.css: - .card__media → .home-body figure (+ img/video children and hover/motion rules) - .card__caption → .home-body li > a > p search.css: - .repertoire-col > h2 → .repertoire-index section > h2 Template changes: - tfe.php: removed class= from <dl>, <figure>, and <figcaption> - index.php: removed class= from <figure> and <p class=card__caption>; stripped orphaned card__media from the gradient <div> (only --gradient needed) No visual change — selectors match the same elements as before since the semantic HTML was already in place from prior refactoring work.
This commit is contained in:
@@ -99,7 +99,7 @@ $bodyClass = 'home-body';
|
||||
// 3. Fall through to gradient
|
||||
?>
|
||||
<?php if ($thumb): ?>
|
||||
<figure class="card__media">
|
||||
<figure>
|
||||
<img src="/media.php?path=<?= urlencode($thumb) ?>"
|
||||
alt="Couverture — <?= htmlspecialchars($item['title']) ?> par <?= htmlspecialchars($item['authors'] ?? '') ?>"
|
||||
loading="lazy">
|
||||
@@ -109,14 +109,14 @@ $bodyClass = 'home-body';
|
||||
$hue = ($item['id'] * 47 + 160) % 360;
|
||||
$hue2 = ($hue + 40) % 360;
|
||||
?>
|
||||
<div class="card__media card__media--gradient"
|
||||
<div class="card__media--gradient"
|
||||
style="background:linear-gradient(135deg,hsl(<?= $hue ?>,55%,40%),hsl(<?= $hue2 ?>,50%,28%));"
|
||||
aria-hidden="true">
|
||||
<span class="card__gradient-author"><?= htmlspecialchars($item['authors'] ?? '') ?></span>
|
||||
<span class="card__gradient-title"><?= htmlspecialchars($item['title']) ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<p class="card__caption"><?= htmlspecialchars($item["authors"] ?? '') ?><?php if (!empty($item['authors']) && !empty($item['title'])): ?> – <?php endif; ?><?= htmlspecialchars($item["title"]) ?></p>
|
||||
<p><?= htmlspecialchars($item["authors"] ?? '') ?><?php if (!empty($item['authors']) && !empty($item['title'])): ?> – <?php endif; ?><?= htmlspecialchars($item["title"]) ?></p>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
|
||||
Reference in New Issue
Block a user