惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
雷峰网
雷峰网
罗磊的独立博客
T
The Blog of Author Tim Ferriss
阮一峰的网络日志
阮一峰的网络日志
量子位
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG
人人都是产品经理
人人都是产品经理
GbyAI
GbyAI
Cisco Talos Blog
Cisco Talos Blog
Engineering at Meta
Engineering at Meta
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
A
About on SuperTechFans
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Cloudflare Blog
Know Your Adversary
Know Your Adversary
T
Threat Research - Cisco Blogs
Spread Privacy
Spread Privacy
D
DataBreaches.Net
T
The Exploit Database - CXSecurity.com
K
Kaspersky official blog
Cyberwarzone
Cyberwarzone
爱范儿
爱范儿
U
Unit 42
Security Latest
Security Latest
M
MIT News - Artificial intelligence
月光博客
月光博客
Scott Helme
Scott Helme
G
Google Developers Blog
有赞技术团队
有赞技术团队
T
Tor Project blog
宝玉的分享
宝玉的分享
Y
Y Combinator Blog
博客园 - Franky
H
Hackread – Cybersecurity News, Data Breaches, AI and More
aimingoo的专栏
aimingoo的专栏
The GitHub Blog
The GitHub Blog
V
V2EX
B
Blog
Apple Machine Learning Research
Apple Machine Learning Research
S
Securelist
博客园 - 三生石上(FineUI控件)
Blog — PlanetScale
Blog — PlanetScale
TaoSecurity Blog
TaoSecurity Blog
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed
腾讯CDC
D
Docker
Google Online Security Blog
Google Online Security Blog

The Astro Blog

Astro 6.4 Astro 6.3 Starlight 0.39 Astro 6.2 What's new in Astro - April 2026 What's new in Astro - March 2026 Astro 6.1 CloudCannon Joins Astro as an Official CMS Partner Astro 6.0 What's new in Astro - February 2026 What's new in Astro - January 2026 Astro 5.17 Supporting the future of Astro The Astro Technology Company joins Cloudflare Astro 6 Beta What's new in Astro - December 2025 What's new in Astro - November 2025 Astro 5.16 Stainless Sponsors Astro, Launches Astro-Powered Docs Platform What's new in Astro - October 2025 Astro 5.15 Spirit of Astro: meet the winning designs What's new in Astro - September 2025 Astro 5.14 Cloudflare Donates $150,000 to Support Astro's Open Source Mission Webflow Donates $150,000 to Support Astro's Open Source Mission Mux: Our Official Video Partner Unleashing creativity: How CodeTV built a video streaming platform with Astro and Mux | Astro What's new in Astro - August 2025 Astro 5.13 What's new in Astro - July 2025 Astro 5.12 Starlight 0.35 Astro 5.11 What's new in Astro - June 2025 Live Content Collections: A Deep Dive Introducing… Astro Mart Astro Solstice Festival Astro 5.10 Astro 5.9 What's new in Astro - May 2025 Astro 5.8 What's new in Astro - April 2025 2025 Technical Steering Committee Astro 5.7 Astro Agency Partner Program Astro 5.6 What's new in Astro - March 2025 Astro 5.5 What's new in Astro - February 2025 Astro 5.4 Starlight 0.32 Astro 5.3 What's new in Astro - January 2025 Astro 5.2 2024 year in review What's new in Astro - December 2024 Astro 5.1 Astro 5.0 Google IDX: Our Official Online Editor Partner What's new in Astro - November 2024 What's new in Astro - October 2024 Astro x Cloudinary SDK What's new in Astro - September 2024 Community Loaders for Astro Content Layer Astro x Hygraph: Content Loader Astro x Cloudinary: Content Loader Astro x Storyblok: Content Loader Content Layer: A Deep Dive Starlight 0.28 Astro 5.0 Beta Release The $100,000 Astro Ecosystem Fund Fall Update Goodbye Studio, Hello DB What's new in Astro - August 2024 Astro 4.15 Astro 4.14 Astro 4.13 What's new in Astro - July 2024 Astro 4.12: Server Islands Netlify: Our Official Deployment Partner What's new in Astro - June 2024 Astro 4.11 Astro Together 2024 Server Islands The Astro Content Layer Zero-JavaScript View Transitions Astro 4.10 Starlight turns one year old! What's new in Astro - May 2024 Astro 4.9 Astro 4.8 What's new in Astro - April 2024 Astro 4.7 Astro 4.6 What's new in Astro - March 2024 Migrating 500+ tests from Mocha to Node.js Astro DB: A Deep Dive The Astro Developer Portal Astro DB Astro 4.5
Starlight April Update
Chris Swithinbank · 2025-04-17 · via The Astro Blog

🌸 Blossoms all around me and Starlight is growing too. Let’s take a look and see what’s new!

We’ve been working through our roadmap towards releasing v1 later this year. Here are some highlights from our latest releases:

  • Built-in heading anchor links
  • Tailwind v4 support
  • CSS cascade layers
  • Improved <head> APIs

To upgrade an existing Starlight site, use the automated @astrojs/upgrade CLI tool. This will update Starlight, Astro, and any other integrations you are using:

Starlight v0.34 adds built-in support for automatically rendering clickable anchor links next to headings in your Markdown, MDX, and Markdoc content.

A subheading in the Starlight docs showing a pointer cursor hovering over an anchor link icon.

We built on accessibility research by Amber Wilson to design an anchor link approach that aims to be helpful for all users.

Starlight places the link element below the heading in the HTML output and automatically generates an accessible label from your Markdown content. For example, the following Markdown:

will generate HTML a bit like this:

<h2 id="get-started">Get started</h2>

<a href="#get-started">Section titled “Get started”</a>

This ensures that headings in the document structure are not cluttered by anchor links and that the links themselves still have a clear label available for assistive technology. We’ve been using this approach in the Astro docs for some time now and are excited to make it available to all sites built with Starlight!

Tailwind v4 support

Starlight has supported authoring styles with Tailwind CSS since shortly after our first release via a custom Tailwind plugin. We’ve now updated our support for compatibility with Tailwind v4!

Tailwind v4 comes with some big changes. Support is now provided via a Vite plugin and configuration has moved to a CSS file instead of a JS module. Starlight’s Tailwind compatibility styles must now be imported directly in your CSS and customized using the @theme directive:

/* Include the "starlight" layer alongside Tailwind’s default layers. */

@layer base, starlight, theme, components, utilities;

/* Import Starlight’s compatibility styles. */

@import '@astrojs/starlight-tailwind';

@import 'tailwindcss/theme.css' layer(theme);

@import 'tailwindcss/utilities.css' layer(utilities);

@theme {

/* Configure Starlight theme variables. */

}

For detailed guidance on updating see the @astrojs/starlight-tailwind changelog. You might also want to keep the official Tailwind v4 upgrade guide and Starlight’s Tailwind set-up guide handy.

CSS cascade layers

It’s important that Starlight users can easily customize their sites. Historically, clashes between Starlight’s built-in styles and a user’s CSS made the customization experience less smooth than it could have been:

/* Starlight built-in styles (simplified) */

:not(h1, h2, h3, h4, h5, h6) + h2 {

margin-top: 1.5em;

}

/* User styles */

h2 {

margin-top: 1em; /* ❌ Doesn’t apply because `h2` is a lower specificity! */

}

Starlight v0.34 solves conflicts by moving all built-in styles into a dedicated starlight CSS cascade layer. This means that user styles will always take precedence over default styles and we can wave goodbye to specificity battles. 👋

/* Starlight built-in styles (simplified) */

@layer starlight.content {

:not(h1, h2, h3, h4, h5, h6) + h2 {

margin-top: 1.5em;

}

}

/* User styles */

h2 {

margin-top: 1em; /* ✅ Applies because it’s in the top layer! */

}

This change also means you can enjoy the benefits of using @layer to organize your own CSS without Starlight’s styles always overriding it.

Learn more about using cascade layers in Starlight’s “CSS & Styling” guide.

Improved <head> APIs

In Starlight v0.33, we added a new head property to our route data object. This unlocks full control over Starlight’s <head> tags in route middleware, including for plugins, allowing you to add tags and filter default tags more easily.

For example, this middleware uses Railway’s demo Open Graph image API to add og:image meta tags to every Starlight page:

import { defineRouteMiddleware } from '@astrojs/starlight/route-data';

export const onRequest = defineRouteMiddleware((context) => {

const { entry, head } = context.locals.starlightRoute;

// Create an Open Graph image URL using the current page’s title.

const ogImageUrl = new URL(

'https://og.railway.com/api/image?fileType=png&layoutName=simple',

);

ogImageUrl.searchParams.set('text', entry.data.title);

// Add a `<meta property="og:image">` tag to the current page’s `<head>`.

head.push({

tag: 'meta',

attrs: { property: 'og:image', content: ogImageUrl.href },

});

});

Bug fixes and more

As always, we’ve also been working to fix issues and extend existing features. See the Starlight changelog for all the details including migration guidance for breaking changes.

Thanks

Thanks to everyone who contributed to our recent releases with PRs and reviews, including HiDeoo, Dhruv Bhanushali, Hippo, mayank99, Mark Gaze, Matthew Justice, Ariel K, techfg, jsparkdev, trueberryless, Juan Diaz, dragomano, Armand Philippot, Ayo Ayco, Oluwatobi Sofela, liruifengv, Lars Kappert, Emilien Guilmineau, Florian Lefebvre, Emanuele Stoppa, Ervins Strauhmanis, Pejyuu, and Sarah Rainsberger.

We look forward to seeing what you build with Starlight! If you have questions, comments, or just want to say hi, drop by the Astro Discord.