Skip to content

v3.0.4

Latest

Choose a tag to compare

@stamat stamat released this 31 Aug 00:48

Fixed

  • A preview no longer shakes when the sample is about as tall as the height cap. The
    wrapper scrolls whatever is past max-height: 70vh, and a scrollbar arriving is a width
    change, which is what the element refits on. A sample whose height follows its width —
    anything with an aspect-ratio, a <video> above all — shortened by the scrollbar's
    width, dropped back under the cap, lost the scrollbar, widened, grew past the cap again,
    and went round for as long as it was on screen. Easiest to hit zoomed in or on a narrow
    window, where a fixed-ratio sample sits nearest the cap. .code-preview-viewport now
    carries scrollbar-width: none: it still scrolls, and the scrollbar no longer costs it
    any width to appear.

    The cost is stated rather than hidden. A sample past the cap now shows no scrollbar to
    say there is more — the cut of its own content is the only sign — though wheel,
    trackpad, keyboard and find-in-page all still reach it. Reserving a stable gutter was the
    other way to hold the width still, and it charges an empty strip down the right of every
    preview on the platforms that have scrollbars, including the great majority that never
    reach the cap. On an engine without scrollbar-width the scrollbar returns and so does
    the shake, which is where this started rather than anywhere worse. Put it back for
    yourself with code-preview .code-preview-viewport { scrollbar-width: auto; }.

Full Changelog: v3.0.3...v3.0.4