텍스처
표면 전체에 그려지는 점, 격자, 줄무늬, 교차 빗금, 체커보드 무늬.
이 페이지의 내용
텍스처는 하나의 무늬를 표면 전체에 반복해 그린 것입니다. 콘텐츠가 없지만 어떤 영역인지 알려야 할 때는 해당 요소에 .texture를 적용하세요. 텍스처는 은은한 단색 배경 이미지이므로 요소의 기존 배경색 위에 표시됩니다. 오목한 영역은 그대로 유지되고 그 위에 점 무늬가 더해집니다.
텍스처
<div class="well texture flex items-center justify-center h(160)"> <button type="button" class="btn">Publish</button></div><div className="well texture flex items-center justify-center h(160)"> <button type="button" className="btn">Publish</button></div><div class="well texture flex items-center justify-center h(160)"> <button type="button" class="btn">Publish</button></div><template> <div class="well texture flex items-center justify-center h(160)"> <button type="button" class="btn">Publish</button> </div></template>#무늬
다섯 가지 무늬는 각각 적용된 영역에 대해 한 가지 의미를 전달합니다. 같은 줄무늬를 두 곳에서 본 사용자가 두 영역을 같은 의미로 이해할 수 있도록, 모양보다 의미를 기준으로 무늬를 고르세요.
무늬
<div class="auto-grid auto-grid-fit" style="--auto-grid-min: 6rem"> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture h(96)"></div> <figcaption class="text-xs fg-text-muted">Dots</figcaption> </figure> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture texture-grid h(96)"></div> <figcaption class="text-xs fg-text-muted">Grid</figcaption> </figure> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture texture-stripes h(96)"></div> <figcaption class="text-xs fg-text-muted">Stripes</figcaption> </figure> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture texture-crosshatch h(96)"></div> <figcaption class="text-xs fg-text-muted">Crosshatch</figcaption> </figure> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture texture-checker h(96)"></div> <figcaption class="text-xs fg-text-muted">Checker</figcaption> </figure></div><div className="auto-grid auto-grid-fit" style={{ '--auto-grid-min': '6rem' } as React.CSSProperties}> <figure className="m(0) flex flex-col gap-xs"> <div className="well texture h(96)"></div> <figcaption className="text-xs fg-text-muted">Dots</figcaption> </figure> <figure className="m(0) flex flex-col gap-xs"> <div className="well texture texture-grid h(96)"></div> <figcaption className="text-xs fg-text-muted">Grid</figcaption> </figure> <figure className="m(0) flex flex-col gap-xs"> <div className="well texture texture-stripes h(96)"></div> <figcaption className="text-xs fg-text-muted">Stripes</figcaption> </figure> <figure className="m(0) flex flex-col gap-xs"> <div className="well texture texture-crosshatch h(96)"></div> <figcaption className="text-xs fg-text-muted">Crosshatch</figcaption> </figure> <figure className="m(0) flex flex-col gap-xs"> <div className="well texture texture-checker h(96)"></div> <figcaption className="text-xs fg-text-muted">Checker</figcaption> </figure></div><div class="auto-grid auto-grid-fit" style="--auto-grid-min: 6rem"> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture h(96)"></div> <figcaption class="text-xs fg-text-muted">Dots</figcaption> </figure> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture texture-grid h(96)"></div> <figcaption class="text-xs fg-text-muted">Grid</figcaption> </figure> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture texture-stripes h(96)"></div> <figcaption class="text-xs fg-text-muted">Stripes</figcaption> </figure> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture texture-crosshatch h(96)"></div> <figcaption class="text-xs fg-text-muted">Crosshatch</figcaption> </figure> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture texture-checker h(96)"></div> <figcaption class="text-xs fg-text-muted">Checker</figcaption> </figure></div><template> <div class="auto-grid auto-grid-fit" style="--auto-grid-min: 6rem"> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture h(96)"></div> <figcaption class="text-xs fg-text-muted">Dots</figcaption> </figure> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture texture-grid h(96)"></div> <figcaption class="text-xs fg-text-muted">Grid</figcaption> </figure> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture texture-stripes h(96)"></div> <figcaption class="text-xs fg-text-muted">Stripes</figcaption> </figure> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture texture-crosshatch h(96)"></div> <figcaption class="text-xs fg-text-muted">Crosshatch</figcaption> </figure> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture texture-checker h(96)"></div> <figcaption class="text-xs fg-text-muted">Checker</figcaption> </figure> </div></template>| 클래스 | 의미 | 용도 |
|---|---|---|
texture | 대상을 보여 주는 공간 | 견본, 캔버스 또는 다이어그램을 보여 주는 배경 |
texture texture-grid | 눈금이 있는 공간 | 편집기, 평면도, 레이아웃 실습처럼 위치가 중요한 캔버스 |
texture texture-stripes | 비워 둔 공간 | 거터, 여백, 비어 있는 슬롯, 이미지 자리 표시자 |
texture texture-crosshatch | 사용할 수 없는 공간 | 차단된 시간대, 운영하지 않는 날, 허용 범위를 벗어난 구간 |
texture texture-checker | 투명한 영역 | 투명한 이미지나 알파값이 있는 색상 아래에 깔리는 배경 |
텍스처 위에 텍스트를 바로 놓지 마세요. 무늬가 글자와 겹치면 읽기 어려우므로 캡션은 텍스처가 있는 영역 옆이나 그 위에 얹은 표면에 배치하세요.
#비워 둔 영역과 사용 불가 영역
줄무늬와 교차 빗금은 서로 다른 두 종류의 빈 영역을 구분합니다. 줄무늬 슬롯은 비워 둔 자리로 나중에 채울 수도 있으며, 교차 빗금 슬롯은 선택할 수 없습니다. 무늬만으로는 모든 사용자가 의미를 파악할 수 없으므로 같은 내용을 텍스트로도 전달하세요. 이 예시에서는 이용할 수 없는 시간대를 비활성화하고 이름도 지정합니다.
비워 둔 영역과 사용 불가 영역
<div class="sheet grid grid-cols(4) gap-xs p-xs"> <button type="button" class="btn btn-quiet h(88)">9:00</button> <button type="button" class="btn btn-quiet h(88)">10:00</button> <div class="well texture texture-stripes h(88)" role="img" aria-label="11:00, kept free"></div> <div class="well texture texture-crosshatch h(88)" role="img" aria-label="12:00, closed"></div></div><p class="m(0) mt-md text-xs fg-text-muted">11:00 is kept free. The office is closed at 12:00.</p><> <div className="sheet grid grid-cols(4) gap-xs p-xs"> <button type="button" className="btn btn-quiet h(88)">9:00</button> <button type="button" className="btn btn-quiet h(88)">10:00</button> <div className="well texture texture-stripes h(88)" role="img" aria-label="11:00, kept free"></div> <div className="well texture texture-crosshatch h(88)" role="img" aria-label="12:00, closed"></div> </div> <p className="m(0) mt-md text-xs fg-text-muted"> 11:00 is kept free. The office is closed at 12:00. </p></><div class="sheet grid grid-cols(4) gap-xs p-xs"> <button type="button" class="btn btn-quiet h(88)">9:00</button> <button type="button" class="btn btn-quiet h(88)">10:00</button> <div class="well texture texture-stripes h(88)" role="img" aria-label="11:00, kept free"></div> <div class="well texture texture-crosshatch h(88)" role="img" aria-label="12:00, closed"></div></div><p class="m(0) mt-md text-xs fg-text-muted">11:00 is kept free. The office is closed at 12:00.</p><template> <div class="sheet grid grid-cols(4) gap-xs p-xs"> <button type="button" class="btn btn-quiet h(88)">9:00</button> <button type="button" class="btn btn-quiet h(88)">10:00</button> <div class="well texture texture-stripes h(88)" role="img" aria-label="11:00, kept free"></div> <div class="well texture texture-crosshatch h(88)" role="img" aria-label="12:00, closed"></div> </div> <p class="m(0) mt-md text-xs fg-text-muted">11:00 is kept free. The office is closed at 12:00.</p></template>#투명도
체커보드 무늬는 자체 배경이 없는 대상 뒤에 깔립니다. 이미지를 무늬 위에 배치하면 투명한 부분을 통해 격자 칸이 보입니다. 이 예시에서는 마크의 뚫린 부분으로 무늬가 보입니다.
투명도
<div class="well texture texture-checker flex items-center justify-center w(240) h(136) fg-text-strong"> <svg width="80" height="80" viewBox="0 0 96 96" role="img" aria-label="A square mark with a round hole"> <path fill="currentColor" fill-rule="evenodd" d="M20 8h56a12 12 0 0 1 12 12v56a12 12 0 0 1-12 12H20A12 12 0 0 1 8 76V20A12 12 0 0 1 20 8Zm28 18a22 22 0 1 0 0 44 22 22 0 0 0 0-44Z" /> </svg></div><div className="well texture texture-checker flex items-center justify-center w(240) h(136) fg-text-strong"> <svg width="80" height="80" viewBox="0 0 96 96" role="img" aria-label="A square mark with a round hole"> <path fill="currentColor" fillRule="evenodd" d="M20 8h56a12 12 0 0 1 12 12v56a12 12 0 0 1-12 12H20A12 12 0 0 1 8 76V20A12 12 0 0 1 20 8Zm28 18a22 22 0 1 0 0 44 22 22 0 0 0 0-44Z" /> </svg></div><div class="well texture texture-checker flex items-center justify-center w(240) h(136) fg-text-strong"> <svg width="80" height="80" viewBox="0 0 96 96" role="img" aria-label="A square mark with a round hole"> <path fill="currentColor" fill-rule="evenodd" d="M20 8h56a12 12 0 0 1 12 12v56a12 12 0 0 1-12 12H20A12 12 0 0 1 8 76V20A12 12 0 0 1 20 8Zm28 18a22 22 0 1 0 0 44 22 22 0 0 0 0-44Z" /> </svg></div><template> <div class="well texture texture-checker flex items-center justify-center w(240) h(136) fg-text-strong"> <svg width="80" height="80" viewBox="0 0 96 96" role="img" aria-label="A square mark with a round hole"> <path fill="currentColor" fill-rule="evenodd" d="M20 8h56a12 12 0 0 1 12 12v56a12 12 0 0 1-12 12H20A12 12 0 0 1 8 76V20A12 12 0 0 1 20 8Zm28 18a22 22 0 1 0 0 44 22 22 0 0 0 0-44Z" /> </svg> </div></template>#크기, 굵기, 색상
세 가지 사용자 지정 속성으로 요소에 적용된 무늬를 조정할 수 있습니다. --texture-size는 타일 한 변의 길이, --texture-weight는 점의 반지름 또는 선의 굵기, --texture-ink는 무늬의 색상입니다. 테마에서는 --color-texture로 모든 텍스처의 색상을 한꺼번에 설정합니다.
텍스처는 그 위에 놓인 대상보다 덜 도드라지게 하세요. 견본을 보여 주는 배경에는 가늘고 성긴 무늬만 있어도 견본의 윤곽을 알아볼 수 있습니다. 무늬가 촘촘하면 견본에서 시선이 분산됩니다.
크기, 굵기, 색상
<div class="auto-grid auto-grid-fit" style="--auto-grid-min: 9rem"> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture h(96)" style="--texture-size: 20px"></div> <figcaption class="text-xs fg-text-muted">A 20px tile</figcaption> </figure> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture texture-stripes h(96)" style="--texture-weight: 1px; --texture-size: 12px"></div> <figcaption class="text-xs fg-text-muted">A 1px stripe in a 12px tile</figcaption> </figure> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture texture-grid h(96)" style="--texture-ink: var(--color-line-hair)"></div> <figcaption class="text-xs fg-text-muted">The hairline's ink</figcaption> </figure></div><div className="auto-grid auto-grid-fit" style={{ '--auto-grid-min': '9rem' } as React.CSSProperties}> <figure className="m(0) flex flex-col gap-xs"> <div className="well texture h(96)" style={{ '--texture-size': '20px' } as React.CSSProperties}></div> <figcaption className="text-xs fg-text-muted">A 20px tile</figcaption> </figure> <figure className="m(0) flex flex-col gap-xs"> <div className="well texture texture-stripes h(96)" style={{ '--texture-weight': '1px', '--texture-size': '12px' } as React.CSSProperties}></div> <figcaption className="text-xs fg-text-muted">A 1px stripe in a 12px tile</figcaption> </figure> <figure className="m(0) flex flex-col gap-xs"> <div className="well texture texture-grid h(96)" style={{ '--texture-ink': 'var(--color-line-hair)' } as React.CSSProperties}></div> <figcaption className="text-xs fg-text-muted">The hairline's ink</figcaption> </figure></div><div class="auto-grid auto-grid-fit" style="--auto-grid-min: 9rem"> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture h(96)" style="--texture-size: 20px"></div> <figcaption class="text-xs fg-text-muted">A 20px tile</figcaption> </figure> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture texture-stripes h(96)" style="--texture-weight: 1px; --texture-size: 12px"></div> <figcaption class="text-xs fg-text-muted">A 1px stripe in a 12px tile</figcaption> </figure> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture texture-grid h(96)" style="--texture-ink: var(--color-line-hair)"></div> <figcaption class="text-xs fg-text-muted">The hairline's ink</figcaption> </figure></div><template> <div class="auto-grid auto-grid-fit" style="--auto-grid-min: 9rem"> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture h(96)" style="--texture-size: 20px"></div> <figcaption class="text-xs fg-text-muted">A 20px tile</figcaption> </figure> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture texture-stripes h(96)" style="--texture-weight: 1px; --texture-size: 12px"></div> <figcaption class="text-xs fg-text-muted">A 1px stripe in a 12px tile</figcaption> </figure> <figure class="m(0) flex flex-col gap-xs"> <div class="well texture texture-grid h(96)" style="--texture-ink: var(--color-line-hair)"></div> <figcaption class="text-xs fg-text-muted">The hairline's ink</figcaption> </figure> </div></template>줄무늬는 정사각형 타일에서 45° 기울어져 있으므로 줄 사이의 간격은 타일 한 변의 길이를 √2로 나눈 값입니다. 기본값인 8px 타일에서는 5.7px입니다. 타일이 이어지는 지점에서 선이 어긋나지 않도록 타일 크기는 정수 픽셀로 설정하세요.
타일은 영역의 중앙을 기준으로 배치되므로 영역의 크기에 관계없이 마주 보는 가장자리에서 무늬가 같은 방식으로 잘립니다. 모서리에서 시작하려면 background-position을 설정하세요.
#가장자리 페이드
texture-fade는 제목 뒤에 배경을 깔 때처럼 무늬를 가장자리로 갈수록 옅게 만드는 데 사용합니다. 이 효과는 마스크로 구현되므로 요소 안의 콘텐츠도 함께 옅어집니다. 콘텐츠 뒤에 별도의 요소를 두고 그 요소에 적용한 뒤 보조 기술에서 해당 요소를 숨기세요.
가장자리 페이드
<div class="relative flex flex-col items-center justify-center gap-md h(192)"> <div class="texture texture-grid texture-fade absolute inset(0)" aria-hidden="true"></div> <h3 class="relative m(0) text-xl fg-text-strong">Ship the first draft</h3> <button type="button" class="relative btn btn-primary">Start a project</button></div><div className="relative flex flex-col items-center justify-center gap-md h(192)"> <div className="texture texture-grid texture-fade absolute inset(0)" aria-hidden="true"></div> <h3 className="relative m(0) text-xl fg-text-strong">Ship the first draft</h3> <button type="button" className="relative btn btn-primary">Start a project</button></div><div class="relative flex flex-col items-center justify-center gap-md h(192)"> <div class="texture texture-grid texture-fade absolute inset(0)" aria-hidden="true"></div> <h3 class="relative m(0) text-xl fg-text-strong">Ship the first draft</h3> <button type="button" class="relative btn btn-primary">Start a project</button></div><template> <div class="relative flex flex-col items-center justify-center gap-md h(192)"> <div class="texture texture-grid texture-fade absolute inset(0)" aria-hidden="true"></div> <h3 class="relative m(0) text-xl fg-text-strong">Ship the first draft</h3> <button type="button" class="relative btn btn-primary">Start a project</button> </div></template>#레이어 합성
텍스처는 요소의 배경 이미지를 대체하며 배경색은 유지됩니다. 다른 이미지를 함께 표시하거나 무늬를 이용해 모양을 잘라 내려면 클래스가 적용된 요소에서 --texture-image를 참조하세요. 해당 속성으로 무늬가 제공됩니다.
.texture.stage { background-image: var(--texture-image), linear-gradient(var(--color-surface-raised), var(--color-surface-raised-low)); background-size: var(--texture-size) var(--texture-size), auto;}교차 빗금은 두 레이어로 구성되므로 크기 값도 두 개를 지정하세요.
#접근성
텍스처는 시각적 무늬이며 강제 색상 모드에서는 제거됩니다. 텍스처에만 의미를 맡기지 마세요.
- 텍스처가 장식용인 영역에는 별도의 설명이 필요 없습니다. 텍스처 표시만을 위해 별도로 둔 요소에는
aria-hidden="true"를 지정하세요. - 텍스처가 비워 둔 상태, 사용 불가 상태 또는 투명 상태를 나타내면 같은 의미를 눈에 보이는 텍스트로 영역 옆이나 안에 전달하세요. 강제 색상 모드에서도 텍스트는 남습니다. 영역 자체에
role="img"와aria-label을 지정하면 보조 기술에도 이름이 전달되지만 화면에는 보이지 않으므로 텍스트를 대신할 수 없습니다. - 사용할 수 없는 컨트롤에는 먼저
disabled를 지정하세요. 교차 빗금은 이 속성이 나타내는 상태를 시각적으로 반복해 보여 줍니다.
#클래스
| 클래스 | 설명 |
|---|---|
texture | 타일마다 점 하나를 찍어 견본을 보여 주는 배경을 만듭니다. |
texture-grid | 크기를 가늠할 수 있는 정사각형 격자적용할 클래스는 texture입니다 |
texture-stripes | 열 사이 간격, 여백, 비워 둔 슬롯처럼 빈 상태로 유지하는 공간을 가는 대각선으로 표시합니다.적용할 클래스는 texture입니다 |
texture-crosshatch | 차단된 시간이나 허용 범위를 벗어난 구간처럼 사용할 수 없는 영역에 양방향으로 가는 선을 긋습니다.적용할 클래스는 texture입니다 |
texture-checker | 투명한 요소 뒤에 깔리는 체커보드 패턴입니다.적용할 클래스는 texture입니다 |
texture-fade | 패턴은 가장자리로 갈수록 옅어집니다. 요소 안의 콘텐츠에도 마스크가 적용되므로 별도 요소에 적용하세요.적용할 클래스는 texture입니다 |
#사용자 지정 속성
| 속성 | 기본값 | 설명 |
|---|---|---|
--texture-ink | var(--color-texture) | 표식의 색상입니다. 선과 사각형은 이 색상의 절반 농도로 그립니다.texture에 설정합니다 |
--texture-size | 12px | 타일 한 변의 길이입니다. 점은 12px, 격자는 24px, 줄무늬와 교차 사선은 8px, 체커보드는 16px입니다.texture에 설정합니다 |
--texture-weight | 1px | 점의 반지름 또는 선의 두께입니다. 줄무늬의 선 두께는 .5px이며, 체커보드에는 이 값이 적용되지 않습니다.texture에 설정합니다 |
--texture-image | 다른 이미지 아래에 깔거나 마스크로 사용하는 패턴입니다. 교차 사선은 두 레이어로 구성됩니다.texture에 설정합니다 |