타이포그래피
타이포그래피 (Typography)
Quasar가 제공하는 타이포그래피를 아래 섹션에서 살펴볼게요. 제목(headings), 글꼴 두께(font weights), CSS 헬퍼 클래스, 기본 글꼴과 커스텀 글꼴 추가 방법을 다뤄요.
출처: 문서
본문
Headings
| Class | HTML equivalent | Sample |
|---|---|---|
text-h1 |
h1 |
Headline 1 |
text-h2 |
h2 |
Headline 2 |
text-h3 |
h3 |
Headline 3 |
text-h4 |
h4 |
Headline 4 |
text-h5 |
h5 |
Headline 5 |
text-h6 |
h6 |
Headline 6 |
text-subtitle1 |
Subtitle 1 | |
text-subtitle2 |
Subtitle 2 | |
text-body1 |
Body 1 | |
text-body2 |
Body 2 | |
text-caption |
Caption text | |
text-overline |
Overline |
Font Weights
text-weight-thintext-weight-lighttext-weight-regulartext-weight-mediumtext-weight-boldtext-weight-bolder
CSS Helper Classes
| Class Name | Description |
|---|---|
text-right |
텍스트를 오른쪽으로 정렬 |
text-left |
텍스트를 왼쪽으로 정렬 |
text-center |
텍스트를 가운데로 정렬 |
text-justify |
텍스트를 양쪽 정렬(justified) |
text-bold |
텍스트를 굵게(bold) |
text-italic |
텍스트를 이탤릭(italic)으로 |
text-no-wrap |
줄바꿈되지 않는 텍스트(white-space: nowrap 적용) |
text-strike |
text-decoration: line-through 적용 |
text-uppercase |
텍스트를 대문자로 변환 |
text-lowercase |
텍스트를 소문자로 변환 |
text-capitalize |
텍스트의 첫 글자를 대문자로 |
Default Font
기본으로 내장된 webfont는 Roboto예요. 하지만 필수는 아니에요. 원하는 어떤 글꼴이든 사용할 수 있어요.
Roboto는 variable font로 제공되기 때문에 100부터 900까지 어떤 font-weight든 동작해요. Latin, Latin Extended, Cyrillic, Greek, Vietnamese 문자를 다루며, 브라우저가 페이지에서 실제로 쓰는 서브셋만 나눠서 다운로드해요.
Roboto 글꼴이 기본으로 내장되는데, 이를 제거하려면 다음과 같이 해요:
/quasar.config file 예시:
extras: ['roboto-font']
커스텀 글꼴 추가하기
앱에서 쓸 다른 글꼴도 포함할 수 있어요. 한 가지 방법은 다음과 같아요:
- 새 webfont
[customfont].woff2(또는 어떤 확장자든;woff2는 모든 브라우저가 지원하고 가장 작아요)를 원하는 디렉터리에 복사해요. 예:./src/css/fonts/[customfont.woff2] ./src/css/app.{css|sass|scss|styl}(또는 적절한 어떤 위치든)에서 글꼴을 선언해요. 단 webfont 파일까지의 상대 경로는 올바르게 수정해야 해요:
@font-face {
font-family: customfont;
src: url(./fonts/customfont.woff2);
}
// declare a class which applies it
.my-font {
font-family: 'customfont';
}
- 그런 다음 필요할 때 그 클래스를 사용해요.
더 알아보기 (Learn more)
Quasar의 타이포그래피는 제목용 text-h1text-h6, 본문/캡션용 text-body1text-overline, 그리고 text-bold, text-italic, 정렬·대소문자 변환 같은 CSS 헬퍼 클래스로 구성돼요. 글꼴 두께는 text-weight-*로, 기본 Roboto 대신 @font-face로 커스텀 글꼴을 등록해 쓸 수 있어요.