--- layout: page title: Utilities --- There are a handful of utilities in Primer for quick behaviors, floats, colors, alignment, and more. ## Contents * Will be replaced with the ToC, excluding the "Contents" header {:toc} ## Truncation `.css-truncate` will shorten text with an ellipsis. The maximum width of the truncated text can be changed by overriding the max-width of the .css-truncate-target. {% example html %} really-long-branch-name {% endexample %} You can reveal the entire string on hover with the addition of `.expandable`. {% example html %} {% endexample %} ## Counter Add a number or unread indicator to navs and more with a counter. {% example html %} 9 {% endexample %} ## Floats Quickly float something to the left or right, and clear them later. {% example html %}
.left
.right
Left aligned text.
Right aligned text.
Center aligned text.
{% endexample %} ## Background colors Fill in an element with background colors. {% example html %} .bg-white .bg-gray-dark .bg-blue .bg-blue-light .bg-gray .bg-gray-light .bg-green .bg-red {% endexample %} ## Text color Change the `color` of elements with a class. {% example html %} .text-blue .text-red .text-gray-light .text-gray .text-gray-dark .text-green .text-orange .text-purple .text-white .text-inherit {% endexample %} ## Link colors The default link color is blue, but there are a couple of other options to use for deemphasized links. On `:hover` all links will turn blue. {% example html %}Here is some example text. And a .link-blue
Here is some example text. And a .link-gray
Here is some example text. And a .link-gray-dark
{% endexample %} ## Flex table Flex table is a module for creating dynamically resizable elements that always sit on the same horizontal line (e.g., they never break to a new line). Using table styles in our CSS means it's cross browser friendly back to at least IE9. Additional `margin` or `padding` may be required to properly space content. {% example html %}