Skip to content
Astro Rocket
Get in touch

Docs · The theme

The page, the cards and the animations

The calm page, the hero, the buttons, the cards and Astro Rocket's animations.

All docs pages

A calm page

Behind the page is its own plain background, set by src/components/fx/LightField.astro. Nothing moves or glows behind it: the moving light, its still glow and the dot pattern are gone, so the page is calm. The rhythm comes from the sections, which take turns on two backgrounds (the zebra): a default section is the page’s own background, a secondary one the second background, --rk-alt in src/styles/theme.css, a quiet solid shade with a hint of the site’s colour, in both modes.

Every page opens with the same hero (ground="gradient", the default on RocketHero): the site’s bright 500 shade at the top, behind the header too, fading into its 950 at the foot, so it stays in the site’s colour all the way down. The homepage’s hero (size="full") fades into black at the foot instead, as Astro Rocket 2.7’s; every page but the homepage has a grid of fine lines over it that shows only in the middle on a desktop (grid={false} on RocketHero leaves it out). gradient on its own fades into black instead. ground="band" gives it the closing band’s look, and ground="light" a near-black ground with two still glows. Its heading can end in a highlighted line (highlight on RocketHero).

No lines between the parts

There are no lines between the parts of a page. The hero, the sections, the closing band and the footer each have their own background, and the change of background marks the border. The divider above the footer’s copyright stays.

In dark mode the page’s own background, the darker half of the zebra, is a dark blue-grey rather than near-black, so the page doesn’t feel heavy; the second background and the cards stay a step lighter.

The buttons

A page has two kinds of button. The primary one is solid: on a light page in the site’s 600, in the hero, the header and dark mode’s project buttons the hero’s soft silver (a light grey with a trace of the site’s colour) with a soft gradient, a thin edge and dark text. The hero’s heading and the announcement bar’s tag are the same silver, so the light parts of the hero match. The secondary one is an outline on a transparent ground. Both have a 1px border (the primary’s is transparent), so a pair is exactly the same size. Outline buttons on the page have an edge in the site’s colour in both modes, and in light mode their text too; in the hero and the closing band they’re light.

The cards

Cards and tiles (elements with data-spot) have an edge in the site’s colour, so they stand out from both backgrounds. In dark mode they’re solid and one shade lighter than the sections; grey text on them keeps at least 6.9:1. src/components/fx/Spotlight.astro adds a soft light that follows the pointer across them.

A post’s card ends in “Read the post” and a project’s card in “View the project”, with an arrow that moves a little on hover. The whole card is one link.

The covers the theme draws for posts and projects (src/components/fx/ProjectCover.astro) run from the site’s bright 500 at the top into its 900 at the foot, or a post’s category’s colour in the same steps, with a grid of fine light lines that fades out towards the edges, four corner marks, the word and the icon, the same in light and dark mode.

The call to action before the footer (src/components/fx/ClosingCta.astro) is a rounded card on the page in the same colours: the site’s 500 into its 900, with the same grid. In light mode a deep shadow lifts it off the page.

The animations

The animations are Astro Rocket 2.7’s, in src/components/fx/Motion.astro:

  • when a page loads, the hero’s badge, heading, line and buttons slide up one after another, and the header drops in when a visitor arrives from elsewhere (not when moving between the site’s own pages);
  • below the hero, every piece of a page rises into view as it’s scrolled to, once: each heading, paragraph, list and picture of a post or project, each card and tile, each link and line. Pieces that come into view together, such as cards side by side, follow one another 100ms apart. What’s already on the first screen rises in just after the hero.

In your own markup:

Attribute What it does
data-reveal Rises into view. left, right, down or scale set the direction.
data-reveal-delay="1" to "4" Comes in 100ms to 400ms later, for tiles in a row
data-reveal-children Its children come in one after another
data-no-reveal Never hidden or moved

Rows of tags, in the blog’s and the projects’ heroes, on the search page and under a post, stay still. Under reduced motion nothing is hidden or moved, and a jump to an anchor shows the section at once. motion: false in the settings turns the animations off.