Xmeter Style Guide

6.5 #Helpers.Constrain Constrain

Toggle example guides Toggle HTML markup

The Constrain Helper limits an element’s maximum inline-size (width, in horizontal writing modes), ensuring body content does not expand infinitely. It is very similar to the .h-Measure Helper, but it is meant for large containers, not for individual elements of prose (such as a paragraph or list).

author
Chris Harvey
updated
Example

content heading

This object is constrained to a maximum width. Expand your browser window (or zoom out) to see the effect.

Markup
<!--link rel="stylesheet" href="/node_modules/xmeter/css/dist/h-Constrain.css"/-->
<div class="h-Constrain">
  <h1>content heading</h1>
  <p>This object is constrained to a maximum width. Expand
    your browser window (or zoom out) to see the effect.</p>
</div>
Source: _h-Constrain.less, line 7