#Max Height
Classes to set the maximum height of an element.
| Class | Styles |
|---|---|
max-h-none | |
max-h-10p | |
max-h-20p | |
max-h-30p | |
max-h-40p | |
max-h-50p | |
max-h-60p | |
max-h-70p | |
max-h-80p | |
max-h-90p | |
max-h-100p | |
max-h-screen | |
Classes to set the maximum height of an element.
| Class | Styles |
|---|---|
max-h-none | |
max-h-10p | |
max-h-20p | |
max-h-30p | |
max-h-40p | |
max-h-50p | |
max-h-60p | |
max-h-70p | |
max-h-80p | |
max-h-90p | |
max-h-100p | |
max-h-screen | |
Using these classes it quite simple to control the maximum height an element should have. You can either use a percentage based class or use a class to span the whole screen using the max-h-[size] syntax.
<div class="p-4 bg-green-100 u-round-xs text-white font-bold u-text-center">
<div class="max-h-100p p-2 bg-green-500 u-round-xs">max-h-100p</div>
</div>⚠ Note that the viewport variants are disabled in the default build of Cirrus. To enable, you must enable it yourself in
_configs.scssand create a custom build or enable it in the config in your Sass project.//_configs.scss $config: ( viewports: ( flags.$MAX-HEIGHT: true, ) ) !default;
To use the viewport variant of a given class, you just need to suffix each class with a viewport selector. For example, if I only want max-h-0 to be applied to some element for lg and above, then I would use the max-h-0-lg class.
<div class="max-h-0-lg">
<!-- ... -->
</div>For more information, visit the Viewports documentation.
The classes specified above are the default utility classes for setting maximum heights. You can add, change, or remove classes within the _config.scss file of Cirrus.
// _config.scss
$config: (
extend: (
max-heights: (
'25p': '25%',
)
)
) !default;This would generate the following additonal classes.
.max-h-25p {
max-height: 25% !important;
}Learn more about how to extend Cirrus to support your use cases in the Configuration documentation.