탐색

v2.1.0
재질

표면

모든 컴포넌트의 바탕이 되는 트레이, 볼록한 표면, 오목한 영역의 높이 체계입니다.

이 페이지의 내용

모든 Master UI 컴포넌트는 몇 가지 공통 표면 스타일로 구성됩니다. 카드, 패널, 그룹에 이 스타일을 직접 적용하면 사용자 지정 레이아웃에도 컴포넌트와 같은 빛과 깊이감을 줄 수 있습니다. 표면의 높이 단계는 테마에서 설명합니다.

트레이, 볼록한 표면, 오목한 영역

<div class="tray">  <div class="sheet flex flex-col gap-md p-lg">    <p class="m(0) text-sm fg-text-strong">Deployment</p>    <div class="well p-md text-sm fg-text-muted">No builds are queued.</div>  </div></div>
<div className="tray">  <div className="sheet flex flex-col gap-md p-lg">    <p className="m(0) text-sm fg-text-strong">Deployment</p>    <div className="well p-md text-sm fg-text-muted">No builds are queued.</div>  </div></div>
<div class="tray">  <div class="sheet flex flex-col gap-md p-lg">    <p class="m(0) text-sm fg-text-strong">Deployment</p>    <div class="well p-md text-sm fg-text-muted">No builds are queued.</div>  </div></div>
<template>  <div class="tray">    <div class="sheet flex flex-col gap-md p-lg">      <p class="m(0) text-sm fg-text-strong">Deployment</p>      <div class="well p-md text-sm fg-text-muted">No builds are queued.</div>    </div>  </div></template>

#볼록한 표면

볼록한 표면은 주변보다 높고 모서리 반경이 16px입니다. 브라우저가 지원하면 표면을 스쿼클 형태로 그립니다. 위쪽 가장자리에 밝은 선을 더하고, 0.5px 윤곽선을 두르며, 아래에는 짧고 점차 옅어지는 그림자를 둡니다. 기본 높이는 살짝 떠 있는 단계입니다. 표면의 역할에 따라 더 낮거나 높은 단계를 선택하세요.

볼록한 표면의 높이 단계

<div class="sheet sheet-flat p-lg text-sm fg-text-muted">Flat</div><div class="sheet sheet-raised p-lg text-sm fg-text-muted">Raised</div><div class="sheet p-lg text-sm fg-text-muted">Lifted</div><div class="sheet sheet-floating p-lg text-sm fg-text-muted">Floating</div>
<>  <div className="sheet sheet-flat p-lg text-sm fg-text-muted">Flat</div>  <div className="sheet sheet-raised p-lg text-sm fg-text-muted">Raised</div>  <div className="sheet p-lg text-sm fg-text-muted">Lifted</div>  <div className="sheet sheet-floating p-lg text-sm fg-text-muted">Floating</div></>
<div class="sheet sheet-flat p-lg text-sm fg-text-muted">Flat</div><div class="sheet sheet-raised p-lg text-sm fg-text-muted">Raised</div><div class="sheet p-lg text-sm fg-text-muted">Lifted</div><div class="sheet sheet-floating p-lg text-sm fg-text-muted">Floating</div>
<template>  <div class="sheet sheet-flat p-lg text-sm fg-text-muted">Flat</div>  <div class="sheet sheet-raised p-lg text-sm fg-text-muted">Raised</div>  <div class="sheet p-lg text-sm fg-text-muted">Lifted</div>  <div class="sheet sheet-floating p-lg text-sm fg-text-muted">Floating</div></template>
클래스높이용도
sheet sheet-flat윤곽선 1개, 그림자 없음항목이 촘촘한 목록과 표
sheet sheet-raised--shadow-raised요소가 많은 표면 위의 작은 카드
sheet--shadow-lifted카드와 패널
sheet sheet-floating--shadow-floating콘텐츠 위에 뜨는 팝오버와 메뉴
sheet sheet-inverse잉크색 바탕에 기본 높이의 그림자페이지에서 사용자 행동을 유도하는 단 하나의 표면

#반전 표면

sheet-inverse는 잉크색을 입힌 볼록한 표면입니다. moonstone에서는 어두운색, obsidian에서는 진주색을 씁니다. 강조 버튼의 바탕을 표면 크기로 확장한 형태로, 빛에 따른 명암 변화와 위쪽 가장자리의 밝은 선도 같습니다. 행동 유도처럼 사용자에게 어떤 행동을 요청하는 곳에 페이지당 하나만 사용하세요.

이 표면의 텍스트에는 반전 잉크색을 사용합니다. 기본적으로 강조 잉크색을 쓰는 제목에는 fg-text-inverse를 추가하세요. 이 표면에서는 기본 버튼이 화면에서 가장 밝아 사용자가 눌러야 할 버튼임을 쉽게 알아볼 수 있습니다. 강조 버튼을 쓰면 잉크색 바탕 위에 잉크색이 겹칩니다.

반전 표면

<section class="sheet sheet-inverse flex flex-wrap items-center justify-between gap-md p-lg">  <div class="flex flex-col gap-3xs">    <h3 class="heading heading-sm fg-text-inverse">Your trial ends in three days</h3>    <p class="m(0) text-sm">Add a card to keep your projects online.</p>  </div>  <button type="button" class="btn btn-sm">Add a card</button></section>
<section className="sheet sheet-inverse flex flex-wrap items-center justify-between gap-md p-lg">  <div className="flex flex-col gap-3xs">    <h3 className="heading heading-sm fg-text-inverse">Your trial ends in three days</h3>    <p className="m(0) text-sm">Add a card to keep your projects online.</p>  </div>  <button type="button" className="btn btn-sm">Add a card</button></section>
<section class="sheet sheet-inverse flex flex-wrap items-center justify-between gap-md p-lg">  <div class="flex flex-col gap-3xs">    <h3 class="heading heading-sm fg-text-inverse">Your trial ends in three days</h3>    <p class="m(0) text-sm">Add a card to keep your projects online.</p>  </div>  <button type="button" class="btn btn-sm">Add a card</button></section>
<template>  <section class="sheet sheet-inverse flex flex-wrap items-center justify-between gap-md p-lg">    <div class="flex flex-col gap-3xs">      <h3 class="heading heading-sm fg-text-inverse">Your trial ends in three days</h3>      <p class="m(0) text-sm">Add a card to keep your projects online.</p>    </div>    <button type="button" class="btn btn-sm">Add a card</button>  </section></template>

#오목한 영역

오목한 영역은 주변보다 낮게 들어간 표면입니다. 부드러운 내부 그림자와 0.5px 윤곽선 하나를 두르고, 아래쪽 가장자리 바로 밑에 밝은 선을 더합니다. 입력 필드, 분할 컨트롤의 트랙, 스위치가 오목한 영역에 해당합니다.

--well-radius는 테마의 모서리 배율을 적용하기 전 오목한 영역의 원형 반경을 변경합니다. 기본값은 var(--radius-control)입니다.

오목한 영역

<div class="well p-lg text-sm fg-text-muted">Drop files here</div>
<div className="well p-lg text-sm fg-text-muted">Drop files here</div>
<div class="well p-lg text-sm fg-text-muted">Drop files here</div>
<template>  <div class="well p-lg text-sm fg-text-muted">Drop files here</div></template>

#트레이

트레이는 하나 이상의 볼록한 표면을 담는 오목한 받침입니다. 트레이의 반경은 볼록한 표면의 반경에 모서리 배율을 적용한 뒤 4px의 안쪽 여백을 더한 값입니다. 이렇게 하면 안팎의 모서리가 일정한 간격으로 맞물립니다. 기본 모서리 배율 1.6을 적용하면 볼록한 표면의 반경은 16px에서 25.6px로, 트레이의 반경은 29.6px로 계산됩니다.

트레이

<div class="tray">  <p class="m(0) px-md py-sm text-xs fg-text-muted">Recent</p>  <div class="sheet p-lg text-sm fg-text-body">Quarterly report.pdf</div></div>
<div className="tray">  <p className="m(0) px-md py-sm text-xs fg-text-muted">Recent</p>  <div className="sheet p-lg text-sm fg-text-body">Quarterly report.pdf</div></div>
<div class="tray">  <p class="m(0) px-md py-sm text-xs fg-text-muted">Recent</p>  <div class="sheet p-lg text-sm fg-text-body">Quarterly report.pdf</div></div>
<template>  <div class="tray">    <p class="m(0) px-md py-sm text-xs fg-text-muted">Recent</p>    <div class="sheet p-lg text-sm fg-text-body">Quarterly report.pdf</div>  </div></template>

트레이에 직접 넣는 다른 컴포넌트에도 볼록한 표면과 같은 반경이 필요합니다. 해당 컴포넌트의 루트 요소에서 오목한 영역은 --well-radius, 코드 블록이나 패널은 --code-radius, 창은 --window-radius, 알림은 --alert-radius를 설정하세요. 값으로는 var(--radius-surface)를 사용하세요. 트레이는 모서리 배율을 적용한 뒤 4px의 안쪽 여백을 더하므로 기본 테마와 Paper 모두에서 같은 간격이 유지됩니다. 더 깊이 중첩된 컴포넌트는 각자의 반경을 유지합니다.

트레이 안의 오목한 영역

<div class="tray">  <div class="well p-lg text-sm" style="--well-radius: var(--radius-surface)">    No builds are queued.  </div></div>
<div className="tray">  <div className="well p-lg text-sm" style={{ '--well-radius': 'var(--radius-surface)' } as React.CSSProperties}>    No builds are queued.  </div></div>
<div class="tray">  <div class="well p-lg text-sm" style="--well-radius: var(--radius-surface)">    No builds are queued.  </div></div>
<template>  <div class="tray">    <div class="well p-lg text-sm" style="--well-radius: var(--radius-surface)">      No builds are queued.    </div>  </div></template>

#표면 색상

각 표면은 자신의 색상을 --surface-color로 제공합니다. 모서리 배지, 겹친 아바타, 상태 표시 점의 둘레에 뒤쪽 표면을 도려낸 듯한 고리를 그릴 때 이 값을 참조합니다. 따라서 볼록한 표면, 트레이, 오목한 영역, 카드, 대화 상자 안에서는 고리 색상이 자동으로 표면과 일치합니다. 직접 만든 표면에서는 이 속성에 배경색을 지정하세요.

#유틸리티로 표면 구성

같은 표면 스타일이 테마 토큰으로 제공되므로 bg-surface-raised, shadow-raised, shadow-pressed, b-line-contour 유틸리티를 사용해 사용자 지정 요소에 적용할 수 있습니다.

표면 스타일 유틸리티

<div class="p-lg r-lg bg-surface-raised shadow-raised text-sm fg-text-body">  bg-surface-raised shadow-raised</div>
<div className="p-lg r-lg bg-surface-raised shadow-raised text-sm fg-text-body">  bg-surface-raised shadow-raised</div>
<div class="p-lg r-lg bg-surface-raised shadow-raised text-sm fg-text-body">  bg-surface-raised shadow-raised</div>
<template>  <div class="p-lg r-lg bg-surface-raised shadow-raised text-sm fg-text-body">    bg-surface-raised shadow-raised  </div></template>

#클래스

클래스설명
sheet16px 모서리 반경과 0.5px 윤곽선이 있는 볼록한 표면으로, 높이감을 주는 그림자를 적용합니다.
sheet-flat촘촘한 목록과 표에 윤곽선 하나만 적용하고 그림자는 생략합니다.적용할 클래스는 sheet입니다
sheet-raised시각 요소가 많은 표면 위의 작은 카드에 쓰는 그림자입니다. 기본값보다 한 단계 약합니다.적용할 클래스는 sheet입니다
sheet-floating콘텐츠 위에 표시되는 팝오버와 메뉴에 떠 있는 표면과 그에 맞는 그림자를 적용합니다.적용할 클래스는 sheet입니다
sheet-inverse페이지에서 사용자에게 무언가를 요청하는 단 하나의 표면에 사용합니다. 잉크색 배경에 반전된 텍스트 색을 적용합니다적용할 클래스는 sheet입니다
well10px 모서리 반경과 안쪽 그림자를 적용한 오목한 영역입니다.
tray볼록한 표면을 하나 이상 담는 오목한 받침입니다. 안쪽 여백은 4px이며, 받침의 20px 모서리 반경이 내부 표면의 16px 모서리 반경을 감쌉니다.

#사용자 지정 속성

속성기본값설명
--well-radiusvar(--radius-control)모서리 배율을 적용하기 전의 원형 반경입니다. 트레이에 바로 담긴 오목한 영역에는 var(--radius-surface)를 사용하세요.well에 설정합니다
--surface-colorvar(--color-surface-raised)링이 뒤쪽 표면에서 도형을 오려 낸 듯 보이도록 참조하는 표면 색상입니다. 떠 있는 표면과 반전된 표면은 각각 자체 색상을 지정합니다.sheet에 설정합니다
--surface-colorvar(--color-surface-inset)링이 뒤쪽 표면에서 도형을 오려 낸 듯 보이도록 참조하는 오목한 영역의 색상입니다.well에 설정합니다
--surface-colorvar(--color-surface-tray)링이 뒤쪽 표면에서 도형을 오려 낸 듯 보이도록 참조하는 트레이 색상입니다.tray에 설정합니다

#소스 코드

@master/ui/components/surface.css
/* * Surfaces: the material ladder in markup. * tray (a recessed holder) → sheet (a raised face) → floating; a well sits below its surroundings. * A sheet can also be ink, for the one surface on a page that asks for something. * Radii nest by a 4px inset: tray 20 → sheet 16, and a control inside is 10. * Each surface publishes its color as --surface-color, so a ring that cuts a shape out of it * (a corner badge, a stack of avatars) matches whatever it sits on. */@layer components.ui {  .sheet {    --surface-color: var(--color-surface-raised);    position: relative;    min-width: 0;    border-radius: calc(var(--radius-surface) * var(--corner-scale));    corner-shape: var(--corner-shape);    @apply --surface-sheet;    color: var(--color-text-body);    box-shadow: var(--shadow-lifted);    &.sheet-raised {      box-shadow: var(--shadow-raised);    }    &.sheet-floating {      --surface-color: var(--color-surface-floating);      background: var(--color-surface-floating);      box-shadow: var(--shadow-floating);    }    &.sheet-flat {      background: var(--color-surface-raised);      box-shadow: var(--shadow-flat);    }    /*     * Inverse: a sheet of ink, pearl on obsidian. It is the face of a primary button at the size of a surface:     * the same fall of light, the same line of light on its top edge. Use one on a page, for the moment     * that asks for something. Words on it take the inverse ink; a default button on it reads as the action.     */    &.sheet-inverse {      @apply --on-ink;      --surface-color: var(--color-surface-inverse);      @apply --surface-ink;      color: var(--color-text-inverse);      box-shadow:        inset 0 .5px 0 var(--color-ink-highlight),        0 0 0 .5px var(--color-ink-edge),        0 1px 2px -1px var(--color-shade-1), 0 2px 4px -2px var(--color-shade-2), 0 4px 8px -4px var(--color-shade-3), 0 8px 16px -8px var(--color-shade-4);    }    @media (forced-colors: active) {      outline: 1px solid CanvasText;      outline-offset: -1px;    }  }  .well {    --well-radius: var(--radius-control);    --surface-color: var(--color-surface-inset);    min-width: 0;    border-radius: calc(var(--well-radius) * var(--corner-scale));    corner-shape: var(--corner-shape);    background: var(--color-surface-inset);    box-shadow: var(--shadow-pressed);    @media (forced-colors: active) {      outline: 1px solid CanvasText;      outline-offset: -1px;    }  }  /* A tray's corner is the sheet's corner plus its 4px inset, so the gap keeps one width around the bend. */  .tray {    --surface-color: var(--color-surface-tray);    position: relative;    min-width: 0;    padding: 4px;    border-radius: calc(var(--radius-surface) * var(--corner-scale) + 4px);    corner-shape: var(--corner-shape);    background: var(--color-surface-tray);    color: var(--color-text-body);    /* Recessed by tone and a hairline; it holds raised sheets, so it casts no shadow of its own. */    box-shadow: inset 0 0 0 .5px var(--color-line-hair), inset 0 1px 2px -1px var(--color-shade-2);    @media (forced-colors: active) {      outline: 1px solid CanvasText;      outline-offset: -1px;    }  }}