git rebase

|

git rebase

git rebase는 말 그대로 base를 다시 정한다는 말입니다. 주로 특정 브랜치에서 commit 된 내용을 전부 master에 반영할 때 사용합니다.

git rebase 순서

만약 master 브랜치가 있고, 여기에 작업을 한 hotfix 브랜치가 있다고 하면,

  • git checkout hotfix : hotfix 브랜치로 이동
  • git rebase master : 현재 masterhotfix 브랜치의 앞 쪽에 base 설정함

의 순서로 진행하면 됩니다. 현재 작업 중인 브랜치의 base를 master로 설정함으로써, 현재 master에 이어서 작업 중인 hotfix 브랜치의 commit들을 연결할 수 있습니다.

CSS - wrap

|

id=”wrap”

대부분의 웹사이트 소스를 보면 항상 wrap 또는 wrapper 아이디의 <div> 태그들이 존재합니다.

<template>
  <div id="wrap">
    <div class="container">Hello</div>
    ...

  </div>
</template>

<style>
#wrap {
  width: 90%;
  height: 480px;
  margin: 0 auto;
  border: 2px solid black;
  background: wheat;
}
</style>

특별한 의미가 있는 것은 아니고, 특별한 아이디로 웹 문서 전체를 감싸면 웹 문서의 내용이나 배경, 가운데 정렬 등 전반적인 속성을 쉽게 변경할 수 있기 때문입니다.

CSS - Responsible Web - Media Query

|

Media Query

편의상 Vue로 개발한 예제입니다.

App.vue

화면에 보이는 상자는 화면 크기의 90%만큼 동적으로 변하는 반응성 상자입니다.

<template>
  <div id="head">SnowDeer's Example</div>
  <div>Hello. SnowDeer</div>
</template>

<script>
export default {
  name: "App",
};
</script>

<style>
#head {
  width: 90%;
  height: 500px;
  margin: 0 auto;
  background: yellowgreen;
  border: 4px solid black;
  text-align: center;
}

@media all and (min-width: 500px) {
  body {
    background: teal;
  }
}

@media all and (min-width: 800px) {
  body {
    background: orange;
  }
}
</style>

실행 화면

웹 브라우저가 500px 이상이면 배경이 teal 색상으로 변경됩니다.

Image

웹 브라우저가 800px 이상이면 배경이 orange 색상으로 변경됩니다.

Image


Media Query 문법

Media Query 문법은 다음과 같습니다.

@media [only 또는 not] [미디어 유형] [and 또는 ,] (조건문) {실행문}

Vue.js 3.0 기본 레이아웃 - (2) AppBar 레이아웃

|

AppBar 레이아웃

<template>
  <div id="wrapper">
    <div id="drawer"></div>
    <div id="main">
      <div id="appbar">
        <div id="hamburg-menu" class="h-center v-center">
          <i class="bi bi-list"></i>
        </div>
        <div id="title" class="v-center">AppBar Title</div>
        <div id="action-items">
          <i class="action-item bi bi-heart"></i>
          <i class="action-item bi bi-three-dots-vertical"></i>
        </div>
      </div>
      <div id="content"></div>
    </div>
  </div>
</template>

<style>
.h-center {
  display: flex;
  flex-direction: row;
  justify-content: center;
}

.v-center {
  display: flex;
  flex-direction: row;
  align-items: center;
}

#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#wrapper {
  display: -webkit-flex;
  display: flex;
  flex-flow: row wrap;
  justify-content: flex-start;
  width: 100vw;
  height: 100vh;
  margin: 0 auto;
}

#appbar {
  display: flex;
  flex-direction: row;
  height: 48px;
  background: #edb1f1;
}

#hamburg-menu {
  width: 48px;
  height: 48px;
  background: #d59bf6;
  cursor: pointer;
}

#title {
  flex: 1;
  height: 48px;
}

#action-items {
  display: flex;
  flex-direction: row;
  height: 48px;
  background: #d59bf6;
}

.action-item {
  width: 48px;
  height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

#drawer {
  width: 200px;
  height: 100vh;
  background: #5585b5;
}

#main {
  flex: 1;
  flex-flow: column wrap;
  justify-content: flex-start;
  background: #bbe4e9;
}
</style>

image

Vue.js 3.0 기본 레이아웃 - (1) 스켈레톤 레이아웃

|

기본 스켈레톤 레이아웃

<template>
  <div id="wrapper">
    <div id="drawer"></div>
    <div id="main">
      <div id="appbar"></div>
      <div id="content"></div>
    </div>
  </div>
</template>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#wrapper {
  display: -webkit-flex;
  display: flex;
  flex-flow: row wrap;
  justify-content: flex-start;
  width: 100vw;
  height: 100vh;
  margin: 0 auto;
}

#drawer {
  width: 200px;
  height: 100vh;
  background: #5585b5;
}

#main {
  flex: 1;
  flex-flow: column wrap;
  justify-content: flex-start;
  background: #bbe4e9;
}

#appbar {
  height: 48px;
  background: #53a8b6;
}
</style>

image