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
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
Mixin | Description | Parameters |
---|---|---|
@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
Mixin | Description | Parameters |
---|---|---|
@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 pill | Applies pill shape radius (9999px) | None |
Border Style and Color Mixins
Mixin | Description | Parameters |
---|---|---|
@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
Class | Description |
---|---|
.border | 1px border on all sides |
.border-0 | No border |
.border-{width} | Border of specified width on all sides (1, 2, 3, 4, 8) |
.border-t | 1px top border |
.border-r | 1px right border |
.border-b | 1px bottom border |
.border-l | 1px 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
Class | Description |
---|---|
.border-solid | Solid border style |
.border-dashed | Dashed border style |
.border-dotted | Dotted border style |
.border-double | Double border style |
.border-none | No border style |
Border Color Classes
Class | Description |
---|---|
.border-default | Default border color from theme |
.border-light | Light border color from theme |
.border-dark | Dark border color from theme |
.border-primary | Primary color border |
.border-secondary | Secondary color border |
.border-success | Success color border |
.border-danger | Danger color border |
.border-warning | Warning color border |
.border-info | Info color border |
Border Radius Classes
Class | Description |
---|---|
.rounded | Default border radius (md - 0.25rem) |
.square | No border radius (0) |
.rounded-sm | Small border radius (0.125rem) |
.rounded-md | Medium border radius (0.25rem) |
.rounded-lg | Large border radius (0.5rem) |
.rounded-xl | Extra large border radius (1rem) |
.rounded-full | Circle radius (50%) |
.pill | Pill 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 hoverfocus:
: Applies styles on focusactive:
: 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.