Border
Use border utility classes to add borders to elements.
Add borders
Borders can be added to containers using utilities. The color of the border is defined by the $qw-border-color
token.
Class | Placement | Example |
---|---|---|
.qw-border | All Sides | |
.qw-border-top | Top | |
.qw-border-right | Right | |
.qw-border-bottom | Bottom | |
.qw-border-left | Left |
Direction related classes use CSS logical properties. While the property may say .qw-border-left
, the rule will contain border-inline-start: 1px
for better support of right-to-left langauges.
Remove borders
As a rule, it is better to use styles that are additive. However, there are occasions where styles must be overridden. To that end, border utilities can also be used to remove an existing border. Simply add -0
to the end of any border utility class name to remove the border, e.g. qw-border-left-0
removes an object's left-side border.
Class | Outcome | Example |
---|---|---|
.qw-border-0 | No border | |
.qw-border-top-0 | No top border | |
.qw-border-right-0 | No right border | |
.qw-border-bottom-0 | No bottom border | |
.qw-border-left-0 | No left border |
By breakpoint
A breakpoint class is constructed by appending the breakpoint and direction(optional) to the border class. Example: .qw-border-sm-top
adds a border to the top of the element at the small breakpoint. Similarly, .qw-border-sm-top-0
removes the border from the top of the element at the small breakpoint.
Border utilities apply to all screen sizes, from xs
to xl
, unless they have a specified breakpoint assigned within them. Breakpoint utilities apply to the specified screensize and up.
Border radius
Apply rounded corners to an element with the border radius utility.
The border radius utility supports small, default, large, and circle radii. This sets the border-radius
to 2px
, 4px
, 8px
and 50%
, respectively.
Token | Value | Example |
---|---|---|
$border-radius-0
|
0 | |
$border-radius-sm
|
2px | |
$border-radius-base
|
4px | |
$border-radius-lg
|
8px | |
$border-radius-xl
|
16px | |
$border-radius-round
|
20em | |
$border-radius-circle
|
50% |
|
Note: For an object to have a circle radius, its height and width must be equal.
Directional border radius
Border radius can also be set for specific sides. This only supports one size of border radius, default (4px).