Skip to content

4.0.0

Latest

Choose a tag to compare

@WOLFRIEND WOLFRIEND released this 15 Oct 18:41

Skeleton Mammoth 4.0.0

A smaller library (13.8 KB instead of 32 KB, 1.9 KB gzipped) with new features, a simpler configuration and the support of the high contrast mode.

Breaking changes

  • Minimum browser versions are raised: Chrome 123, Edge 123, Firefox 120, Safari 17.5. The theme now uses color-scheme and light-dark(). In older browsers the skeleton is not displayed.
  • borderRadius is now a fallback. The own border-radius of an element always takes precedence, and the prop is used only for the elements that do not have their own. Before, the prop overrode the own radius.
    If you relied on that, set the radius in your own CSS for the loading state, for example .sm-loading .card__image { border-radius: 12px; }.

New

  • Text lines: the sm-item-lines-N classes (N is from 1 to 10) draw the skeleton of a text as N lines, even if the element is still empty. The sm-item-lines class takes the number of the lines from the text. The --sm-lines and --sm-lines-gap variables.
  • reveal: "fade": the content appears smoothly when the loading is finished (the --sm-reveal-duration and --sm-reveal-timing-function variables).
  • theme: "inherit": the skeleton takes the color-scheme of your page.
  • borderRadius: "full": a circle or a pill.
  • High contrast mode (forced-colors): the skeleton is visible and the hidden text stays hidden (the --sm-color-forced and --sm-color-forced-animation variables).
  • The README is rewritten: the configuration format, the notes and limitations, the troubleshooting, the examples for HTML, React, Vue, Angular and Svelte.

Upgrade

  1. Check the minimum browser versions of your project.
  2. If you used the borderRadius prop on elements that have their own border-radius, see above.
  3. Nothing else changes: the classes, the data-sm-config format, the default values and the --sm-* variables work as before.