Styling one page of a listing
CSS cannot read an address, so for a stylesheet the front page and /page/2/ used to be the same document -- which is why the two skins here both wanted a lead card or a profile block on the first page and neither could have one.
Since 1.3.2 a listing's <body> says which it is:
.page-first .post-list-item:first-of-type { /* the first card */ }
.page-cont .listing-heading { /* only on the continuations */ }
page-first is the page that lives at the listing's own address, page-cont is everything under /page/N/, and both are emitted for every listing -- the front page, a tag, a series, a content type. A post page carries a bare <body>, so a rule scoped to either class cannot leak onto one. :first-of-type, not :first-child: the listing's heading stands first in <main>, and the cards are the divs after it -- :first-child matches no card at all.
Two of them exist rather than one on purpose: a single mark on the continuations would force you to write the first page's look unconditionally and then take it back property by property, and a rule that undoes another is the kind a later change quietly stops undoing. Scope positively instead.
One card can be more than first by position. With layout.lead_card on in config/site.yml, the card that opens the front page is marked for you -- and handed its post's first picture, placed before its words whatever the height budget would have cut, when the post has one:
.post-list-item--lead .content figure img { width: 100%; }
The mark goes with the place, not with the picture. A post with nothing to lead with keeps the body its card would have had -- a video post its video, with post-list-item--media beside the mark -- and is the lead all the same, so the card you dressed does not vanish the day the post that opens the front page has no picture. Write the lead's rules so that they hold without a picture too. Without the setting no card carries the class, and a rule scoped to it does nothing; .page-first .post-list-item:first-of-type alone cannot do this, because the picture is usually not in the card to be styled.
A card of a picture post or a video post opens with its medium on every listing, setting or no setting, and says so: .post-list-item--media. One whose medium is taller than wide, or square, is also .post-list-item--media-tall, and site.css holds that medium to max-height: 22rem so it does not take a screen to itself:
.post-list-item--media .content > figure:first-child img { border-radius: 8px; }
.post-list-item--media-tall .content > figure:first-child img { max-height: 28rem; }
The build charges the card's height budget those same 22rem, so a much smaller cap leaves room the card does not use and a much larger one lets the card run long; neither breaks anything. A lead card that leads with its picture stays --lead alone; a video post's lead with no picture to lead with is the media card it would have been, with --lead beside its marks.
With layout.series_contents on, a part's page lists the whole series under "part N of M": <nav class="series-contents">, the series' name in .series-contents__heading (a link to its listing where it has one) and an <ol> of every part in reading order, the one being read carrying aria-current="page". Every skin sets it in the flow, with the table of contents' rule; a skin that wants it beside the text moves it there:
.series-contents { float: right; width: 16rem; margin: 0 0 1rem 1.5rem; }
@media (max-width: 700px) { .series-contents { float: none; width: auto; margin: 0 0 1rem; } }
A menu written with groups (group: true in nav:) draws each of them as <li class="nav-group">: its label in .nav-group__label, which is no link, and its items in a <ul> of their own after it. Classic and minimal keep the items in the row they always stood in, with the label a quiet caption before them, and on a phone a heading over them; a skin that wants the groups as columns, or as the sections of a menu down the side, has the structure to do it. Every rule written for nav ul or nav li reaches the inner list too -- undo what should not on .nav-group > ul, as both skins do for the row a phone slides sideways.
A series item of the menu is marked on every part of its series with aria-current="true" -- the chapter the reader is in -- where the item of the page itself has aria-current="page". Every shipped skin draws the two apart (classic keeps the bar's line under it, in the accent); a skin of your own wants a rule for nav a[aria-current="true"] too.
The date badge of a card carries the hour the post went out, as <time class="date-time" datetime="…" hidden> after the date -- hidden, so a skin that wants it shows it and every other skin is unchanged. It is left out where the engine does not know the hour: a post an importer dated at midnight, at noon from Jekyll or Medium, or from the Wayback Machine. Only on a listing's card, not on the post's own page.
.post-list-item .date-time[hidden] { display: inline; margin-left: 0.4em; }
A card of a post with two pictures or more says how many it has, as data-photos="N" on the card -- the card itself shows one at most, its height budget sees to that, so this is the only place a skin can learn the post is a gallery. A card with one picture or none has no such attribute.
.post-list-item[data-photos]::after { content: attr(data-photos) " photos"; }
The next pictures of a gallery -- three at most -- ride inside the card's first <figure>, after its picture, as <span class="card-mosaic" data-more="N"> with an <img> each (decorative, lazy). site.css hides them, so a skin that does not want a mosaic pays a few lines of markup and no download; one that does shows them and lays the figure out (Minimal Pictorial: four in two rows, three as one tall beside two, two side by side). They are the original files -- the engine makes no smaller copies -- so a mosaic costs up to four originals a card.
The pair says nothing about which listing you are on. That is already in the markup: the front page's heading carries its own modifier, and a tag listing names itself.
