λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°

πŸ’¬/γ…γ……γ…Œγ…‹γ…γ…… μ±Œλ¦°μ§€

30일차

🧼

30일차

 

Part 7. CSS ν”„λ ˆμž„μ›Œν¬ BootStrap

Ch 1. CSS ν”„λ ˆμž„μ›Œν¬ BootStrap

 


 

 

Ch 1. CSS ν”„λ ˆμž„μ›Œν¬ BootStrap

 

 

https://getbootstrap.com/docs/5.1/getting-started/introduction/

 

Introduction

Get started with Bootstrap, the world’s most popular framework for building responsive, mobile-first sites, with jsDelivr and a template starter page.

getbootstrap.com

<head>
    ...
    <link
      href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
      rel="stylesheet"
      integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
      crossorigin="anonymous"
    />
    <script
      src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
      integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
      crossorigin="anonymous"
    ></script>
  </head>

 


 

https://getbootstrap.com/docs/5.1/components/buttons/

 

Buttons

Use Bootstrap’s custom button styles for actions in forms, dialogs, and more with support for multiple sizes, states, and more.

getbootstrap.com

https://getbootstrap.com/docs/5.1/components/button-group/

 

Button group

Group a series of buttons together on a single line or stack them in a vertical column.

getbootstrap.com

 

https://getbootstrap.com/docs/5.1/components/dropdowns/

 

Dropdowns

Toggle contextual overlays for displaying lists of links and more with the Bootstrap dropdown plugin.

getbootstrap.com

https://getbootstrap.com/docs/5.1/components/list-group/

 

List group

List groups are a flexible and powerful component for displaying a series of content. Modify and extend them to support just about any content within.

getbootstrap.com

 

https://getbootstrap.com/docs/5.1/forms/overview/

 

Forms

Examples and usage guidelines for form control styles, layout options, and custom components for creating a wide variety of forms.

getbootstrap.com

https://getbootstrap.com/docs/5.1/forms/form-control/

 

Form controls

Give textual form controls like <input>s and <textarea>s an upgrade with custom styles, sizing, focus states, and more.

getbootstrap.com

https://getbootstrap.com/docs/5.1/forms/input-group/

 

Input group

Easily extend form controls by adding text, buttons, or button groups on either side of textual inputs, custom selects, and custom file inputs.

getbootstrap.com

 

https://getbootstrap.com/docs/5.1/components/modal/

 

Modal

Use Bootstrap’s JavaScript modal plugin to add dialogs to your site for lightboxes, user notifications, or completely custom content.

getbootstrap.com

var myModal = document.getElementById('myModal')
var myInput = document.getElementById('myInput')

myModal.addEventListener('shown.bs.modal', function () {
  myInput.focus()
})

 

https://getbootstrap.com/docs/5.1/components/tooltips/

 

Tooltips

Documentation and examples for adding custom Bootstrap tooltips with CSS and JavaScript using CSS3 for animations and data-bs-attributes for local title storage.

getbootstrap.com

νˆ΄νŒμ€ μ„±λŠ₯μƒμ˜ 이유둜 opt-in λ˜μ–΄ μžˆμœΌλ―€λ‘œ 직접 μ΄ˆκΈ°ν™”ν•΄μ•Ό ν•œλ‹€. 
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
  return new bootstrap.Tooltip(tooltipTriggerEl)
})

 


 

 πŸ”— npm으둜 Bootstrap μ‚¬μš©ν•˜κΈ° 

 

  • Bootstrap μ—μ„œ ν•„μš”ν•œ κΈ°λŠ₯만 가져와 μ‚¬μš©ν•  수 μžˆλ‹€.
  • Bootstrap μ—μ„œ μ œκ³΅ν•˜λŠ” 기본적인 ν…Œλ§ˆλ“€μ„ 직접 μ»€μŠ€ν„°λ§ˆμ΄μ§• ν•  수 μžˆλ‹€.
$ npm install bootstrap
// main.js

import bootstrap from "bootstrap/dist/js/bootstrap.bundle";
/* main.scss */

@import "../node_modules/bootstrap/scss/bootstrap.scss";

 

https://getbootstrap.com/docs/5.1/customize/sass/#maps-and-loops

 

Sass

Utilize our source Sass files to take advantage of variables, maps, mixins, and functions to help you build faster and customize your project.

getbootstrap.com

/* main.scss */

@import "../node_modules/bootstrap/scss/functions";
@import "../node_modules/bootstrap/scss/variables";
@import "../node_modules/bootstrap/scss/mixins";
@import "../node_modules/bootstrap/scss/root";

 

https://getbootstrap.com/docs/5.1/customize/color/

 

Color

Bootstrap is supported by an extensive color system that themes our styles and components. This enables more comprehensive customization and extension for any project.

getbootstrap.com

 

 

 πŸ”— μ„±λŠ₯ μ΅œμ ν™” (트리 쉐이킹)  => Bootstrap μ—μ„œ μš°λ¦¬κ°€ ν•„μš”ν•œ κΈ°λŠ₯λ“€λ§Œ 골라 κ°€μ Έμ˜΄!

 

https://getbootstrap.com/docs/5.1/customize/optimize/

 

Optimize

Keep your projects lean, responsive, and maintainable so you can deliver the best experience and focus on more important jobs.

getbootstrap.com

 

/* main.scss */

/*@import "../node_modules/bootstrap/scss/bootstrap.scss";*/
@import "../node_modules/bootstrap/scss/bootstrap";
// import bootstrap from "bootstrap/dist/js/bootstrap.bundle";
import Dropdown from "bootstrap/js/dist/dropdown";

 

μ„±λŠ₯μƒμ˜ 이유둜 opt-in λ˜μ–΄ μžˆμœΌλ―€λ‘œ 직접 μ΄ˆκΈ°ν™”ν•΄μ•Ό ν•œλ‹€.
(μ΄ˆκΈ°ν™” ν•˜μ§€ μ•Šμ•„λ„ λ˜λŠ” μ»΄ν¬λ„ŒνŠΈλ„ 있음. ex λ²„νŠΌ, μŠ€ν”Όλ„ˆ λ“±)
// Dropdown
var dropdownElementList = [].slice.call(document.querySelectorAll('.dropdown-toggle'))
var dropdownList = dropdownElementList.map(function (dropdownToggleEl) {
  return new Dropdown(dropdownToggleEl)
})

// Modal
new Modal(document.querySelector("#exampleModal"), {
  // options
  backdrop: "static",
});

 

'πŸ’¬ > γ…γ……γ…Œγ…‹γ…γ…… μ±Œλ¦°μ§€' μΉ΄ν…Œκ³ λ¦¬μ˜ λ‹€λ₯Έ κΈ€

32일차  (0) 2022.03.18
31일차  (0) 2022.03.18
29일차  (0) 2022.03.17
28일차  (0) 2022.03.17
27일차  (0) 2022.03.17