导航

v2.1.0
内容

徽标

用于显示状态、分类或计数的小型胶囊标签,只有颜色本身有含义时才使用彩色。

本页内容

徽标是用于显示状态、分类或计数的小型胶囊标签。大多数标签使用中性色。只在两种情况下使用彩色:表示状态时,并配上表达同一状态的文字;或者标明数据所属的分类时。

徽标

<span class="badge">Draft</span><span class="badge badge-success badge-dot">Published</span>
<>  <span className="badge">Draft</span>  <span className="badge badge-success badge-dot">Published</span></>
<span class="badge">Draft</span><span class="badge badge-success badge-dot">Published</span>
<template>  <span class="badge">Draft</span>  <span class="badge badge-success badge-dot">Published</span></template>

#变体

变体

<span class="badge">Chip</span><span class="badge badge-outline">Outline</span><span class="badge badge-raised">Raised</span><span class="badge badge-ink">Ink</span>
<>  <span className="badge">Chip</span>  <span className="badge badge-outline">Outline</span>  <span className="badge badge-raised">Raised</span>  <span className="badge badge-ink">Ink</span></>
<span class="badge">Chip</span><span class="badge badge-outline">Outline</span><span class="badge badge-raised">Raised</span><span class="badge badge-ink">Ink</span>
<template>  <span class="badge">Chip</span>  <span class="badge badge-outline">Outline</span>  <span class="badge badge-raised">Raised</span>  <span class="badge badge-ink">Ink</span></template>

#状态

状态

<span class="badge badge-info badge-dot">Queued</span><span class="badge badge-success badge-dot">Ready</span><span class="badge badge-warning badge-dot">Degraded</span><span class="badge badge-danger badge-dot">Failed</span>
<>  <span className="badge badge-info badge-dot">Queued</span>  <span className="badge badge-success badge-dot">Ready</span>  <span className="badge badge-warning badge-dot">Degraded</span>  <span className="badge badge-danger badge-dot">Failed</span></>
<span class="badge badge-info badge-dot">Queued</span><span class="badge badge-success badge-dot">Ready</span><span class="badge badge-warning badge-dot">Degraded</span><span class="badge badge-danger badge-dot">Failed</span>
<template>  <span class="badge badge-info badge-dot">Queued</span>  <span class="badge badge-success badge-dot">Ready</span>  <span class="badge badge-warning badge-dot">Degraded</span>  <span class="badge badge-danger badge-dot">Failed</span></template>

#分类

badge-category 从徽标自身或其外层的 category-<name> 类获取该分类的底色、文字颜色和描边,圆点则使用该分类的标记色。分类说明某样东西属于哪一类,状态说明它处于什么情况。一个徽标只能表达其中一种:badge-category 与四种状态色调中的任一种都不能用于同一个徽标。

分类

<span class="badge badge-category category-blue">Platform</span><span class="badge badge-category badge-dot category-pink">Marketing</span><span class="badge badge-category badge-pill category-amber">Finance</span><span class="badge badge-category badge-outline category-teal">Design</span>
<>  <span className="badge badge-category category-blue">Platform</span>  <span className="badge badge-category badge-dot category-pink">Marketing</span>  <span className="badge badge-category badge-pill category-amber">Finance</span>  <span className="badge badge-category badge-outline category-teal">Design</span></>
<span class="badge badge-category category-blue">Platform</span><span class="badge badge-category badge-dot category-pink">Marketing</span><span class="badge badge-category badge-pill category-amber">Finance</span><span class="badge badge-category badge-outline category-teal">Design</span>
<template>  <span class="badge badge-category category-blue">Platform</span>  <span class="badge badge-category badge-dot category-pink">Marketing</span>  <span class="badge badge-category badge-pill category-amber">Finance</span>  <span class="badge badge-category badge-outline category-teal">Design</span></template>

#进行中

badge-live 让圆点向外扩散出圆环,用来表示正在录制、部署或直播等活动。一个视图中只用它标示一项活动,满屏跳动的圆点会让提示失去意义。启用减少动态效果时,仅显示静止的圆点。

进行中

<span class="badge badge-success badge-dot badge-live">Live</span><span class="badge badge-danger badge-dot badge-live">Recording</span><span class="badge badge-dot">Idle</span>
<>  <span className="badge badge-success badge-dot badge-live">Live</span>  <span className="badge badge-danger badge-dot badge-live">Recording</span>  <span className="badge badge-dot">Idle</span></>
<span class="badge badge-success badge-dot badge-live">Live</span><span class="badge badge-danger badge-dot badge-live">Recording</span><span class="badge badge-dot">Idle</span>
<template>  <span class="badge badge-success badge-dot badge-live">Live</span>  <span class="badge badge-danger badge-dot badge-live">Recording</span>  <span class="badge badge-dot">Idle</span></template>

#尺寸和形状

尺寸和形状

<span class="badge badge-sm">Small</span><span class="badge">Medium</span><span class="badge badge-lg">Large</span><span class="badge badge-pill">Pill</span><span class="badge badge-ink badge-pill">12</span>
<>  <span className="badge badge-sm">Small</span>  <span className="badge">Medium</span>  <span className="badge badge-lg">Large</span>  <span className="badge badge-pill">Pill</span>  <span className="badge badge-ink badge-pill">12</span></>
<span class="badge badge-sm">Small</span><span class="badge">Medium</span><span class="badge badge-lg">Large</span><span class="badge badge-pill">Pill</span><span class="badge badge-ink badge-pill">12</span>
<template>  <span class="badge badge-sm">Small</span>  <span class="badge">Medium</span>  <span class="badge badge-lg">Large</span>  <span class="badge badge-pill">Pill</span>  <span class="badge badge-ink badge-pill">12</span></template>

#图片与长标签

badge-media 在开头放一张小图,可以是头像或图标。它的尺寸等于徽标高度减去两侧内边距,并保持圆形,因此在徽标一端四周留白均匀。可能较长的标签用 badge-label 包裹:徽标到容器边缘为止,标签以省略号结尾,图片尺寸保持不变。

图片与长标签

<span class="badge badge-pill">  <span class="badge-media"><span class="avatar" aria-hidden="true">AL</span></span>Ada</span><span class="badge badge-pill">  <span class="badge-media">    <span class="avatar"><img class="avatar-image" src="/demo/portrait-2.svg" alt></span>  </span>Grace Hopper</span><span class="badge max-w(168)" title="Interview notes from the second round">  <span class="badge-media">    <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">      <path d="M4.5 2L9.0858 2A1 1 0 0 1 9.7929 2.2929L12.2071 4.7071A1 1 0 0 1 12.5 5.4142L12.5 13A1 1 0 0 1 11.5 14L4.5 14A1 1 0 0 1 3.5 13L3.5 3A1 1 0 0 1 4.5 2Z" /><path d="M10 2.5V4.4A0.1 0.1 0 0 0 10.1 4.5H12L12.2409 4.7427A0.9993 0.9993 0 0 1 12.5 5.4142V5.5H10.1Q9.6444 5.5 9.3222 5.1778Q9 4.8556 9 4.4V2A1.1002 1.1002 0 0 1 9.3761 2.0431A1.0001 1.0001 0 0 1 9.7929 2.2929L10 2.5Z" fill="currentColor" stroke="none" fill-rule="evenodd" />    </svg>  </span><span class="badge-label">Interview notes from the second round</span></span>
import FileIcon from '@master/icons-react/native/16/soft/file'<>  <span className="badge badge-pill">    <span className="badge-media"><span className="avatar" aria-hidden="true">AL</span></span>Ada  </span>  <span className="badge badge-pill">    <span className="badge-media">      <span className="avatar">        <img className="avatar-image" src="/demo/portrait-2.svg" alt="" />      </span>    </span>Grace Hopper  </span>  <span className="badge max-w(168)" title="Interview notes from the second round">    <span className="badge-media"><FileIcon className="icon" /></span><span className="badge-label">Interview notes from the second round</span>  </span></>
<script>  import FileIcon from '@master/icons-svelte/native/16/soft/file'</script><span class="badge badge-pill">  <span class="badge-media"><span class="avatar" aria-hidden="true">AL</span></span>Ada</span><span class="badge badge-pill">  <span class="badge-media">    <span class="avatar"><img class="avatar-image" src="/demo/portrait-2.svg" alt></span>  </span>Grace Hopper</span><span class="badge max-w(168)" title="Interview notes from the second round">  <span class="badge-media"><FileIcon class="icon" /></span><span class="badge-label">Interview notes from the second round</span></span>
<script setup>import FileIcon from '@master/icons-vue/native/16/soft/file'</script><template>  <span class="badge badge-pill">    <span class="badge-media"><span class="avatar" aria-hidden="true">AL</span></span>Ada  </span>  <span class="badge badge-pill">    <span class="badge-media">      <span class="avatar"><img class="avatar-image" src="/demo/portrait-2.svg" alt></span>    </span>Grace Hopper  </span>  <span class="badge max-w(168)" title="Interview notes from the second round">    <span class="badge-media"><FileIcon class="icon" /></span><span class="badge-label">Interview notes from the second round</span>  </span></template>

#组合徽标

badge-compound 把一个较小的徽标 badge-addon 和一条简短信息放进同一个胶囊里,例如版本号及其新内容,或标签与日期。胶囊的高度等于附加徽标的高度加上两倍内边距,圆角半径等于附加徽标的圆角半径加上内边距,因此两条弧线保持平行。附加徽标可以放在开头或结尾。作为链接时,整个胶囊是一个交互目标,悬停效果和焦点环都作用于整体,内部不能再放独立的控件。

组合徽标

<a href="#theming" class="badge badge-compound badge-pill">  <span class="badge-addon">New</span><span class="badge-label">Theming has a guide</span><svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">    <path d="M13.6362 7.5189A0.4947 0.4947 0 0 0 13.5 7.5L2.4755 7.5006A0.5 0.5 0 0 0 2.4266 8.4946L2.5 8.5H13.5A0.4947 0.4947 0 0 0 13.6362 8.4811A0.7009 0.7009 0 0 0 13.6362 7.5189Z" fill="currentColor" stroke="none" fill-rule="evenodd" /><path d="M8 4.5L13.2348 7.8313A0.2 0.2 0 0 1 13.2348 8.1687L8 11.5" />  </svg></a><a href="#release" class="badge badge-compound badge-category category-violet">  <span class="badge-addon">v0.4</span><span class="badge-label">Category colors</span></a><span class="badge badge-compound">  <span class="badge-label">Release notes</span><span class="badge-addon">2 days ago</span></span>
import ArrowRightIcon from '@master/icons-react/native/16/soft/arrow-right'<>  <a href="#theming" className="badge badge-compound badge-pill">    <span className="badge-addon">New</span><span className="badge-label">Theming has a guide</span><ArrowRightIcon className="icon" />  </a>  <a href="#release" className="badge badge-compound badge-category category-violet">    <span className="badge-addon">v0.4</span><span className="badge-label">Category colors</span>  </a>  <span className="badge badge-compound">    <span className="badge-label">Release notes</span><span className="badge-addon">2 days ago</span>  </span></>
<script>  import ArrowRightIcon from '@master/icons-svelte/native/16/soft/arrow-right'</script><a href="#theming" class="badge badge-compound badge-pill">  <span class="badge-addon">New</span><span class="badge-label">Theming has a guide</span><ArrowRightIcon class="icon" /></a><a href="#release" class="badge badge-compound badge-category category-violet">  <span class="badge-addon">v0.4</span><span class="badge-label">Category colors</span></a><span class="badge badge-compound">  <span class="badge-label">Release notes</span><span class="badge-addon">2 days ago</span></span>
<script setup>import ArrowRightIcon from '@master/icons-vue/native/16/soft/arrow-right'</script><template>  <a href="#theming" class="badge badge-compound badge-pill">    <span class="badge-addon">New</span><span class="badge-label">Theming has a guide</span><ArrowRightIcon class="icon" />  </a>  <a href="#release" class="badge badge-compound badge-category category-violet">    <span class="badge-addon">v0.4</span><span class="badge-label">Category colors</span>  </a>  <span class="badge badge-compound">    <span class="badge-label">Release notes</span><span class="badge-addon">2 days ago</span>  </span></template>

#图标角标

badge-corner 将计数放在最近的已定位祖先元素的角上,用一圈与所在表面同色的描边将数字徽标与父元素隔开。表面颜色取自 --surface-color。使用自定义背景时,设置 --badge-ring。在父元素的无障碍名称中说明具体有多少项。

图标角标

<button type="button" class="btn btn-square relative" aria-label="Notifications, 3 unread">  <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">    <path d="M4.25 6C4.25 4.25 6 2.5 8 2.5C10 2.5 11.75 4.25 11.75 6V8.25C11.75 9.75 12.75 10.75 13.25 11.25Q13.5 11.75 12.75 11.75H3.25Q2.5 11.75 2.75 11.25C3.25 10.75 4.25 9.75 4.25 8.25Z" /><path d="M6.85 14Q8 15 9.15 14" />  </svg>  <span class="badge badge-ink badge-corner" aria-hidden="true">3</span></button>
import BellIcon from '@master/icons-react/native/16/soft/bell'<button type="button" className="btn btn-square relative" aria-label="Notifications, 3 unread">  <BellIcon className="icon" />  <span className="badge badge-ink badge-corner" aria-hidden="true">3</span></button>
<script>  import BellIcon from '@master/icons-svelte/native/16/soft/bell'</script><button type="button" class="btn btn-square relative" aria-label="Notifications, 3 unread">  <BellIcon class="icon" />  <span class="badge badge-ink badge-corner" aria-hidden="true">3</span></button>
<script setup>import BellIcon from '@master/icons-vue/native/16/soft/bell'</script><template>  <button type="button" class="btn btn-square relative" aria-label="Notifications, 3 unread">    <BellIcon class="icon" />    <span class="badge badge-ink badge-corner" aria-hidden="true">3</span>  </button></template>

#类名

类名说明
badge高度为 22px 的中性标签
badge-sm高度为 18px,默认为 22px与 badge 一同使用
badge-lg高度为 26px,默认为 22px与 badge 一同使用
badge-pill两端全圆与 badge 一同使用
badge-outline仅显示轮廓,无填充。与 badge 一同使用
badge-raised呈小块凸起的表面,适合在视觉元素较多的背景上使用。与 badge 一同使用
badge-ink纯墨色背景,搭配反色文字与 badge 一同使用
badge-category使用由自身或外层 category-<name> 类设定的分类表面、文字和线条;搭配 badge-dot 时,圆点即分类标记。没有分类时为中性样式。不要与状态色调同时使用与 badge 一同使用
badge-info添加淡信息色底纹与 badge 一同使用
badge-success添加淡成功色底纹与 badge 一同使用
badge-warning添加淡警告色底纹与 badge 一同使用
badge-danger添加淡危险色底纹与 badge 一同使用
badge-dot位于开头的 6px 圆点,色调与徽标一致与 badge 一同使用
badge-live与 badge-dot 搭配使用,圆点向外扩散一圈光环,表示有活动正在进行。启用减少动态效果时,仅显示静态圆点与 badge 一同使用
badge-corner在最近的已定位祖先元素的一角显示计数,用与所在表面同色的环形描边隔开。在该祖先元素的无障碍名称中说明这一计数。与 badge 一同使用
badge-compound高 28px 的胶囊,容纳 badge-addon 和一条信息;圆角为附加徽标的圆角加上内缩距离。作为链接时,整个胶囊是一个点击目标与 badge 一同使用
badge-label可能较长的文字:空间不足时先收缩并以省略号结尾,图片、圆点或计数保持原有尺寸
badge-media位于开头的圆形图片,直径为徽标高度减去两倍内缩距离:可放头像或图标,并由它决定其尺寸
badge-addonbadge-compound 内较小的凸起徽标,位于开头或末尾;圆角为外层圆角减去内缩距离

#自定义属性

属性默认值说明
--badge-ringbadge-corner 周围的描边颜色。默认不声明,依次回退到 --surface-color 和 --color-surface-base
--badge-inset.1875rembadge-media 或 badge-addon 与徽标边缘之间的内缩距离

#源码

@master/ui/components/badge.css
/* * Badge: a small chip for a status, a category or a count. Hue appears with a status, in one of four tones, or with * a category, read from --category-* (see category.css); the two are different facts and never share a badge. * A badge may hold a picture (badge-media), a label that truncates (badge-label) and, as a compound, a smaller * badge of its own (badge-addon) whose corner nests inside the outer one. * The neutral face, the outline and the ink badge read their colors through --badge-surface, --badge-ink, * --badge-line, --badge-line-strong, --badge-fill, --badge-fill-ink and --badge-fill-text, which a surface of * ink sets with @apply --on-ink, so a badge in a primary button or a tooltip is drawn from that surface's own * text color. */@layer components.ui {  .badge {    --badge-height: 1.375rem;    --badge-padding-x: .4375rem;    --badge-font-size: .71875rem;    --badge-radius: var(--radius-chip);    --badge-tone: var(--color-text-muted);    --badge-inset: .1875rem;    --icon-size: .875rem;    --icon-offset: -.0625rem;    display: inline-flex;    flex-shrink: 0;    align-items: center;    justify-content: center;    gap: .3125rem;    height: var(--badge-height);    min-width: var(--badge-height);    padding: 0 var(--badge-padding-x);    border-radius: calc(var(--badge-radius) * var(--corner-scale));    corner-shape: var(--corner-shape);    background: var(--badge-surface, var(--color-surface-chip));    color: var(--badge-ink, var(--color-text-body));    box-shadow: inset 0 0 0 .5px var(--badge-line, var(--color-line-contour));    font: var(--font-weight-control) var(--badge-font-size)/1 var(--font-family-sans);    font-feature-settings: inherit;    font-variant-numeric: tabular-nums;    letter-spacing: 0;    white-space: nowrap;    /* A badge may be a link, such as the announcement over a hero; it never takes a link's underline. */    text-decoration: none;    vertical-align: middle;    &.badge-sm {      --badge-height: 1.125rem;      --badge-padding-x: .3125rem;      --badge-font-size: .65625rem;      --icon-size: .75rem;      --badge-radius: calc(var(--radius-chip) - 1px);      gap: .25rem;    }    &.badge-lg {      --badge-height: 1.625rem;      --badge-padding-x: .5625rem;      --badge-font-size: .78125rem;      --icon-size: 1rem;      --badge-radius: calc(var(--radius-chip) + 1px);    }    &.badge-pill {      --badge-radius: 999px;      corner-shape: round;      padding-inline: calc(var(--badge-padding-x) + 1px);    }    &.badge-outline {      background: transparent;      box-shadow: inset 0 0 0 .5px var(--badge-line-strong, var(--color-line-strong));    }    /* Raised: a small sheet, for a badge that sits on a busy surface. */    &.badge-raised {      @apply --surface-sheet;      color: var(--color-text-strong);      box-shadow: var(--shadow-raised);    }    &.badge-ink {      --badge-tone: currentColor;      background: var(--badge-fill, var(--color-surface-inverse));      color: var(--badge-fill-ink, var(--color-text-inverse));      -webkit-text-fill-color: var(--badge-fill-text, currentColor);      box-shadow: inset 0 .5px 0 var(--color-ink-highlight), 0 0 0 .5px var(--color-ink-edge);    }    &:is(.badge-info, .badge-success, .badge-warning, .badge-danger) {      background: color-mix(in oklab, var(--badge-tone) 8%, var(--color-surface-raised));      color: color-mix(in oklab, var(--badge-tone) 82%, var(--color-text-strong));      box-shadow: inset 0 0 0 .5px color-mix(in oklab, var(--badge-tone) 36%, transparent);    }    /* A category: its tinted surface, its text and its line, with the mark as the dot. Neutral without one. */    &.badge-category {      --badge-tone: var(--category-mark, var(--color-text-muted));      background: var(--category-surface, var(--color-surface-chip));      color: var(--category-text, var(--color-text-body));      box-shadow: inset 0 0 0 .5px var(--category-line, var(--color-line-contour));      &.badge-outline {        background: transparent;      }    }    &.badge-info { --badge-tone: var(--color-info); }    &.badge-success { --badge-tone: var(--color-success); }    &.badge-warning { --badge-tone: var(--color-warning); }    &.badge-danger { --badge-tone: var(--color-danger); }    /* A leading status dot in the badge's tone. */    &.badge-dot::before {      content: '';      flex: none;      width: 6px;      height: 6px;      border-radius: 999px;      corner-shape: round;      background: var(--badge-tone);    }    /* Live: the dot of something happening now sends out a ring. Without motion it is a plain dot. */    &.badge-live::before {      animation: badge-live 1.8s var(--easing-glide) infinite;    }    @media (prefers-reduced-motion: reduce) {      &.badge-live::before {        animation: none;      }    }    /* A label that may be long: the badge stops at its container's edge and the label ends in an ellipsis. */    &:has(.badge-label) {      /* It gives way beside a sibling too: a badge that never shrinks ran past the row by the sibling's width. */      flex-shrink: 1;      min-width: 0;      max-width: 100%;    }    /* A picture at the start stands as far from the badge's edge as from its top and bottom. */    &:has(.badge-media:first-child) {      padding-inline-start: var(--badge-inset);    }    /*     * Compound: a smaller badge (badge-addon) and a message inside one capsule, such as "New · Theming has a     * guide". The outer badge is taller by two insets, and its corner is the addon's corner plus the inset, so the     * two curves run parallel. A link around it is one target: the capsule takes the hover and the focus ring.     * The message is an element (a badge-label) beside the addon: a selector cannot see bare text, so an addon that     * is the only element would count as both ends and pull the message against the edge. Alone, it takes neither.     */    &.badge-compound {      --badge-height: 1.75rem;      --badge-padding-x: .625rem;      --badge-font-size: .78125rem;      --badge-radius: calc(var(--radius-chip) + var(--badge-inset));      gap: .5rem;      &:has(.badge-addon:first-child:not(:only-child)) {        padding-inline-start: var(--badge-inset);      }      &:has(.badge-addon:last-child:not(:only-child)) {        padding-inline-end: var(--badge-inset);      }      &.badge-pill .badge-addon {        --badge-radius: 999px;        corner-shape: round;      }    }    &:any-link {      -webkit-tap-highlight-color: transparent;      transition-property: box-shadow, color;      transition-duration: var(--duration-quick);      transition-timing-function: var(--easing-glide);      @media (hover: hover) {        /* The contour firms toward the badge's own text, whatever its face. */        &:hover {          box-shadow: inset 0 0 0 .5px color-mix(in oklab, currentColor 45%, transparent);        }      }      /* Pressed: the same firm contour, so a tap is answered where there is no pointer. */      &:active {        box-shadow: inset 0 0 0 .5px color-mix(in oklab, currentColor 45%, transparent);      }      /* A raised badge keeps its sheet: it lifts its shadow, as a raised control does, instead of losing it. */      &.badge-raised {        @media (hover: hover) {          &:hover {            box-shadow: var(--shadow-raised-hover);          }        }        &:active {          box-shadow: var(--shadow-raised-hover);        }      }      &:focus-visible {        @apply --focus-ring;      }      /* On touch a link's target reaches 44px around it; the capsule keeps its height and its corner. */      @media (pointer: coarse) {        &:not(.badge-corner) {          position: relative;        }        &::after {          @apply --touch-target;        }      }    }    /* A count on the corner of its nearest positioned parent, cut out by a ring of the surface it sits on. */    &.badge-corner {      --badge-height: 1.125rem;      corner-shape: round;      --badge-padding-x: .3125rem;      --badge-font-size: .65625rem;      --badge-radius: 999px;      position: absolute;      inset-block-start: 0;      inset-inline-end: 0;      translate: 35% -35%;      outline: 2px solid var(--badge-ring, var(--surface-color, var(--color-surface-base)));      /* It hangs off the end corner, whichever side that is. */      &:dir(rtl) {        translate: -35% -35%;      }    }    @media (forced-colors: active) {      outline: 1px solid CanvasText;      outline-offset: -1px;      /* The dot's tone would be forced to the canvas and vanish: it takes the text's system color. */      &.badge-dot::before {        background: CanvasText;      }      /* The words keep the system's text color, whatever face an ink surface would paint them in. */      &.badge-ink {        -webkit-text-fill-color: currentColor;      }    }  }}@layer components.ui {  /* The words of a badge that may be long: they shrink and end in an ellipsis, while a picture or a count keeps its size. */  .badge-label {    min-width: 0;    overflow: hidden;    /* A line as tall as the letters would clip their descenders; the badge centers the taller line, so nothing moves. */    line-height: 1.25;    text-overflow: ellipsis;  }  /*   * A picture at the start of a badge: an avatar, a flag or a logo, sized to the badge less two insets and kept   * round, so it sits in the badge's end as a pearl sits in a setting. Put an avatar or an icon inside; this part   * sizes them through --avatar-size and --icon-size.   */  .badge-media {    --badge-media-size: calc(var(--badge-height) - 2 * var(--badge-inset));    --icon-size: calc(var(--badge-media-size) - .125rem);    display: inline-grid;    flex: none;    place-items: center;    width: var(--badge-media-size);    height: var(--badge-media-size);    margin-inline-end: -.0625rem;    border-radius: 999px;    corner-shape: round;    overflow: hidden;    .avatar {      --avatar-size: var(--badge-media-size);    }  }  /*   * The smaller badge inside a compound badge: a raised face on the outer one's tint, one inset in from its edges,   * so its corner is the outer corner less the inset. It takes the category or the tone of the outer badge.   */  .badge-addon {    display: inline-flex;    flex: none;    align-items: center;    gap: .25rem;    height: calc(var(--badge-height) - 2 * var(--badge-inset));    padding: 0 .4375rem;    border-radius: calc(var(--badge-radius) * var(--corner-scale) - var(--badge-inset));    corner-shape: var(--corner-shape);    @apply --surface-sheet;    color: inherit;    box-shadow: var(--shadow-raised);    font-size: .71875rem;    white-space: nowrap;    @media (forced-colors: active) {      outline: 1px solid CanvasText;      outline-offset: -1px;    }  }  /*   * In a neutral badge the addon's sheet keeps the page's ink. Off ink that is the badge's own; on ink the badge   * takes the surface's text color, which on a pearl sheet would vanish.   */  .badge:not(.badge-info, .badge-success, .badge-warning, .badge-danger, .badge-category, .badge-ink, .badge-raised) .badge-addon {    color: var(--color-text-body);  }}@keyframes badge-live {  from {    box-shadow: 0 0 0 0 color-mix(in oklab, var(--badge-tone) 45%, transparent);  }  70%, to {    box-shadow: 0 0 0 5px transparent;  }}