Minor Changes
-
#4190
3f2336bThanks @delucis! - ⚠️ BREAKING CHANGE: Adds support for any AstroscopedStyleStrategyconfiguration.Previously, Starlight forced the
"where"strategy, resulting in CSS selectors like:where(.astro-HASH). Starlight now respects the strategy set inastro.config.mjsand will default to Astro’s default"attribute"strategy, resulting in attribute selectors like[data-astro-cid-HASH].The new default can change some styling behaviour, so we recommend checking for visual changes in your site when updating. In particular, note the following:
-
Attribute selectors have a higher specificity than
:where()selectors. Check to ensure styles still apply and no CSS changes are needed to ensure the relative specificity of declarations remains the same. -
Astro’s
"attribute"strategy does not automatically pass along a parent component’s scope when passing aclassdown to a child component. If you have components that depended on this, you will need to update the child component to spread the parent’s data attribute where you are reusing the class name, for example:--- // Parent.astro --- <Child class="special-case" /> <style> .special-case { --accent-color: red; } </style>
--- // Child.astro -const { class: className } = Astro.props; +const { class: className, ...attributes } = Astro.props; --- -<div class={className}> +<div class={className} {...attributes}> <!-- ... --> </div>
See “Passing a
classto a child component” in the Astro docs for more details.
Alternatively, if you wish to continue using the previous scoping strategy in your site, set it explicitly in your Astro configuration file:
// astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ + scopedStyleStrategy: "where", // ... }); -
-
#3674
993ac27Thanks @controversial! - Adds support for Pagefind’sexcludeSelectorsandincludeCharactersconfiguration to customize how search indexes are built -
#4219
35abe4fThanks @delucis! - Refactors Starlight’s theme select menu to reduce its JavaScript use⚠️ Potentially breaking change: If your project or theme plugin overrides the
ThemeSelectcomponent, check that it still works after updating. The global API previously used by theme select components has been removed and callingStarlightThemeProvider.updatePickers()will no longer work.See
ThemeProvider.astro,ThemeSelect.astro, andLanguageSelect.astroon GitHub for the full source code of the updated components. -
#4385
c130349Thanks @delucis! - Updates dependencyi18nextto v27⚠️ Potentially breaking change: If you use Starlight’s translation APIs directly, see i18next’s migration guide for details. We don’t expect any changes to impact Starlight users, but let us know if they do.