
đż 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.