Style Sheet/Bootstrap5

๐Ÿ”ฎ BootStrap5 ์•„์ด์ฝ˜ ์‚ฌ์šฉ๋ฒ• ์ •๋ฆฌ

์ธํŒŒ_ 2021. 10. 19. 04:05

๋ถ€ํŠธ์ŠคํŠธ๋žฉ

BootStrap 5 icons

๋Œ€ํ‘œ์ ์ธ ํฐํŠธ ์•„์ด์ฝ˜์œผ๋กœ๋Š” ํฐํŠธ์–ด์ธ(FontAwesome), XEIcon, Google Icon Fonts ๋“ฑ์ด ์žˆ์Šต๋‹ˆ๋‹ค.

๋ถ€ํŠธ์ŠคํŠธ๋žฉ ์•„์ด์ฝ˜(Bootstrap Icons)์€ ํฐํŠธ ์–ด์ธ์ฒ˜๋Ÿผ ์‚ฌ์šฉํ•˜๊ธฐ ๋งค์šฐ ์‰ฝ์Šต๋‹ˆ๋‹ค.

๋”๋ถˆ์–ด svg ์•„์ด์ฝ˜์„ ์ด๋ฏธ์ง€๋กœ ๋‹ค์šด๋กœ๋“œ ๋ฐ›์„ ์ˆ˜๋„ ์žˆ๊ณ , svg ์ฝ”๋“œ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์žˆ๋„๋ก ๋‹ค์–‘ํ•˜๊ฒŒ ํŽธ์˜๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

 

Bootstrap Icons

Official open source SVG icon library for Bootstrap

icons.getbootstrap.com

 

NPM

> npm i bootstrap-icons

 

CDN

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.0/font/bootstrap-icons.css">

๋ถ€ํŠธ์ŠคํŠธ๋žฉ ์•„์ด์ฝ˜ ์ ์šฉ๋ฒ•

๋ถ€ํŠธ์ŠคํŠธ๋žฉ์„œํƒ

 


<i> ํƒœ๊ทธ๋กœ ์ ์šฉ ๋ฐฉ๋ฒ•

iํƒœ๊ทธ

<head>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.6.0/font/bootstrap-icons.css" />
</head>

<body>
  <i class="bi-check fs-5"></i>
  <i class="bi-arrow-right-circle fs-5"></i>
</body>

ํ•˜๋‚˜์”ฉ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

<i class="bi-check fs-5"></i>

 

์—์„œ bi- ๋‹ค์Œ์˜ ์•„์ด์ฝ˜ ๋ช…์„ ์ ์–ด์ฃผ์‹œ๋ฉด ๊ทธ ์•„์ด์ฝ˜์œผ๋กœ ์ ์šฉ๋˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

๋งŒ์ผ ์‚ฌ๊ณผ ์•„์ด์ฝ˜์„ ์ ์šฉํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด bi-apple ์ด๋ผ๊ณ  ์จ์ฃผ๋ฉด ์ ์šฉ ๋ฉ๋‹ˆ๋‹ค.

fs-5 ๋Š” font-size 5๋ฐฐ์ˆ˜ ํฌ๊ธฐ ์˜ ์•ฝ์ž์ž…๋‹ˆ๋‹ค.

 

๋งŒ์ผ ์ข€๋” ์ƒ์„ธํ•˜๊ฒŒ ์•„์ด์ฝ˜์˜ ์†์„ฑ์„ ์กฐ์ •ํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด, css์—์„œ ์•„์ด์ฝ˜ ํด๋ž˜์Šค๋ช…์„ ์ •์˜ํ•ด ์‚ฌ์šฉํ• ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. 

.bi-check{
    font-size: 22px;
    line-height: 22px;
    color:crimson;
}

<svg> ํƒœ๊ทธ๋กœ ์ ์šฉ ๋ฐฉ๋ฒ•

svg๋ณต์‚ฌ

<head>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.6.0/font/bootstrap-icons.css" />
</head>

<body>
  <!-- ๊ทธ๋Œ€๋กœ body ํƒœ๊ทธ์•ˆ์— ๋ถ™์—ฌ๋„ฃ์œผ๋ฉด ๋ฉ๋‹ˆ๋‹ค. -->
  <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-watch" viewBox="0 0 16 16">
    <path d="M8.5 5a.5.5 0 0 0-1 0v2.5H6a.5.5 0 0 0 0 1h2a.5.5 0 0 0 .5-.5V5z"/>
    <path d="M5.667 16C4.747 16 4 15.254 4 14.333v-1.86A5.985 5.985 0 0 1 2 8c0-1.777.772-3.374 2-4.472V1.667C4 .747 4.746 0 5.667 0h4.666C11.253 0 12 .746 12 1.667v1.86a5.99 5.99 0 0 1 1.918 3.48.502.502 0 0 1 .582.493v1a.5.5 0 0 1-.582.493A5.99 5.99 0 0 1 12 12.473v1.86c0 .92-.746 1.667-1.667 1.667H5.667zM13 8A5 5 0 1 0 3 8a5 5 0 0 0 10 0z"/>
  </svg>
</body>

 

[๋ถ€ํŠธ์ŠคํŠธ๋žฉ ์•„์ด์ฝ˜ svg ์ฝ”๋“œ์—์„œ ํฌ๊ธฐ์™€ ์ƒ‰์ƒ ๋ณ€๊ฒฝํ•˜๊ธฐ]

svg ์ฝ”๋“œ๋ฅผ ๋„ฃ์€ ๊ฒฝ์šฐ ์ฝ”๋“œ ๋‚ด๋ถ€์˜ ์†์„ฑ์„ ๋ณ€๊ฒฝํ•ด์„œ ํฌ๊ธฐ์™€ ์ƒ‰์ƒ์„ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

svg์กฐ์ž‘

 

CSS ์„ ํƒ์ž๋กœ ๋””์ž์ธ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

svg.className {
    width: 100px;
    height: 100px;
    color: limegreen;
}

๋ณด๋„ˆ์Šค) ๋ถ€ํŠธ์ŠคํŠธ๋žฉ ์•„์ด์ฝ˜ ํด๋ฆญ ์ด๋ฒคํŠธ ์˜ˆ์‹œ

See the Pen ๋ถ€ํŠธ์ŠคํŠธ๋žฉ ์•„์ด์ฝ˜ ํด๋ฆญ์ด๋ฒคํŠธ ์˜ˆ์‹œ by barzz12 (@inpaSkyrim) on CodePen.


# ์ฐธ๊ณ ์ž๋ฃŒ

https://www.inflearn.com/blogs/1446