SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

Blog foundations

What @sdxc/ui/blog is for, the rules its parts share, and every variable it declares.

The parts a blog is built from: entries in a stream, a byline, tags and a tag cloud, a series, an archive, sidebar widgets, an author card, a sign-up form and the page a post reads in.

They take plain values, so posts can come from Markdown, a database or a CMS, and they draw on the server as links and forms that work with script off.

typescript
import "@sdxc/ui/theme.css";
import { … } from "@sdxc/ui/blog";

When to reach for it

  • A home page that lists essays, notes and links in one feed, as cards, a log or a dense index.
  • An article page with a byline, an outline beside the body and the post's series and tags.
  • An archive by year, a tag page, and a sidebar of recent posts and a sign-up.

Shared ideas

  • Pieces, not optionsEach component is a root and the parts you write inside it (PostByline.Author, ArticleLayout.Rail), so a blog arranges, leaves out or reorders pieces instead of setting props that move them. The root shares only data its parts need, such as a locale or an outline, and lays out whichever parts it gets.
  • Plain propsHrefs, dates and counts are values you pass and titles are children, so the parts read no post record and fit any content source.
  • Dates are calendar daysA date arrives as a YYYY-MM-DD string, renders as <time datetime> and formats in UTC for the locale you pass, so a post dated the 12th reads the 12th everywhere.
  • Copy passed inEvery word a reader sees is a part's children; where a part has a default ("min read", "Updated", "On this page"), it is English and your children replace it, so a translated blog sets its own words.
  • No script neededEvery part is links and forms: the sign-up form posts, section headings and the outline rail stick through CSS, and a collapsible series is a <details>.

CSS variables

Every custom property the namespace reads or declares, with its default and what it controls.

Reads the neutral role for text and hairlines, and brand for kinds, links, featured entries, widget rules and focus rings. Every inner part reads a custom property first, so a blog restyles one from the component's root. The roles are documented on Theming.

Post entries

Set on a PostEntry through mix or style; gutter and title-size are declared by the entry per layout, so an inline style overrides them.

VariableDefaultWhat it controls
--ui-post-entry-gap0.5rem (row: 0.25rem)The space between the entry's parts.
--ui-post-entry-gutter6.5rem (row: 4.5rem)The width of the margin column the kind sits in.
--ui-post-entry-title-size1.375rem (row: 1.0625rem)The size of the entry's title; a featured entry sets a larger one.
--ui-post-entry-title-font-familyinheritThe title's typeface.
--ui-post-entry-title-font-weight600The title's weight.
--ui-post-entry-title-fgemphasis neutral textThe title's colour, for a selected row.
--ui-post-entry-lead-fgneutral textThe lead's colour.
--ui-post-entry-kind-fgbrand textThe kind's colour.
--ui-post-entry-kind-font-familyinheritThe kind's typeface.
--ui-post-entry-kind-font-size`--ui-text-xs`The kind's size.
--ui-post-entry-kind-font-weight600The kind's weight.
--ui-post-entry-kind-letter-spacing`--ui-tracking-wider`The kind's letter spacing.
--ui-post-entry-kind-text-transformuppercaseThe kind's case.
--ui-post-entry-meta-fgmuted neutral textThe meta row's text and middots.
--ui-post-entry-meta-font-familyinheritThe meta row's typeface.
--ui-post-entry-meta-font-size`--ui-text-sm`The meta row's size.
--ui-post-entry-date-fgmuted neutral textThe colour of PostEntry.Date.
--ui-post-entry-date-font-familyinheritThe date's typeface.
--ui-post-entry-date-font-size`--ui-text-sm`The date's size.
--ui-post-entry-date-width6.5remThe width of the date's column in a wide row.
--ui-post-entry-featured-bgbrand tintA featured entry's surface.
--ui-post-entry-featured-border-colorbrand borderA featured entry's border.
--ui-post-entry-featured-edge-colorbrand solidA featured entry's thick leading edge.
--ui-post-entry-featured-edge-width4pxThe width of a featured entry's leading edge.
--ui-post-entry-title-hover-fgbrand textThe title link's colour under the pointer.
--ui-post-entry-title-hover-decoration-colorcurrentColorThe title link's underline under the pointer.

Streams

Set on a PostStream (or one section); a page with a sticky bar of its own sets the offset to that bar's height.

VariableDefaultWhat it controls
--ui-post-stream-gap2.5rem (rows: 1.5rem)The space between entries, with the hairline drawn halfway.
--ui-post-stream-offset0pxHow far below the viewport's top a section heading sticks.
--ui-post-stream-section-gap3remThe space between sections.
--ui-post-stream-entries-padding1.25remThe space between a section's heading and its first entry.
--ui-post-stream-rule-colorneutral borderThe hairline's colour.
--ui-post-stream-rule-stylesolidThe hairline's style.
--ui-post-stream-rule-width1pxThe hairline's width; 0 drops it.
--ui-post-stream-heading-font-familyinheritA section heading's typeface.
--ui-post-stream-heading-font-size`--ui-text-xs`A section heading's size.
--ui-post-stream-heading-font-weight600A section heading's weight.
--ui-post-stream-heading-letter-spacing`--ui-tracking-widest`A section heading's letter spacing.
--ui-post-stream-heading-text-transformuppercaseA section heading's case.
--ui-post-stream-heading-fgmuted neutral textA section heading's colour.
--ui-post-stream-heading-bg`--ui-bg`The surface entries scroll under.
--ui-post-stream-heading-border-colorneutral borderThe rule under a section heading.

Tags

Set on a TagList or TagCloud. A chip is a TagList given a border, padding or background.

VariableDefaultWhat it controls
--ui-tag-list-gap0.75emThe space between tags, and around a separator.
--ui-tag-list-link-fgmuted neutral textA tag's colour.
--ui-tag-list-link-hover-fgbrand textA tag's colour under the pointer.
--ui-tag-list-link-font-familyinheritA tag's typeface.
--ui-tag-list-link-font-sizeinheritA tag's size.
--ui-tag-list-link-font-weightinheritA tag's weight.
--ui-tag-list-link-text-transforminheritA tag's case.
--ui-tag-list-link-bordernoneA tag's border, as a shorthand.
--ui-tag-list-link-radius`--ui-radius-sm`A tag's corners.
--ui-tag-list-link-padding0A tag's padding.
--ui-tag-list-link-bgtransparentA tag's background.
--ui-tag-list-separatornoneA quoted string set after every tag but the last, such as ",", so it ends a line at a wrap.
--ui-tag-list-separator-fgmuted neutral textThe separator's colour.
--ui-tag-cloud-link-fgemphasis neutral textA cloud tag's colour.
--ui-tag-cloud-link-hover-fgbrand textA cloud tag's colour under the pointer.
--ui-tag-cloud-link-font-familyinheritA cloud tag's typeface.
--ui-tag-cloud-link-bordernoneA cloud tag's chip border, as a shorthand.
--ui-tag-cloud-link-radius0A cloud tag's corners.
--ui-tag-cloud-link-padding0A cloud tag's padding, which turns it into a chip.
--ui-tag-cloud-link-bgtransparentA cloud tag's background.
--ui-tag-cloud-count-fgmuted neutral textThe count beside each cloud tag.

Bylines and author cards

Set on a PostByline or an AuthorCard; the byline's separator falls between the parts inside PostByline.Facts.

VariableDefaultWhat it controls
--ui-post-byline-separator"·"A quoted string drawn between two facts; "" draws none.
--ui-post-byline-gap0.5emThe space on each side of that separator.
--ui-author-card-name-font-familyinheritThe name's typeface.
--ui-author-card-name-font-sizeinheritThe name's size.
--ui-author-card-name-font-weight600The name's weight.
--ui-author-card-rule-colorneutral borderThe rule a plain card opens on.
--ui-author-card-rule-width1pxThat rule's width; 0 drops it.

Series and archives

Set on a SeriesNav or an ArchiveList; an archive under a sticky header sets its scroll margin to the header's height.

VariableDefaultWhat it controls
--ui-series-nav-bgneutral tintThe series box's surface.
--ui-series-nav-border1px solid neutral borderThe series box's border, as a shorthand.
--ui-series-nav-radius`--ui-radius-lg`The series box's corners.
--ui-series-nav-label-fgbrand textThe eyebrow's colour.
--ui-series-nav-label-font-familyinheritThe eyebrow's typeface.
--ui-series-nav-label-text-transformuppercaseThe eyebrow's case.
--ui-series-nav-label-letter-spacing`--ui-tracking-wide`The eyebrow's letter spacing.
--ui-series-nav-title-font-familyinheritThe series name's typeface.
--ui-series-nav-title-font-size`--ui-text-lg`The series name's size.
--ui-series-nav-title-font-weight700The series name's weight.
--ui-series-nav-number-font-familyinheritThe typeface of each part's number.
--ui-series-nav-current-fgemphasis neutral textThe current part's title.
--ui-series-nav-current-marker-fgbrand textThe current part's number.
--ui-archive-list-day-fgmuted neutral textEach entry's day.
--ui-archive-list-day-font-familyinheritThe day's typeface.
--ui-archive-list-day-width4.5remThe width of the day's column.
--ui-archive-list-kind-fgmuted neutral textEach entry's kind.
--ui-archive-list-kind-font-familyinheritThe kind's typeface.
--ui-archive-list-kind-font-size`--ui-text-xs`The kind's size.
--ui-archive-list-kind-letter-spacing`--ui-tracking-wide`The kind's letter spacing.
--ui-archive-list-title-font-familyinheritEach entry's title typeface.
--ui-archive-list-title-font-sizeinheritEach entry's title size.
--ui-archive-list-heading-font-familyinheritA group heading's typeface.
--ui-archive-list-heading-font-size`--ui-text-xl`A group heading's size.
--ui-archive-list-heading-font-weight700A group heading's weight.
--ui-archive-list-heading-fgemphasis neutral textA group heading's colour.
--ui-archive-list-heading-text-transformnoneA group heading's case.
--ui-archive-list-heading-letter-spacing`--ui-tracking-tight`A group heading's letter spacing.
--ui-archive-list-heading-border-colorstrong neutral borderThe rule under a group heading; transparent hides it.
--ui-archive-list-rule-colorneutral borderThe rule under each entry.
--ui-archive-list-rule-stylesolidThat rule's style; none drops it.
--ui-archive-list-scroll-margin1remHow far a jumped-to group heading clears the top.

Widgets and articles

Set on a Widget or the sidebar around several; ArticleLayout sets its sticky offset from stickyTop, which its .Bar, .Rail and jumped-to headings clear.

VariableDefaultWhat it controls
--ui-widget-heading-font-familyinheritA widget heading's typeface.
--ui-widget-heading-font-size`--ui-text-xs`A widget heading's size.
--ui-widget-heading-font-weight700A widget heading's weight.
--ui-widget-heading-letter-spacing0.08emA widget heading's letter spacing.
--ui-widget-heading-text-transformuppercaseA widget heading's case.
--ui-widget-heading-fgemphasis neutral textA widget heading's colour.
--ui-widget-rule-colorbrand solidThe rule above a widget heading.
--ui-widget-rule-width3pxThat rule's width; 0 drops it.
--ui-article-sticky-top`stickyTop` (0px)Where the outline bar and rail of ArticleLayout stick.
@sdxc/ui

Can’t find it? Contact us