Utilities

Min-Height

The Min-Height utility allows you to define a minimum height for an element. This utility ensures that the element's height will not shrink below the specified value, providing control over the sizing behavior, especially useful in flexible or self-sizing layouts.

Utility Class
USS Properties
min-h-0
min-height: 0px;
min-h-1
min-height: 4px;
min-h-2
min-height: 8px;
min-h-3
min-height: 12px;
min-h-4
min-height: 16px;
min-h-5
min-height: 20px;
min-h-6
min-height: 24px;
min-h-7
min-height: 28px;
min-h-8
min-height: 32px;
min-h-9
min-height: 36px;
min-h-10
min-height: 40px;
min-h-11
min-height: 44px;
min-h-12
min-height: 48px;
min-h-14
min-height: 56px;
min-h-16
min-height: 64px;
min-h-20
min-height: 80px;
min-h-24
min-height: 96px;
min-h-28
min-height: 112px;
min-h-32
min-height: 128px;
min-h-36
min-height: 144px;
min-h-40
min-height: 160px;
min-h-44
min-height: 176px;
min-h-48
min-height: 192px;
min-h-52
min-height: 208px;
min-h-56
min-height: 224px;
min-h-60
min-height: 240px;
min-h-64
min-height: 256px;
min-h-72
min-height: 288px;
min-h-80
min-height: 320px;
min-h-96
min-height: 384px;
min-h-px
min-height: 1px;
min-h-0point5
min-height: 2px;
min-h-1point5
min-height: 6px;
min-h-2point5
min-height: 10px;
min-h-3point5
min-height: 14px;
min-h-full
min-height: 100%;
min-h-auto
min-height: auto;

Basic Usage in UXML

To use the Min-Height utility, apply the class min-h-{size} to an element. For example, min-h-0 sets the minimum height to 0. This means the element can be completely collapsed in height.

<ui:VisualElement class="min-h-0">
    <!-- Element with a minimum height of 0 -->
</ui:VisualElement>

Customize

Modifier Variations

Modifier Variations

You can customize which modifier variations of the Min-Height utility are generated, such as pseudo-classes (e.g., hover, focus) and custom modifiers.

By default, no modifier variations are defined for the Min-Height utility.

By fine-tuning the utility variations, you maintain control over your stylesheet's size and complexity, ensuring that only necessary styles are included. To update these values:

  1. Open the Theme Config Asset: Find the asset within your Unity project.
  2. Navigate to the 'Utilities' Section: Locate the Min-Height utility.
  3. Adjust Modifier Variations: Select which modifiers you want to be generated for the utility. Keep in mind that the order of the modifiers will affect the order and specificity of the generated USS classes.

Class Tags and Properties

Class Tags and Properties

The Min-Height utility generates classes based on predefined tags and their associated USS properties. While we recommend keeping these defaults for consistency and ease of reference in our documentation, you have the option to customize them to suit your project's specific needs.

These values are prepended to the defined values in this format tag-{value}. If a tag is empty, the generated class will simply be the value by itself.

Here are the default tags and the USS properties they set for the Min-Height utility:

  • min-h : min-height

To customize these tags and properties, you can edit the Tag Property Map field for the Min-Height utility in the Theme Config asset. This allows you to define new tags or modify existing ones, thus tailoring the generated classes to your preferences.

Extending Core Fields

The Min-Height utility uses values from the following fields from the Core section of the Theme Config asset:

  • Spacing
These fields are used in addition to any custom values defined for the utility. If the same key exists in both the utility and core configurations, the utility's values will override those from the core.

To customize or define these extended fields:

  1. Open the Theme Config Asset: Locate the asset within your Unity project.
  2. Navigate to the 'Utilities' Section: Find the Min-Height utility.
  3. Customize Extend Fields: Modify or add fields in the Extend Fields array to change the core configuration values that are extended. You'll only be able to extend fields of the same type.

Disable Utility

The Min-Height utility is enabled by default. You can disable it by unchecking the Enabled option in the Theme Config asset. This will prevent the generation of the utility's styles.

Previous
Max-Width