Skip to main content

Border Utilities

NuvoUI provides a comprehensive system of border utilities to control border width, style, color, and border radius. These utilities make it easy to add and customize borders throughout your application.

Configuration

NuvoUI's border system is built around several configurable variables:

Border Widths

The border width utilities are generated from the VAR.$border-widths variable which defines the available border widths.

Border Radii

Border radius utilities are generated from the VAR.$border-radii map which defines preset radius values.

Border Styles

Border style utilities are generated from the $border-styles list:

Theme Colors for Borders

Border color utilities use theme color variables defined in the configuration. You can customize these colors in your theme configuration file.

Border Width Utilities

Control the width of borders on all sides or individual sides of an element.

All Sides

Individual Sides

Border Styles

Change the style of borders with border style utilities:

Border Colors

Apply different colors to borders using the built-in border color utilities

info

All the colors which are set in the theme configuration can be used as border colors. including semantic-colors like (primary, danger etc.), $color-primitives and $basic-colors

Combined Border Style and Color

NuvoUI provides convenient combined utilities for common border style and color combinations:

Border Radius (Rounded Corners)

Control the rounding of corners with border radius utilities:

All Corners

Individual Corners

Interactive States

NuvoUI provides utilities to change border properties on different interactive states:

Hover State

Focus State

Active State

Responsive Border Utilities

Change border properties at different breakpoints using the @breakpoint notation:

Common UI Patterns

Cards with Borders

Form Elements

Tables with Borders

Dividers

Buttons with Borders

SCSS Mixins

NuvoUI provides a comprehensive set of border mixins for direct use in your SCSS:

Border Width Mixins

MixinDescriptionParameters
@include border($val, $style: solid, $color: var(--border))Applies border to all sides$val: Border width
$style: Border style (default: solid)
$color: Border color (default: var(--border))
@include border-top($val)Applies border to top$val: Border width
@include border-right($val)Applies border to right$val: Border width
@include border-bottom($val)Applies border to bottom$val: Border width
@include border-left($val)Applies border to left$val: Border width

Border Radius Mixins

MixinDescriptionParameters
@include rounded($val: null)Applies border radius to all corners$val: Radius value (uses 'md' from VAR.$border-radii if null)
@include rounded-t($val: null)Applies border radius to top corners$val: Radius value
@include rounded-r($val: null)Applies border radius to right corners$val: Radius value
@include rounded-b($val: null)Applies border radius to bottom corners$val: Radius value
@include rounded-l($val: null)Applies border radius to left corners$val: Radius value
@include rounded-tl($val: null)Applies border radius to top left corner$val: Radius value
@include rounded-tr($val: null)Applies border radius to top right corner$val: Radius value
@include rounded-br($val: null)Applies border radius to bottom right corner$val: Radius value
@include rounded-bl($val: null)Applies border radius to bottom left corner$val: Radius value
@include pillApplies pill shape radius (9999px)None

Border Style and Color Mixins

MixinDescriptionParameters
@include border-style($style)Sets the border style$style: Border style (solid, dashed, etc.)
@include border-color($color)Sets the border color$color: Border color
@include border-all($width, $style, $color)Sets width, style and color for all borders$width: Border width
$style: Border style
$color: Border color

Example SCSS Usage

Border Utilities Reference Table

Border Width Classes

ClassDescription
.border1px border on all sides
.border-0No border
.border-{width}Border of specified width on all sides (1, 2, 3, 4, 8)
.border-t1px top border
.border-r1px right border
.border-b1px bottom border
.border-l1px left border
.border-t-{width}Top border of specified width
.border-r-{width}Right border of specified width
.border-b-{width}Bottom border of specified width
.border-l-{width}Left border of specified width

Border Style Classes

ClassDescription
.border-solidSolid border style
.border-dashedDashed border style
.border-dottedDotted border style
.border-doubleDouble border style
.border-noneNo border style

Border Color Classes

ClassDescription
.border-defaultDefault border color from theme
.border-lightLight border color from theme
.border-darkDark border color from theme
.border-primaryPrimary color border
.border-secondarySecondary color border
.border-successSuccess color border
.border-dangerDanger color border
.border-warningWarning color border
.border-infoInfo color border

Border Radius Classes

ClassDescription
.roundedDefault border radius (md - 0.25rem)
.squareNo border radius (0)
.rounded-smSmall border radius (0.125rem)
.rounded-mdMedium border radius (0.25rem)
.rounded-lgLarge border radius (0.5rem)
.rounded-xlExtra large border radius (1rem)
.rounded-fullCircle radius (50%)
.pillPill shape radius (9999px)

Interactive State Classes

All border utilities can be combined with hover, focus, and active states using the following prefixes:

  • hover:: Applies styles on hover
  • focus:: Applies styles on focus
  • active:: Applies styles when active

Responsive Border Classes

All border utilities can be applied conditionally at different breakpoints using the @breakpoint suffix, where breakpoint corresponds to the breakpoints defined in the VAR.$breakpoints configuration.