Add border utility classes
See original GitHub issueFor my own projects, I’m using a set of border utility classes, that significantly extend the current number of border utilities. With these classes, you can add or remove borders on any side individually (top, bottom, right, left) and the two axis (x, y) for all breakpoints.
Would you be interested in accepting a feature PR to include this into the main repo? Below are the classes it would add:
.bt # border top
.bb # border bottom
.br # border right
.bl # border left
.by # border y-axis
.bx # border x-axis
.bt-off
.bb-off
.br-off
.bl-off
.by-off
.bx-off
.bt-sm
.bb-sm
.br-sm
.bl-sm
.by-sm
.bx-sm
.bt-sm-off
.bb-sm-off
.br-sm-off
.bl-sm-off
.by-sm-off
.bx-sm-off
# ...and so on and so forth
I initially had used -on and -off suffixes, but decided to remove them in favor of the -0 approach used by bootstrap in other places. The downside is that the shorter, not breakpoint classes become a little too terse to be easily understandable. What do you think?
Issue Analytics
- State:
 - Created 6 years ago
 - Comments:5 (1 by maintainers)
 
Top Results From Across the Web
Borders - Bootstrap
Use border utilities to add or remove an element's borders. Choose from all borders or one at a time. Additive.
Read more >Bootstrap Borders - examples & tutorial
Use border utilities to add or remove an element's borders. Choose from all borders or one at a time. Additive. Additive classes are...
Read more >Bootstrap 4 Utilities - W3Schools
Bootstrap 4 has a lot of utility/helper classes to quickly style elements without using any CSS code. Borders. Use the border classes to...
Read more >Borders in bootstrap with examples - GeeksforGeeks
In Bootstrap, there are different classes available to add or remove borders. The classes that are used to add borders are referred as ......
Read more >Borders - Lightning Design System
Use border utility classes to add borders to elements. Examples#. Top#. This should have a top border. Show Code. <div class="slds-border_top">This should ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I would’t want to see a class for each CSS property, that’s what I hate about frameworks like atomic CSS or tachyons.
But if you do want to do this, I suggest to use the same naming conventions as border utilities. So
.border-instead of.bI really like the naming convention used by the spacing utilities, so I created this mixin to do the same with borders:
which generates: