Skip to content

Borders

This component provides a comprehensive set of utility classes for controlling borders, border styles, border radius, and special animated border effects in Metro UI.

The border.less file defines various CSS classes for manipulating borders on elements, including utilities for removing borders, setting border styles, controlling border radius, and creating animated border effects.

VariableDefault Value
--border-radius6px
VariableDefault ValueDescription
--gradient-border-speed3sDuration of the border animation
--gradient-border-size2pxWidth of the animated border
--gradient-border-colors#ff4545, #00ff99, #006aff, #ff0095, #ff4545Default colors for animated borders
ClassDescription
.gradient-borderApplies an gradient border effect
<div class="box" style="height: 300px; width: 300px;">
<div class="box text-center gradient-border">...</div>
<div class="box text-center gradient-border"
style="--gradient-border-colors: var(--color-violet), var(--color-cyan), var(--color-violet)">...</div>
</div>
VariableDefault ValueDescription
--animated-border-speed3sDuration of the border animation
ClassDescription
.animated-borderApplies an animated rotating border effect
.animated-border-hoverApplies the animated border effect only on hover
.animated-border-{color}Applies the gradient border effect with a specific color
<div class="box" style="height: 300px; width: 300px;">
<div class="box text-center gradient-border animated-border">...</div>
<div class="box text-center animated-border-red">...</div>
</div>
ClassDescription
.no-borderRemoves all borders
.no-border-leftRemoves left border
.no-border-rightRemoves right border
.no-border-topRemoves top border
.no-border-bottomRemoves bottom border
.no-border-visibleMakes borders transparent
ClassDescription
.border-noneRemoves all borders
.border-left-noneRemoves left border
.border-right-noneRemoves right border
.border-top-noneRemoves top border
.border-bottom-noneRemoves bottom border
.border-visible-noneMakes borders transparent
ClassDescription
.borderAdds a 1px transparent border on all sides
.border-leftAdds a 1px transparent border on the left
.border-rightAdds a 1px transparent border on the right
.border-topAdds a 1px transparent border on the top
.border-bottomAdds a 1px transparent border on the bottom
ClassDescription
.border-radius, .roundedApplies the default border radius (6px)
.border-radius-half, .to-cycleMakes the element circular (border-radius: 50%)
.border-radius-1 through .border-radius-20Sets specific border radius from 1px to 20px
ClassDescription
.border-size-1 through .border-size-20Sets border width from 1px to 20px
ClassDescription
.border-solidSets solid border style
.border-dashedSets dashed border style
.border-dottedSets dotted border style
.border-doubleSets double border style
.border-grooveSets groove border style
.border-insetSets inset border style
.border-outsetSets outset border style
.border-ridgeSets ridge border style

The file includes responsive variants for border removal classes that apply at different breakpoints:

ClassDescription
.border-none-{breakpoint}Removes all borders at specified breakpoint
.border-top-none-{breakpoint}Removes top border at specified breakpoint
.border-right-none-{breakpoint}Removes right border at specified breakpoint
.border-bottom-none-{breakpoint}Removes bottom border at specified breakpoint
.border-left-none-{breakpoint}Removes left border at specified breakpoint

Where {breakpoint} can be: xs, sm, md, lg, xl, xxl, xxxl

<!-- Adding borders -->
<div class="border">Element with a 1px transparent border</div>
<div class="border border-solid">Element with a 1px solid border</div>
<!-- Removing borders -->
<div class="no-border">Element with no border</div>
<div class="border-top-none">Element with no top border</div>
<!-- Border radius -->
<div class="rounded">Element with default border radius</div>
<div class="to-cycle">Circular element</div>
<div class="border-radius-10">Element with 10px border radius</div>
<!-- Border size -->
<div class="border border-solid border-size-3">Element with 3px solid border</div>
<!-- Border style -->
<div class="border border-dashed">Element with dashed border</div>
<!-- Border that disappears on medium screens and above -->
<div class="border border-solid border-none-md">
This element has a border on small screens only
</div>
  • To use animated borders, the parent element must have position: relative (this is automatically applied by the CSS).
  • Animated borders use CSS @property and conic gradients, which may not be supported in all browsers.
  • Border colors can be set using standard CSS, or by combining with Metro UI color utility classes.