MotivationInstallDocsCustomize
MotivationInstallDocsCustomize
  • Overview
  • Important! Purge!
  • Getting Started
    • Colors and Pseudo Classes
      • Colors
        • Color Shades

        • Psuedo Classes

      • Classes with Colors
        • Text Color

        • Background Color

        • Border Color

        • Outline Color

        • Text Decoration

        • Selection

      • Transitions
        • Transition Classes

        • With Pseudo Classes

      • Additional Classes
        • Font Size

        • Font Family

        • Font Weight

        • Text Decoration & Style

        • Border Width & Style

        • Outline Width & Style

    • Dark Mode
      • With JS

      • No JS

      • Grid
        • Class Definitions

        • Responsive Examples

        • Responsive Examples
          • Breakpoints

          • Max Breakpoints

          • Examples

          • Margin
            • Classes

            • Examples

          • Padding
            • Classes

            • Examples

          • Border Width
            • Classes

            • Examples

          • Outline Width
            • Classes

            • Outline Offset

            • Examples

          • Width
            • Rem Values

            • Percantage Values

            • Screen relative Values

            • XS - XL

          • Height
            • Rem Values

            • Percantage Values

            • Screen relative Values

            • XS - XL

          • Display
          • Flex
            • Flex Direction

            • Flex Wrap

            • Shrink & Grow

            • Justify Content

            • Align Content

            • Align Items

            • Align Self

            • Not Included

          • Text/Font
            • Font Size

            • Line Height

            • Letter Spacing

          • Position
            • Top Left Right & Bottom

          • Overflow
            • Overflow x & y

          • Box Sizing
        • Box-Shadow
          • Size

          • Color

          • Respoinsive

          • Psuedo States

          • Other Utilities
            • Text/Font
              • Align

              • Transform

              • Indent

              • Wrap

              • Font Family

              • Font Weight

              • Font Style

              • Text Decoration

              • Decoration Thickness

            • Border
              • Directional Style

            • Outline Style
            • Cursor
            • Opacity
            • Visibility
            • z-Index

          Simple Scss Utilities


          Border

          How to use

          Like margin and padding, border and outline can be applied in any direction but there's less classes. You can find the widths in _variables.scss and like with everything else both the keys and the values can be edited, added, or removed:

          File: _variables.scss_
          $border-and-outline-widths: (
          "0": 0px,
          "sm": 1px,
          "md": 3px,
          "lg": 5px,
          "xl": 7px,
          "2xl": 11px
          );

          These default values generate default classes like you would expect.

          ClassCSS rule
          .border-0border-width: 0px;
          .border-smborder-width: 1px;
          .border-mdborder-width: 3px;
          .border-lgborder-width: 5px;
          .border-xlborder-width: 7px;
          .border-2xlborder-width: 11px;

          Border classes include Colors or Styles which are covered in their own pages, but it's pretty simple and I'll include those in the examples below.

          In addition to these, there's also classes for the left, right, top, and bottom borders which are .bl, .br, .bt, and .bb classes respectively. There are also x and y classes .bx and .by:

          ClassCSS rule
          .bl-0border-left-width: 0px;
          .bl-smborder-left-width: 1px;
          .bl-mdborder-left-width: 3px;
          .bl-lgborder-left-width: 5px;
          .bl-xlborder-left-width: 7px;
          .bl-2xlborder-left-width: 11px;
          .br-0border-right-width: 0px;
          .br-smborder-right-width: 1px;
          .br-mdborder-right-width: 3px;
          .br-lgborder-right-width: 5px;
          .br-xlborder-right-width: 7px;
          .br-2xlborder-right-width: 11px;
          .bt-0border-top-width: 0px;
          .bt-smborder-top-width: 1px;
          .bt-mdborder-top-width: 3px;
          .bt-lgborder-top-width: 5px;
          .bt-xlborder-top-width: 7px;
          .bt-xlborder-top-width: 11px;
          .bb-0border-bottom-width: 0px;
          .bb-smborder-bottom-width: 1px;
          .bb-mdborder-bottom-width: 3px;
          .bb-lgborder-bottom-width: 5px;
          .bb-xlborder-bottom-width: 7px;
          .bb-2xlborder-bottom-width: 11px;
          .bx-0border-left-width: 0px;: 
          ;
          border-left-width: 0px;: 
          ;
          .bx-smborder-left-width: 1px;: 
          ;
          border-left-width: 1px;: 
          ;
          .bx-mdborder-left-width: 3px;: 
          ;
          border-left-width: 3px;: 
          ;
          .bx-lgborder-left-width: 5px;: 
          ;
          border-left-width: 5px;: 
          ;
          .bx-xlborder-left-width: 7px;: 
          ;
          border-left-width: 7px;: 
          ;
          .bx-2xlborder-left-width: 11px;: 
          ;
          border-left-width: 11px;: 
          ;
          .by-0border-top-width: 0px;: 
          ;
          border-top-width: 0px;: 
          ;
          .by-smborder-top-width: 1px;: 
          ;
          border-top-width: 1px;: 
          ;
          .by-mdborder-top-width: 3px;: 
          ;
          border-top-width: 3px;: 
          ;
          .by-lgborder-top-width: 5px;: 
          ;
          border-top-width: 5px;: 
          ;
          .by-xlborder-top-width: 7px;: 
          ;
          border-top-width: 7px;: 
          ;
          .by-2xlborder-top-width: 11px;: 
          ;
          border-top-width: 11px;: 
          ;

          So lets see some examples!

          Examples

          .border-0

          .border-sm

          .border-md

          .border-lg

          .border-xl

          .border-2xl

          .bt-xl

          .border-red

          .bb-xl

          .border-green

          .bl-xl

          .border-magenta

          .br-xl

          .border-blue-dkr

          .by-xl

          .bx-xl

          .bx-xl

          .border-dashed

          .border-magenta

          .rtl-lg

          .rbr-lg

          .bx-xl

          .border-dotted

          .border-default-dkr

          .rbl-lg

          .rtr-lg

          .by-2xl

          .radius-full

          .border-md

          .border-groove

          .border-green

          .radius-full

          .border-2xl

          .border-groove

          .border-green

          .radius-full

          .border-2xl

          .border-inset

          .border-magenta

          .radius-full

          In case you're wondering what the full html looks like, here's the markup for the last example:

          HTML
          <div class="display-flex flex-col justify-center ">
          <div class="display-flex center">
          <div
          class="w-3 h-3 bg-blue border-2xl border-inset border-magenta radius-full"
          ></div>
          </div>
          <div class="display-flex flex-col">
          <p>.border-2xl</p>
          <p>.border-inset</p>
          <p>.border-magenta</p>
          <p>.radius-full</p>
          </div>
          </div>

          Responsive Examples

          Like margin and padding, border width classes can be prefixed with the breakpoints defined in _variables.scss. Here is an example of the border changing sizes from small to large widths. If you're on a browser you can resize the screen to see the border width, on the smallest widths you'll have to close the sideber. I didn't make order radius, style classes don't respond to breakpoints because they don't have much to do with size, if you need those to be responsive it's a good opportunity to write some custom SCSS! But border size is at least responsive:

          .border-md

          .tab:border-lg

          .scr:border-xl

          .lg:border-2xl

          Here is the code for the responsive border size:

          HTML
          <div
          class="w-5 h-5 bg-blue radius-md border-md tab:border-lg scr:border-xl lg:border-2xl "
          />

          And as one more example, here's a border with a .max-scr class, so the outline is lg up to 1024px (the break point between scr and lg) and 2xl above that:

          .max-scr:border-lg

          .border-2xl

          And here's the HTML:

          HTML
          <div class="w-5 h-5 bg-blue radius-md border-2xl max-scr:border-lg" />

          Happy coding!

          © 2025 Simple Scss Utilities