Skip to main content

Widget CSS: Use min-height in Your Widget Styling

Updated this week

Setting a min-height is a smart way to:

  • Prevent layout collapse when content is limited (e.g., only one performance listed).

  • Maintain a visually consistent space, even when the widget doesn't fully populate.

  • Improve responsiveness across screen sizes by letting the widget grow as needed—but never shrink too small.


šŸŽ“ Recap

The min-height CSS property defines the minimum vertical space an element can occupy, regardless of its content. On The Stage’s widget uses a default of 80vh (80% of the viewport height) to ensure the full calendar or list is always visible. If this feels too tall—such as when only one performance is listed—you can override it in your custom CSS for better visual balance.


šŸš€ Best Practices

  • Use vh units (viewport height) for responsive sizing that adapts to different screen sizes.

  • Adjust based on content context: for one or two shows, something like 20vh–40vh may be more appropriate than 80vh.

  • Use fallback values with var() to give flexibility across themes or pages.

  • Always test on desktop and mobile to ensure your min-height looks natural at all breakpoints.

  • Avoid setting it too small—or content may get clipped or look cramped.


šŸ› ļø Sample CSS Snippet

cssCopyEdit.ots-widget-min-height { min-height: var(--onstage-widget-min-height, 20vh); }

This sets a custom minimum height of 20vh, but still respects any higher value passed in via --onstage-widget-min-height.


šŸ”— Learn More

Want to dig deeper? Read the official W3Schools guide on min-height.

Did this answer your question?