본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Pico CSS 시작하기

원문 보기 위키 갱신

Pico CSS를 프로젝트에 적용하는 가장 간단한 방법부터 알려드릴게요. pico.css를 직접 파일로 연결하거나 CDN을 통해 의존성 없이 바로 쓸 수 있고, NPM이나 Composer를 이용하면 더 고급스럽게 활용할 수도 있어요.

pico.css를 시작하는 방법은 크게 네 가지가 있습니다. 아래에서 자신의 환경에 맞는 방법을 골라 보세요.

출처: 문서

본문

수동 설치 (Install manually)

Pico 다운로드 후, 웹사이트의 <head>에 /css/pico.min.css를 연결하면 돼요.

<link rel="stylesheet" href="css/pico.min.css">

CDN에서 사용하기 (Usage from CDN)

파일을 직접 받기 보다 편하다면, jsDelivr CDN을 이용해 pico.min.css를 연결할 수도 있어요.

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css"
>

NPM으로 설치하기 (Install with NPM)

npm install @picocss/pico

또는

yarn add @picocss/pico

그 다음 SCSS 파일에서 @use로 Pico를 불러오면 돼요.

@use "pico";

Sass로 커스터마이징하는 방법에 대해 자세히 알아보세요.

Composer로 설치하기 (Install with Composer)

composer require picocss/pico

시작용 HTML 템플릿 (Starter HTML template)

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="color-scheme" content="light dark">
    <link rel="stylesheet" href="css/pico.min.css">
    <title>Hello world!</title>
  </head>
  <body>
    <main class="container">
      <h1>Hello world!</h1>
    </main>
  </body>
</html>

더 알아보기