- flex-basis, flex-grow๋ก ์ฝ๊ฒ ๋น์จ์ ๋๋๊ธฐ
- align-items: stretch ๊ฐ ๊ธฐ๋ณธ๊ฐ ์์ ์๊ธฐ
- ์ปจํ ์ด๋ ๋ด๋ถ์ ์์ดํ ๋ค์ด cross axis ์ถ ๋ฐฉํฅ์ผ๋ก ๊ธธ์ด / ๋๋น๊ฐ ๊ฐ์์ง์ ์ดํด
- align-self ์์ฑ์ผ๋ก ์์ดํ ๊ฐ๋ณ์ ์ผ๋ก cross axis ์ถ์ ์ ๋ ฌ์ ๊ฒฐ์ ํ ์ ์์
- flex์ margin: auto ์์ฑ์ผ๋ก space-between๊ณผ ๊ฐ์ ํจ๊ณผ๋ฅผ ์ป๊ธฐ
- ๋์์ธ ์ฌ์ฌ์ฉ์ฑ์ ๋์ฌ์ฃผ๋ ์์ฑ๋ค..
inherit, currentColor, transparent
- flex-wrap, flex-basis ์์ฑ์ผ๋ก n-column layout ๋ง๋ค๊ธฐ
- box-sizing: content-box๋ border ๋๋ฌธ์ ๋ด๋ถ ํฌ๊ธฐ๊ฐ ์ค์ด๋๋ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ค.
- SVG ํ์ผ์ ์ฌ์ฉํ๊ธฐ
- sprite.svg ํ๋์ ์ด๋ฏธ์ง๋ก ์ฌ๋ฌ ์์ด์ฝ์ ์ฌ์ฉํ ์ ์๋ค.
- fill: var(--color-grey-dark-3); ๋ก ์์์ ๋ณ๊ฒฝํ ์ ์๋ค
- background-image๋ก svgํ์ผ์ ๊ฐ์ ธ์ค๋ ๋ฐฉ์๊ณผ mask ํ๋กํผํฐ ์ฌ์ฉํ๊ธฐ
- flex box ์ ๋ฐ์ํ
- side by side ๋ฐฐ์น๋ฅผ ์ ์๋๋ก
- wrap์ผ๋ก ๋จ์ด๋จ๋ฆฌ๊ธฐ๋ ํ๋ค.
- ๋ฐ๋๋ก side by side ๋ฅผ ์ ์ฉํ๊ณ ๋ด๋ถ ์์ดํ ์ ๊ท ๋ฑํ ํฌ๊ธฐ๋ฅผ ๊ฐ๋๋ก ํ ์ ์๋ค.
.sidebar {
flex: 0 0 18%; /* 18% */
}
.hotel-view {
flex: 1; /* 82% */
}
๐ align-self ์์ฑ์ผ๋ก ์์ดํ ๊ฐ๋ณ์ ์ผ๋ก cross axis ์ถ์ ์ ๋ ฌ์ ๊ฒฐ์ ํ ์ ์์
.user-nav {
display: flex; /* flex ์ปจํ
์ด๋์ด์ */
align-items: center; /*(์์ดํ
๋ค์ ์์ง ๊ฐ์ด๋ฐ ์ ๋ ฌํจ)*/
align-self: stretch; /* flex ์์ดํ
์ด๋ค.(์์ ์ ๋๋ฆฌ๊ณ )*/
๐ align-items: stretch ๊ฐ ๊ธฐ๋ณธ๊ฐ ์์ ์๊ธฐ;๐ flex์ margin: auto ์์ฑ์ผ๋ก space-between๊ณผ ๊ฐ์ ํจ๊ณผ๋ฅผ ์ป๊ธฐ
&__stars {
/*MEMO: flex: 1์ ํ๋ฉด ์์์ ํฌ๊ธฐ๊ฐ ๋์ด๋๊ธฐ ๋๋ฌธ์, hover ์ด๋ฒคํธ ์ ์ ์ฉ ์์ญ์ด ๋๋ฌด ์ปค์ง๋ค.*/
/* flex: 1 ;*/
/* MEMO: ์์ ์์์ ๊ฑฐ๋ฆฌ๋ฅผ ์ต๋ํ ๋ฒ๋ฆฌ๊ธฐ ์ํด์ margin: auto๋ฅผ ์ฌ์ฉํ๋ค. ์๋์ผ๋ก ๊ณ์ฐํ์ฌ ์ต๋ํ margin์ ์ฃผ๊ฒ๋จ.*/
margin-right: auto;
/* MEMO: SVG img๋ค์ ๋์ด๋ฅผ ๊ฐ๊ฒ ํด์ฃผ๊ธฐ ์ํด ๋ถ๋ชจ ์์์ flex๋ฅผ ์ ์ฉ์์ผ์ฃผ์๋ค.*/
display: flex;
}
display: flex;
flex-wrap: wrap;
&__item {
flex: 0 0 50%; /* 2-column ์ผ๋ก ๋ฐฐ์น๋๋ค. */
margin-bottom: 0.7rem;
}
@media only screen and (max-width: $bp-medium) {
flex-direction: column;
}
@media only screen and (max-width: $bp-smallest) {
flex-wrap: wrap;
align-content: space-around;
height: 11rem;
}
๐ ๋ฐ๋๋ก side by side ๋ฅผ ์ ์ฉํ๊ณ ๋ด๋ถ ์์ดํ ์ ๊ท ๋ฑํ ํฌ๊ธฐ๋ฅผ ๊ฐ๋๋ก ํ ์ ์๋ค.
.side-nav {
/* ์๋ต */
@media only screen and (max-width: $bp-medium) {
display: flex;
margin: 0;
}
&__item {
position: relative;
&:not(:last-child) {
margin-bottom: 0.5rem;
@media only screen and (max-width: $bp-medium) {
margin: 0;
}
}
@media only screen and (max-width: $bp-medium) {
flex: 1;
}
}
-
id๋ฅผ #์ผ๋ก ๊ตฌ๋ถํ์ฌ ๋ถ๋ฌ์จ๋ค.
<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" > <defs> <symbol id="icon-bookmark" viewBox="0 0 20 20"> <title>bookmark</title> <path class="path1" d="M14 2v17l-4-4-4 4v-17c0-0.553 0.585-1.020 1-1h6c0.689-0.020 1 0.447 1 1z" ></path> </symbol> <symbol id="icon-chevron-down" viewBox="0 0 20 20"> <title>chevron-down</title> <path class="path1" d="M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z" ></path> </symbol> </defs> </svg>
<svg class="user-nav__icon"> <use xlink:href="img/sprite.svg#icon-bookmark"></use> </svg> <svg class="user-nav__icon"> <use xlink:href="img/sprite.svg#icon-chat"></use> </svg>
fill: var( --color-grey-dark-3 ); /* mark up ํ svg ์ด๋ฏธ์ง๋ fill ๋ก ์์์ ๋ณ๊ฒฝํ ์ ์๋ค. */
-
css ์์ background-image๋ก svg ์ฌ์ฉํ๊ธฐ
- background-image๋ก svgํ์ผ์ ๊ฐ์ ธ์ค๋ ๋ฐฉ์(old browser)์ ์์ ๋ณ๊ฒฝ์ด ๋ถ๊ฐ๋ฅํ๋ค -> mask๋ฅผ ์ฌ์ฉํ๋ค.
- mask css image ๋ถ๋ถ๋ง ๋นต๊พธ๋ฝ(newer browser)ํด์ ์์์ ๋ณด์ด๊ฒ ํ๋ค.
@supports ((-webkit-mask-image: url()) or (mask-image: url())) { background-color: var(--color-primary); mask-image: url(../img/chevron-thin-right.svg); -webkit-mask-image: url(../img/chevron-thin-right.svg); mask-size: cover; -webkit-mask-size: cover; }
๐ box-sizing: content-box๋ border ๋๋ฌธ์ ๋ด๋ถ ํฌ๊ธฐ๊ฐ ์ค์ด๋๋ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ค.
border: 3px solid #fff; /* border ๊ฐ ๋๊ป๊ธฐ ๋๋ฌธ์ ๋ด๋ถ ํฌ๊ธฐ๊ฐ ์ค์ด๋ ๋ค.(border-box) */
box-sizing: content-box;
font-size: inherit;
border-bottom: 1px solid currentColor;
background-color: transparent;