Clone on GitHub
chevron_forward

Border Radius

First Published On:
April 24, 2024
Last Updated:
July 26, 2024

Figure 1. Animation demonstrating state layer implementation.

No items found.

Overview

Border radius controls the roundness of corners. They draw from LiftKit's global size variables, and have one extra class for making things circular.

Class Name CSS Properties Description
.border-radius__2xs
border-radius: var(--2xs);
Sets the border-radius to a very small size defined by the global --2xs variable.
.border-radius__xs
border-radius: var(--xs);
Sets the border-radius to a small size defined by the global --xs variable.
.border-radius__sm
border-radius: var(--sm);
Sets the border-radius to a medium size defined by the global --sm variable.
.border-radius__md
border-radius: var(--md);
Sets the border-radius to a medium size defined by the --md variable.
.border-radius__lg
border-radius: var(--lg);
Sets the border-radius to a large size defined by the --lg variable.
.border-radius__xl
border-radius: var(--xl);
Sets the border-radius to a very large size defined by the --xl variable.
.border-radius__2xl
border-radius: var(--2xl);
Sets the border-radius to an extra large size defined by the --2xl variable.
.border-radius__circle
border-radius: 100em;
Sets the border-radius to a circular shape.

Usage

Rounded Edges

Use classes like .border-radius__xxs or .border-radius__m to control the roundness of element corners. If applying to a div that contains child elements, you may need to also set overflow__hidden to ensure corners display properly

Perfect circles

For things like profile photos, icon buttons, or decorative elements, combine aspect__1x1 with border-radius__full.

Pill Shapes

Apply border-radius__full by itself.

Multiple Radii

This use case is rare and, when it arises, it's almost always for unique UI components. So, LiftKit recommends just making a component class for the unique instance where you need it. Follow BEM naming conventions.

Recommended Usage

Customization

Resources that mention this topic

No items found.
info

Get Help from a LiftKit Expert

arrow_forward
Book Quick Chat

Give Us Feedback

Click or tap to reveal form.
expand_more
check_circle
Success! An email has been sent to you with more details.
Please allow up to 5 minutes for it to arrive. Mailchimp can take a bit.
error
Error: Something went wrong. Email info@chainlift.io directly for assistance.
.border-radius__2xs {
  border-radius: var(--xxs);
}

.border-radius__xs {
  border-radius: var(--xs);
}

.border-radius__sm {
  border-radius: var(--s);
}

.border-radius__md {
  border-radius: var(--m);
}

.border-radius__lg {
  border-radius: var(--l);
}

.border-radius__xl {
  border-radius: var(--xl);
}

.border-radius__2xl {
  border-radius: var(--xxl);
}

.border-radius__circle {
  border-radius: 100em;
}
content_copy
code snippets will appear here