AdvancedCode injection

Hook reference

Every data-region, data-component, data-variant and data-part handle Ventura ships, in lookup tables: header and footer, the homepage, posts, archives, membership and signup forms, and the states you can select on.

Every handle Ventura ships, grouped by where it lives on the page. Compose them as region, then component with its variant, then part. New to the system? Start with the Code injection overview, and grab ready-made CSS from Common snippets.

HookWhat it is
[data-region="site-header"]The header. [data-layout="search"] on the Search style, [data-layout="classic"] on Classic
[data-region="masthead"]The logo cluster at the start of the header
[data-part="wordmark"]The brand link wrapping the logo or the site title (header and footer)
[data-part="logo"]The logo image, or the site title when there is no logo (header and footer)
[data-region="primary-nav"]The menu row
[data-part="label"]A menu item's text, in the header, the footer and the phone menu
[data-component="nav-more"]The More pill either header folds overflowing items into (the Search header from 1024px wide): > button is the pill, > ul its panel. Built by the script, so it exists only once the page has run
[data-component="section-row"]The row of chips under the Search header's menu on phones (below 1024 pixels): the pages of the section the reader is in, or the one a parent's arrow opened. Its links are .nav-chip, each label [data-part="label"]; it takes no room while no section shows
[data-component="header-link"]The header link from the two Site wide settings: bare at the end of the Search header's menu row (the Classic header renders none), [data-variant="menu"] as the link pinned at the phone menu's foot
[data-component="search-trigger"]A search control: [data-variant="bar"] the Search header's bar, [data-variant="icon"] the header icon, [data-variant="sheet"] the phone menu's row, [data-variant="button"] the button on the 404 page
[data-component="theme-toggle"]The light and dark button
[data-component="bookmarks-link"]The header's bookmark icon with its count, and the phone menu's Bookmarks link (two matches)
[data-component="auth-links"]Sign in and Subscribe: [data-variant="header"] in the header, [data-variant="menu"] in the phone menu
[data-region="mobile-menu"]The phone menu's contents. The dialog around it carries no hook: see the note at the end
[data-part="secondary"]The phone menu's secondary block: the panels below the main menu, so one rule hides the lot
[data-part="secondary-group"]One panel in that block: Explore, or a group opened by a # header. Its label is written by the theme's script, so style it, never rename it
[data-region="site-footer"]The footer. [data-variant="tinted"], [data-variant="dark"] or [data-variant="accent"] from the Footer style setting; the Light ground carries no variant
[data-component="footer-brand"]The footer's brand block: logo, description, social icons
[data-component="newsletter-cta"][data-variant="footer"]The footer's newsletter band: [data-part="eyebrow"], [data-part="title"], [data-part="lede"], [data-part="proof"] (with [data-part="count"] and [data-part="hint"] inside) and [data-part="form"]
[data-region="footer-columns"]The footer's link columns
[data-region="footer-nav"]One footer menu; [data-variant="group"] on a column made with a # heading, no variant on the Explore column
[data-region="footer-legal"]The legal row: the copyright line, the legal links and the credits with the scheme button
[data-component="legal-links"]The legal row's links, from pages tagged #footer-legal-link
[data-component="social-links"]A row of social icons: [data-variant="site"] in the footer, [data-variant="author"] on author headers and cards

Homepage

HookWhat it is
[data-region="hero"]The hero: [data-variant="newsletter"] or [data-variant="magazine"]
[data-region="hero"][data-layout="cover"]The Newsletter hero while the site cover image renders; [data-variant="newsletter"]:not([data-layout]) is the plain band
[data-part="cover"]The site cover picture in the Newsletter hero (also the immersive post header's picture, and a topic's picture in its header)
[data-part="proof"]The portraits and member count under the hero's form, and in the membership band
[data-part="count"]In the proof row, the member-count sentence; elsewhere a story count
[data-part="hint"]The fine print under a form
[data-part="member"]The signed-in line the Newsletter hero, the footer band and the Magazine hero's tile show in place of their forms
[data-part="form"]A signup form
[data-component="newsletter-cta"][data-variant="tile"]The signup tile in the Magazine hero
[data-component="lead-stories"]The Magazine hero's lead, a slider when it holds more than one story; [data-part="strip"] is its Up next, count and arrows
[data-component="topic-tabs"]The Magazine hero's Latest by topic box; [data-part="tab"] is a tab and [data-part="panel"] its list of stories
[data-component="editors-picks"]The picks carousel under the Newsletter hero
[data-component="topic-chips"]The chips row above Latest stories (and on topic pages)
[data-region="home-feed"]Latest stories
[data-region="home-section"][data-variant="tag"]A section from a page tagged #home-section; [data-tag="<slug>"] beside it names the tag
[data-region="home-topics"]The Topics section
[data-component="tag-tile"]A topic tile: [data-variant="image"] with a picture, [data-variant="outline"] without
[data-component="membership-band"]The membership band (home, topic pages, the 404 page and posts)
[data-component="join-card"]The band's card
[data-component="plan-row"]A plan in the card: [data-variant="free"] or [data-variant="paid"], [data-featured="true"] on the Most popular plan; parts [data-part="price"], [data-part="benefits"], [data-part="plan-foot"]
[data-component="pagination"]Load more stories, or the Newer and Older stories links with Feed pagination set to Pages, with the progress line and the count in stories; at the end of the feed, [data-feed-end] holds the closing note and Back to top. In Pages mode the feed above it carries data-feed-pages, so [data-feed-pages] tells the two modes apart
[data-component="empty-state"]The card shown when a list is empty: [data-variant="cards"], [data-variant="tiles"], [data-variant="people"], [data-variant="bookmark"]; parts [data-part="title"], [data-part="text"], [data-part="action"]

Story cards

HookWhat it is
[data-component="post-card"]A story card, everywhere one appears
[data-component="post-card"][data-variant="grid"]The grid card: the homepage feed, topic pages, related stories
[data-component="post-card"][data-variant="list"]The row card on author pages
[data-component="post-card"][data-variant="cover"]A story in the Magazine hero's lead: the picture fills it, the words sit at its foot
[data-component="post-card"][data-variant="overlay"]One of the two stories under the Magazine hero's lead, from tablet width up (phones show the grid card)
[data-component="post-card"][data-variant="row"]A story in the Magazine hero's topic tabs
[data-component="post-card"][data-variant="split"]A topic page's lead card
[data-component="post-card"][data-variant="tray"]A card in the carousel under the Newsletter hero
[data-part="image"]The card's picture box
[data-part="placeholder"]The box standing in for a missing picture
[data-part="featured-mark"]The star on a featured card's picture on phones
[data-part="kicker"]The topic above a title
[data-part="labels"]The Featured, Members and Paid pills
[data-part="title"]The title
[data-part="excerpt"]The excerpt
[data-part="avatar"]The author's portrait or initial
[data-part="author"], [data-part="date"], [data-part="read-time"], [data-part="meta"]The byline pieces
[data-component="bookmark-button"]The bookmark toggle on a card or in a byline

Posts and pages

HookWhat it is
[data-region="post"]The article
[data-region="post-header"]The post header. No variant is the default; [data-variant="immersive"], [data-variant="split-right"] and [data-variant="split-left"] are the layouts chosen by tag
[data-region="post-meta"]The byline strip
[data-part="comments-count"]The byline's comment count, a link to the thread
[data-component="social-share"]Share, or X and LinkedIn, plus Copy link
[data-component="ask-ai"]The Summarize with AI menu
[data-component="reading-size"]The Aa text size control
[data-region="feature-image"]The feature image figure; [data-variant="video"] is the video hero, with parts [data-part="caption"], [data-part="poster"] and [data-part="play-mark"]
[data-region="post-body"]The article body; [data-variant="dropcap"] on a post or page tagged #dropcap
[data-component="table-of-contents"]The contents: [data-variant="inline"] is the phone box under the picture, no variant is the rail beside the article
[data-component="reading-progress"]The reading progress bar
[data-component="code-copy"]The copy button on a code block (added by the script)
[data-region="post-footer"]The tags and the author box under a post; [data-part="tags"] is the tag row
[data-component="author-card"]The author box at the end of a post (no variant; the directory cards carry one)
[data-component="post-navigation"]Previous and next stories; each link is [data-component="post-nav-link"] with [data-variant="prev"] or [data-variant="next"]
[data-region="comments"]The comments
[data-region="related"]Related stories
[data-component="member-cta"]The paywall box: [data-variant="signup"] for visitors, [data-variant="upgrade"] for members on a lower tier
[data-region="page"], [data-region="page-header"]A page and its header

Archives

HookWhat it is
[data-region="archive-header"]The heading block: [data-variant="tag"] on a topic page, [data-variant="author"] on an author page, [data-variant="topics"] on /tags/, [data-variant="authors"] on the authors directory
[data-part="title"], [data-part="excerpt"], [data-part="lede"]The heading and the line under it
[data-part="meta"], [data-part="count"]A topic header's count-and-feed line, and the count itself
[data-part="avatar"], [data-part="bio"], [data-part="location"], [data-part="website"]An author's portrait, bio, location and website
[data-part="directory"]The author page's Browse all authors link
[data-region="post-feed"]The story list on topic and author pages, and on later pages of the home feed
[data-region="topics"]The tile grid on /tags/
[data-region="archive-index"][data-variant="authors"]The authors directory; [data-part="list"] is its grid
[data-component="author-card"][data-variant="directory"]A card in the authors directory
[data-region="bookmarks"]The bookmarks page
[data-region="error"]The 404 page ([data-variant="404"]) or the error page ([data-variant="generic"]); [data-part="routes-hint"] is the 404 page's note about the routes file

Membership and signup forms

HookWhat it is
[data-region="membership"]The join page
[data-part="eyebrow"], [data-part="lede"]The join page's small heading and intro line
[data-component="billing-toggle"]The monthly and yearly switch
[data-component="tier-grid"]The tier cards' grid
[data-component="tier-card"]A tier card: [data-variant="free"] or [data-variant="paid"], [data-featured="true"] on the highlighted tier; parts [data-part="price"] and [data-part="benefits"]
[data-part="terms"]Ghost's signup notice inside a form, with its checkbox when agreement is required
[data-part="newsletters"]The newsletter panel inside a form; an open one is [data-part="newsletters"] details[open]; each newsletter's description is [data-part="description"]
[data-part="signup-access"]What replaces a form on a paid-members-only site: the Subscribe button and the sign-in line
[data-part="access-notice"]The line shown to visitors who cannot join, on the membership page and in the paywall: Membership is by invitation. or Membership is not open right now., with the sign-in link

States you can select on

These are written by the theme as the page runs. Select on them; never set them yourself.

StateMeaning
.dark on <html>Dark mode is showing
[data-color-scheme] on <html>The Color scheme setting (Light, Dark, System)
[data-font-size] on <html>The reader's text size, small or large; absent for Default
.menu-open on <html>The phone menu is open
.site-header--collapsedThe Search header has collapsed on scroll
[data-layout]The header's style; cover on the Newsletter hero and its carousel while the cover image renders
details[open]An open newsletter panel or text size control
[data-copied]A code block's copy button right after copying
[aria-pressed="true"]A bookmarked story's button
[aria-current="page"]The current menu item or topic chip
[data-docked]The video hero while it floats as the mini-player
[data-current]The story the Magazine hero's lead is showing, and the topic tab's list on show
[aria-selected="true"]The chosen tab in the Magazine hero's topic box
[aria-disabled="true"]The lead's Previous or Next button at either end of the slider, and the picks carousel's

Hands off the moving parts

A few elements are measured or rebuilt by the theme's scripts and carry no styling handle on purpose: the menu list inside the header ([data-nav]), the phone menu's dialog, the picks carousel's track, the Magazine hero's slides and tab row ([data-slides], [data-tablist]), the video box, the feed view that the topic chips swap, and the two contents mounts. Style the region or component around them. Ghost's own attributes (data-portal, data-members-*, data-ghost-*) belong to Ghost.