Skip to content

Borders

Basic border utility classes with module mixins for compiling responsive modifier classes.

Examples (anchor)

Position (anchor)

For responsive design .border-none and .border-*-none modifiers are also provided.

.border
.border-t
.border-b
.border-s
.border-e
.border-y
.border-x

Radius (anchor)

The radius utilities also include .radius-0 modifier classes for responsive design.

.radius-1
.radius-2
.radius-3
.radius-4
.radius-5
.radius-pill

Radius position (anchor)

Responsive modifiers for each radius position (e.g. .radius-0-t) are also included.

.radius-5-t
.radius-5-b
.radius-5-s
.radius-5-e

Radius circle (anchor)

The .radius-circle can also use the .radius-0 modifiers for responsive design.

Elephant
Example HTML
<div class="radius-circle border bg-surf-1" style="width:150px;height:150px;"></div>
<img class="radius-circle ratio-1x1 object-cover" src="/img/elephant-480.webp" alt="Elephant" width="150">

Using the module (anchor)

Load StyleMods as demonstrated (change file path as required) then include the Sass mixin anywhere below.

Include both border position and radius:

custom.scss
@use "stylemods/scss" as *;
@include borders-css;

Include them individually:

custom.scss
@use "stylemods/scss" as *;
@include border-position-css;
@include border-radius-css;

Borders also have responsive modifier mixins that can be included in custom breakpoints:

custom.scss
@use "stylemods/scss" as *;
@include borders-css;
@media (width < 480px) {
  @include borders-sm-css;
}

You can include the individual breakpoints as required:

custom.scss
@use "stylemods/scss" as *;
@include borders-css;
@media (width < 1024px) {
  @include border-radius-md-css;
}
@media (width < 480px) {
  @include border-position-sm-css;
}

See the using modules page for more information.

Using the framework (anchor)

Using the recommended custom setup enable the styles in an overrides document:

overrides.scss
@use "stylemods/scss/configuration" as *;
$enable-borders:      true;
// Breakpoints
$enable-borders-lg:   true;
$enable-borders-md:   true;
$enable-borders-sm:   true;

Include the overrides and the framework styles with your custom document for compiling the framework:

custom.scss
@use "overrides";
@use "stylemods/scss/stylemods";

See using the framework for more information.

Source code (anchor)

The Borders source file is included with the utilities module files, you can view the source code from the latest release (v1.5.0) via the Github link below.

Source document
stylemods/scss/utilities/borders.scss
View on Github
https://github.com/pmbrown/StyleMods/blob/main/scss/utilities/borders.scss

Shared documentation about how to customize the default property values for the styles using the Sass and CSS variables is provided on the customizing page.