#Vertical Align

New
0.7.2

These are utility classes to control vertical alignment of elements inside inline or table-box containers.

ClassStyles
u-align-baseline
vertical-align: baseline !important
u-align-top
vertical-align: top !important
u-align-middle
vertical-align: middle !important
u-align-bottom
vertical-align: bottom !important
u-align-text-top
vertical-align: text-top !important
u-align-text-bottom
vertical-align: text-bottom !important
u-align-sub
vertical-align: sub !important
u-align-super
vertical-align: super !important

#Examples

Below is a demo of all supported vertical alignment utility classes.

baseline

Set the u-align-baseline class to align the element with baseline vertical alignment.

Some text
top

Set the u-align-top class to align the element with top vertical alignment.

Some text
middle

Set the u-align-middle class to align the element with middle vertical alignment.

Some text
bottom

Set the u-align-bottom class to align the element with bottom vertical alignment.

Some text
text-top

Set the u-align-text-top class to align the element with text-top vertical alignment.

Some text
text-bottom

Set the u-align-text-bottom class to align the element with text-bottom vertical alignment.

Some text
sub

Set the u-align-sub class to align the element with sub vertical alignment.

Some text
super

Set the u-align-super class to align the element with super vertical alignment.

Some text

#Responsive

⚠ Note that the viewport variants are disabled in the default build of Cirrus. To enable, you must enable it yourself in _configs.scss and create a custom build or enable it in the config in your Sass project.

//_configs.scss
$config: (
    viewports: (
        flags.$VERTICAL-ALIGN: 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 u-align-inherit to be applied to some element for lg and above, then I would use the u-align-inherit-lg class.

<div class="u-align-inherit-lg">
    <!-- ... -->
</div>

For more information, visit the Viewports documentation.

#Variants

The classes specified above are the default utility classes for setting vertical alignment. You can add, change, or remove classes within the _config.scss file of Cirrus.

// _config.scss
$config: (
    extend: (
        vertical-align: (
            inherit
        )
    )
) !default;

This would generate the following class.

.u-align-inherit {
    vertical-align: inherit !important;
}

Learn more about how to extend Cirrus to support your use cases in the Configuration documentation.