github withastro/starlight @astrojs/starlight@0.43.0

48 minutes ago

Minor Changes

  • #4190 3f2336b Thanks @delucis! - ⚠️ BREAKING CHANGE: Adds support for any Astro scopedStyleStrategy configuration.

    Previously, Starlight forced the "where" strategy, resulting in CSS selectors like :where(.astro-HASH). Starlight now respects the strategy set in astro.config.mjs and 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 a class down 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 class to 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 993ac27 Thanks @controversial! - Adds support for Pagefind’s excludeSelectors and includeCharacters configuration to customize how search indexes are built

  • #4219 35abe4f Thanks @delucis! - Refactors Starlight’s theme select menu to reduce its JavaScript use

    ⚠️ Potentially breaking change: If your project or theme plugin overrides the ThemeSelect component, check that it still works after updating. The global API previously used by theme select components has been removed and calling StarlightThemeProvider.updatePickers() will no longer work.

    See ThemeProvider.astro, ThemeSelect.astro, and LanguageSelect.astro on GitHub for the full source code of the updated components.

  • #4385 c130349 Thanks @delucis! - Updates dependency i18next to 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.

Patch Changes

  • #4390 f8b072a Thanks @Toyenzo! - Errors if an aside is passed an icon name that matches Object.prototype properties, such as constructor or toString

Don't miss a new starlight release

NewReleases is sending notifications on new releases.