Skip to content

边框半径

使用边框辅助类可以快速地给任何元素以 border-radius 样式。

Class代表值
roundedborder-radius: 4px;
rounded-0border-radius: 0;
rounded-smborder-radius: 2px;
rounded-lgborder-radius: 8px;
rounded-xlborder-radius: 24px;
rounded-pillborder-radius: 9999px;
rounded-circleborder-radius: 50%;
rounded-shapedborder-radius: 24px 0
rounded-tborder-top-left-radius: 4px;
border-top-right-radius: 4px;
rounded-t-0border-top-left-radius: 0;
border-top-right-radius: 0;
rounded-t-smborder-top-left-radius: 2px;
border-top-right-radius: 2px;
rounded-t-lgborder-top-left-radius: 8px;
border-top-right-radius: 8px;
rounded-t-xlborder-top-left-radius: 24px;
border-top-right-radius: 24px;
rounded-t-pillborder-top-left-radius: 9999px;
border-top-right-radius: 9999px;
rounded-t-circleborder-top-left-radius: 50%;
border-top-right-radius: 50%;
rounded-t-shapedborder-top-left-radius: 24px; border-top-right-radius: 0;
rounded-teborder-top-right-radius: 4px;
rounded-te-0border-top-right-radius: 0;
rounded-te-smborder-top-right-radius: 2px;
rounded-te-lgborder-top-right-radius: 8px;
rounded-te-xlborder-top-right-radius: 24px;
rounded-te-pillborder-top-right-radius: 9999px;
rounded-te-circleborder-top-right-radius: 50%;
rounded-te-shapedborder-top-right-radius: 24px
border-top-left-radius: 0;
rounded-tsborder-top-left-radius: 4px;
rounded-ts-0border-top-left-radius: 0;
rounded-ts-smborder-top-left-radius: 2px;
rounded-ts-lgborder-top-left-radius: 8px;
rounded-ts-xlborder-top-left-radius: 24px;
rounded-ts-pillborder-top-left-radius: 9999px;
rounded-ts-circleborder-top-left-radius: 50%;
rounded-ts-shapedborder-top-left-radius: 24px; border-top-right-radius: 0;
rounded-eborder-inline-end-radius: 4px;
rounded-e-0border-inline-end-radius: 0;
rounded-e-smborder-inline-end-radius: 2px;
rounded-e-lgborder-inline-end-radius: 8px;
rounded-e-xlborder-inline-end-radius: 24px;
rounded-e-pillborder-inline-end-radius: 9999px;
rounded-e-circleborder-inline-end-radius: 50%;
rounded-e-shapedborder-inline-end-radius: 0; border-inline-start-radius: 24px;
rounded-bborder-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
rounded-b-0border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
rounded-b-smborder-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
rounded-b-lgborder-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
rounded-b-xlborder-bottom-left-radius: 24px;
border-bottom-right-radius: 24px;
rounded-b-pillborder-bottom-left-radius: 9999px;
border-bottom-right-radius: 9999px;
rounded-b-circleborder-bottom-left-radius: 50%;
border-bottom-right-radius: 50%;
rounded-b-shapedborder-bottom-left-radius: 0; border-bottom-right-radius: 24px;
rounded-beborder-bottom-right-radius: 4px;
rounded-be-0border-bottom-right-radius: 0;
rounded-be-smborder-bottom-right-radius: 2px;
rounded-be-lgborder-bottom-right-radius: 8px;
rounded-be-xlborder-bottom-right-radius: 24px;
rounded-be-pillborder-bottom-right-radius: 9999px;
rounded-be-circleborder-bottom-right-radius: 50%;
rounded-be-shapedborder-bottom-right-radius: 24px; border-bottom-left-radius: 0;
rounded-bsborder-inline-start-radius: 4px;
rounded-bs-0border-inline-start-radius: 0;
rounded-bs-smborder-inline-start-radius: 2px;
rounded-bs-lgborder-inline-start-radius: 8px;
rounded-bs-xlborder-inline-start-radius: 24px;
rounded-bs-pillborder-inline-start-radius: 9999px;
rounded-bs-circleborder-inline-start-radius: 50%;
rounded-bs-shapedborder-inline-start-radius: 24px; border-inline-end-radius: 0;
rounded-sborder-inline-start-radius: 4px;
rounded-s-0border-inline-start-radius: 0;
rounded-s-smborder-inline-start-radius: 2px;
rounded-s-lgborder-inline-start-radius: 8px;
rounded-s-xlborder-inline-start-radius: 24px;
rounded-s-pillborder-inline-start-radius: 9999px;
rounded-s-circleborder-inline-start-radius: 50%;
rounded-s-shapedborder-inline-start-radius: 24px; border-inline-end-radius: 0;

使用

border-radius 工具类可以让你快速的设计任何元素的 border-radius 样式。

圆角(Rounded corners)

使用rounded, rounded-0, rounded-sm, rounded-lg, and rounded-xl 这些类来设定元素的圆角。

药丸型和圆形(Pill and circle)

使用 rounded-pillrounded-circle 类创建药丸和圆形的形状。

不同边的圆角(Rounding by side)

使用 rounded-t-*, rounded-b-*, rounded-s-*, and rounded-e-* 这些类来设定元素的某一边的两个位置的圆角。

不同位置的圆角(Rounding by corner)

使用 rounded-te-*, rounded-ts-*, rounded-be-*, and rounded-bs-* 来设定元素的特定位置的圆角。

非圆角(No rounding)

使用 rounded-0 类来移除元素的圆角。

组件

INFO

当在组件上使用 rounded 属性时,需要省略 rounded- 前缀。例如,使用 rounded="sm" 代替 rounded-sm.

设置rounded属性会应用特定于组件的 border-radius 类,例如v-sheet--rounded 。这是为了确保即使工具类被禁用,基本的四舍五入使用仍然存在。

SASS 变量

你也可以使用以下的 SASS 变量来自定义边框的颜色与宽度:

scss
$rounded: (
  0: 0,
  "sm": $border-radius-root / 2,
  null: $border-radius-root,
  "lg": $border-radius-root * 2,
  "xl": $border-radius-root * 6,
  "pill": 9999px,
  "circle": 50%,
);

可以将 $rounded 变量设置为 false 来禁用 border-radius 类的生成。

sass
@use 'vuetify/settings' with (
  $rounded: false
);