Utilities
Paragraph Spacing
The Paragraph Spacing
utility provides a way to control the spacing between paragraphs, enhancing readability and visual appeal of text content.
Utility Class | USS Properties |
---|---|
paragraph-spacing-0 | -unity-paragraph-spacing: 0px; |
paragraph-spacing-1 | -unity-paragraph-spacing: 4px; |
paragraph-spacing-2 | -unity-paragraph-spacing: 8px; |
paragraph-spacing-3 | -unity-paragraph-spacing: 12px; |
paragraph-spacing-4 | -unity-paragraph-spacing: 16px; |
paragraph-spacing-5 | -unity-paragraph-spacing: 20px; |
paragraph-spacing-6 | -unity-paragraph-spacing: 24px; |
paragraph-spacing-7 | -unity-paragraph-spacing: 28px; |
paragraph-spacing-8 | -unity-paragraph-spacing: 32px; |
paragraph-spacing-9 | -unity-paragraph-spacing: 36px; |
paragraph-spacing-10 | -unity-paragraph-spacing: 40px; |
paragraph-spacing-11 | -unity-paragraph-spacing: 44px; |
paragraph-spacing-12 | -unity-paragraph-spacing: 48px; |
paragraph-spacing-14 | -unity-paragraph-spacing: 56px; |
paragraph-spacing-16 | -unity-paragraph-spacing: 64px; |
paragraph-spacing-20 | -unity-paragraph-spacing: 80px; |
paragraph-spacing-24 | -unity-paragraph-spacing: 96px; |
paragraph-spacing-28 | -unity-paragraph-spacing: 112px; |
paragraph-spacing-32 | -unity-paragraph-spacing: 128px; |
paragraph-spacing-36 | -unity-paragraph-spacing: 144px; |
paragraph-spacing-40 | -unity-paragraph-spacing: 160px; |
paragraph-spacing-44 | -unity-paragraph-spacing: 176px; |
paragraph-spacing-48 | -unity-paragraph-spacing: 192px; |
paragraph-spacing-52 | -unity-paragraph-spacing: 208px; |
paragraph-spacing-56 | -unity-paragraph-spacing: 224px; |
paragraph-spacing-60 | -unity-paragraph-spacing: 240px; |
paragraph-spacing-64 | -unity-paragraph-spacing: 256px; |
paragraph-spacing-72 | -unity-paragraph-spacing: 288px; |
paragraph-spacing-80 | -unity-paragraph-spacing: 320px; |
paragraph-spacing-96 | -unity-paragraph-spacing: 384px; |
paragraph-spacing-px | -unity-paragraph-spacing: 1px; |
paragraph-spacing-0point5 | -unity-paragraph-spacing: 2px; |
paragraph-spacing-1point5 | -unity-paragraph-spacing: 6px; |
paragraph-spacing-2point5 | -unity-paragraph-spacing: 10px; |
paragraph-spacing-3point5 | -unity-paragraph-spacing: 14px; |
Basic Usage in UXML
To apply paragraph spacing, use one of the utility classes that best fits your design needs. The paragraph-spacing-{value}
classes adjust the spacing between paragraphs to a specific value.
<ui:Label class="paragraph-spacing-2">
<!-- Text content with 8px spacing between paragraphs -->
</ui:Label>
Customize
Modifier Variations
You can customize which modifier variations of the Paragraph Spacing
utility are generated, such as pseudo-classes (e.g., hover
, focus
) and custom modifiers.
Paragraph Spacing
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:
- Open the Theme Config Asset: Find the asset within your Unity project.
- Navigate to the 'Utilities' Section: Locate the
Paragraph Spacing
utility. - 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
The Paragraph Spacing
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 Paragraph Spacing
utility:
- paragraph-spacing : -unity-paragraph-spacing
To customize these tags and properties, you can edit the Tag Property Map
field for the Paragraph Spacing
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 Paragraph Spacing
utility uses values from the following fields from the Core
section of the Theme Config asset:
- Spacing
To customize or define these extended fields:
- Open the Theme Config Asset: Locate the asset within your Unity project.
- Navigate to the 'Utilities' Section: Find the
Paragraph Spacing
utility. - 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 Paragraph Spacing
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.