Skip to content

CSS utility classes

Library provides a set of utility classes to help you style your components. These classes are designed to be used in combination with other classes to create a wide range of layouts and designs.

Display

html
<div class="ui-display--block">...</div>

<div class="ui-display--inline-block">...</div>

<div class="ui-display--flex">...</div>

<div class="ui-display--inline-flex">...</div>

<div class="ui-display--inline">...</div>

<div class="ui-display--none">...</div>

Position

html
<div class="acv-position--static">...</div>

<div class="acv-position--relative">...</div>

<div class="acv-position--absolute">...</div>

<div class="acv-position--fixed">...</div>

Size

html
<div class="acv-size--height-100">...</div>

<div class="acv-size--height-100vh">...</div>

<div class="acv-size--height-auto">...</div>

<div class="acv-size--width-100">...</div>

<div class="acv-size--width-100vw">...</div>

<div class="acv-size--width-auto">...</div>

Spacing

These classes can be applied with the usage of the following format: {property}{direction}-{size}

The property applies the type of spacing:

  • m - applies margin
  • p - applies padding

The direction designates the side, which identation property is applied to:

  • t - applies the property for margin-top or padding-top
  • b - applies the property for margin-bottom or padding-bottom
  • l - applies the property for margin-left or padding-left
  • r - applies the property for margin-right or padding-right
  • x - applies properties for both *-left and *-right
  • y - applies properties for both *-top and *-bottom
  • a - applies the property for *margin and *padding in all directions

The size controls the propery's increment:

  • 0 - removes margin or padding by setting it to 0
  • 8 - sets margin or padding as 8
  • 16 - sets margin or padding as 16
  • 24 - sets margin or padding as 24

For block elements with a designated width, you can apply .mx-auto to horizontally center the content.

Overflow

this content will show a native scroll bar because it overflows parent
acv-overflow--auto
the overflowed content will be hidden in this example
acv-overflow--hidden

Text

Ellipsis

Text ellipsis styling does not work with inline elements. You can use acv-display--inline-block class to overwrite the display property if needed.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Id venenatis a condimentum vitae sapien.
acv-text--ellipsis
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Id venenatis a condimentum vitae sapien.
acv-text--ellipsis with span
Source code
vue
<script setup>
  // import '@acronis-platform/ui-component-library/styles/utilities.css';
</script>

<template>
  <PreviewGroup>
    <Preview
      name="acv-text--ellipsis"
      span="12"
    >
      <div class="acv-text--ellipsis">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Id venenatis a condimentum vitae sapien.
      </div>
    </Preview>
    <Preview
      name="acv-text--ellipsis with span"
      span="12"
    >
      <div class="acv-size--width-100">
        <span class="acv-text--ellipsis acv-display--inline-block">
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Id venenatis a condimentum vitae sapien.
        </span>
      </div>
    </Preview>
  </PreviewGroup>
</template>

Text-Middle-Ellipsis

If the text content is an invalid windows/mac/linux path, the path would not be hidden, and a warning would appear in the console.

The text has to be enclosed an element that specifies the width of the path.

Windows path

C:\Users\ui.kit\Desktop\Folder\Folder\testfile.txt

Linux/Mac path

/users/ui.kit/desktop/folder/folder/testfile.txt

With hint when hover

C:\Users\ui.kit\Desktop\Folder\Folder\testfile.txt

Window path with long file name

C:\\Users\\Css.Test\\Desktop\\windows-text-middle-ellipsis-no-hint.txt

Mac path with long file name

/User/abcde/Downloads/eicarcom2.zip.download

very long file name

/usr/veryveryveryveryverylongfilename.txt

With icon

/usr/veryveryveryveryverylongfilename.txt

With title

/usr/veryveryveryveryverylongfilename.txt
Source code
vue
<script setup>
  import AcvIcon from '@/components/icon/icon.vue';
  import { vTextMiddleEllipsis } from '@/directives/textMiddleEllipsis.ts';
  import { IconPlus16 } from '@acronis-platform/icons/plus';
</script>

<template>
  <div class="acv-grid-row acv-grid--cols-3">
    <div>
      <h4 class="acv-h4">
        Windows path
      </h4>
      <div class="acv-size--width-100">
        <span v-text-middle-ellipsis>C:\Users\ui.kit\Desktop\Folder\Folder\testfile.txt</span>
      </div>
    </div>
    <div>
      <h4 class="acv-h4">
        Linux/Mac path
      </h4>
      <div class="acv-size--width-100">
        <span v-text-middle-ellipsis>/users/ui.kit/desktop/folder/folder/testfile.txt</span>
      </div>
    </div>
    <div>
      <h4 class="acv-h4">
        With hint when hover
      </h4>
      <div class="acv-text acv-size--width-100">
        <span v-text-middle-ellipsis:show-hover-hint>C:\Users\ui.kit\Desktop\Folder\Folder\testfile.txt</span>
      </div>
    </div>
    <div>
      <h4 class="acv-h4">
        Window path with long file name
      </h4>
      <div class="acv-size--width-100">
        <span v-text-middle-ellipsis:show-hover-hint>C:\\Users\\Css.Test\\Desktop\\windows-text-middle-ellipsis-no-hint.txt</span>
      </div>
    </div>
    <div>
      <h4 class="acv-h4">
        Mac path with long file name
      </h4>
      <div class="acv-size--width-100">
        <span v-text-middle-ellipsis:show-hover-hint>/User/abcde/Downloads/eicarcom2.zip.download</span>
      </div>
    </div>
    <div>
      <h4 class="acv-h4">
        very long file name
      </h4>
      <div class="acv-size--width-100">
        <span v-text-middle-ellipsis:show-hover-hint>/usr/veryveryveryveryverylongfilename.txt</span>
      </div>
    </div>

    <div>
      <h4 class="acv-h4">
        With icon
      </h4>
      <div class="acv-size--width-100 acv-text--nowrap">
        <span
          v-text-middle-ellipsis
          class="long"
        >
          /usr/veryveryveryveryverylongfilename.txt
        </span>
        <AcvIcon
          class="link__icon acv-bg--solid-brand-light"
          :icon="IconPlus16"
        />
      </div>
    </div>

    <div>
      <h4 class="acv-h4">
        With title
      </h4>
      <div class="acv-size--width-100 acv-text--nowrap">
        <span v-text-middle-ellipsis:show-hover-hint>
          /usr/veryveryveryveryverylongfilename.txt
        </span>
      </div>
    </div>
  </div>
</template>

<style scoped>
  .acv-grid-row > * {
    background-color: var(--acv-color-primary-lightest);
    width: 100%;
    overflow: hidden;
    min-height: 100px;
    padding-inline: 8px;
  }
</style>

Text align

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
acv-text--align-left
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
acv-text--align-center
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
acv-text--align-right
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
acv-text--align-justify

White space

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
acv-text--wrap
The text will not wrap to next line and it overflows the parent.
acv-text--nowrap

Word break

Background

acv-bg--brand-lightest
acv-bg--brand-accent
acv-bg--brand-lighter
acv-bg--brand-light
acv-bg--solid-brand-lightest
acv-bg--solid-brand-accent
acv-bg--solid-brand-lighter
acv-bg--solid-brand-light
acv-bg--fixed-white

Grid

Rows / Columns

Use the acv-grid--rows-{n} utilities to create grids with n equally sized rows. Use the acv-grid--cols-{n} utilities to create grids with n equally sized columns.

Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
Column 7
Column 8
Column 9
acv-grid--rows-3
Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
acv-grid--cols-2

Spans

Use the acv-grid--row-span-{n} utilities to make an element span n rows. Use the acv-grid--col-span-{n} utilities to make an element span n columns.

Column 1
Column 2
Column 3
Column 4
acv-grid--row-span-2
Column 1
Column 2
Column 3
Column 4
acv-grid--col-span-2

Start / End

Use the acv-grid--col-start-{n} and acv-grid--col-end-{n} utilities to make an element start or end at the nth grid line. These can also be combined with the acv-grid--col-span-{n} utilities to span a specific number of columns. Use the acv-grid--row-start-{n} and acv-grid--row-end-{n} utilities to make an element start or end at the nth grid line. These can also be combined with the acv-grid--row-span-{n} utilities to span a specific number of rows.

Column 1
Column 2
Column 3
Column 4
acv-grid--col-start / acv-grid--col-end
Column 1
Column 2
Column 3
acv-grid--row-start / acv-grid--row-end

Grid flow

Use the acv-grid--flow-{keyword} utilities to control how the auto-placement algorithm works for a grid layout.

1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
acv-grid--flow-col-dense
1
2
3
4
5
6
7
acv-grid--flow-row
1
2
3
4
5
6
7
acv-grid--flow-row-dense

MIT Licensed