Skip to content

Commit

Permalink
Merge pull request #21 from minsoftk/develop
Browse files Browse the repository at this point in the history
feat: mixin 함수들 추가 commit
  • Loading branch information
JJongBin authored Nov 15, 2021
2 parents 852eefa + 301c1cf commit 7af04eb
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 23 deletions.
69 changes: 54 additions & 15 deletions src/drawlist.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,15 @@ <h2 class="sr-only">상품 검색</h2>
</form>
</section>

<section class="">
<h2>진행중인 드로우 상품 목록</h2>
<button aria-label="더보기" type="button" class=""><i></i></button>
<ul class="">
<section class="draw">
<h2 class="draw__title">진행중인 드로우 상품 목록</h2>
<button class="draw__button" aria-label="더보기" type="button">더보기 버튼</button>
<ul class="draw__list">
<li>
<a href="#">
<figure>
<figure class="draw__image">
<a class="draw__link" href="#">
<img
class="draw__img"
style="width: 200px"
src="./assets/images/shoes.jpg"
alt="nike shoes"
Expand All @@ -83,46 +84,84 @@ <h2>진행중인 드로우 상품 목록</h2>
<span>덩크 로우 블랙화이트1</span>
<span>10000</span>
</figcaption>
</a>
</figure>
</a>
<div>
<span> 상세 설명 </span>
<span> 지점 </span>
</div>
</li>
<li>
<a href="#">
<figure>
<figure>
<a href="#">
<img
style="width: 200px"
src="./assets/images/shoes.jpg"
alt="nike shoes"
/>
<figcaption>
<span>덩크 로우 블랙화이트1</span>
<span>덩크 로우 블랙화이트2</span>
<span>10000</span>
</figcaption>
</a>
</figure>
</a>
<div>
<span> 상세 설명 </span>
<span> 지점 </span>
</div>
</li>
<li>
<a href="#">
<figure>
<figure>
<a href="#">
<img
style="width: 200px"
src="./assets/images/shoes.jpg"
alt="nike shoes"
/>
<figcaption>
<span>덩크 로우 블랙화이트1</span>
<span>덩크 로우 블랙화이트3</span>
<span>10000</span>
</figcaption>
</a>
</figure>
<div>
<span> 상세 설명 </span>
<span> 지점 </span>
</div>
</li>
<li>
<figure>
<a href="#">
<img
style="width: 200px"
src="./assets/images/shoes.jpg"
alt="nike shoes"
/>
<figcaption>
<span>덩크 로우 블랙화이트4</span>
<span>10000</span>
</figcaption>
</a>
</figure>
<div>
<span> 상세 설명 </span>
<span> 지점 </span>
</div>
</li>
<li>
<figure>
<a href="#">
<img
style="width: 200px"
src="./assets/images/shoes.jpg"
alt="nike shoes"
/>
<figcaption>
<span>덩크 로우 블랙화이트5</span>
<span>10000</span>
</figcaption>
</a>
</figure>
</a>
<div>
<span> 상세 설명 </span>
<span> 지점 </span>
Expand Down
26 changes: 26 additions & 0 deletions src/sass/pages/_draw.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@use './../utils' as *;
.draw {
position: relative;
&__title {
display: inline-block;
width: 100%;
padding: rem(20px) rem(20px) rem(20px) 0;
@include fontSB($size: rem(20px), $bold: 700);
}
&__button {
@include position($right: 0, $top: rem(20px));
}
&__list {
@include flexbox($justify: space-between, $wrap: wrap);
}
@include desktop {
background-color: yellow;
}
@include mobile {
background-color: pink;
}
}

.draw__link__img {
width: 200px;
}
3 changes: 2 additions & 1 deletion src/sass/pages/_index.scss
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@forward './home';
@forward './home';
@forward './draw';
18 changes: 11 additions & 7 deletions src/sass/utils/_flexbox.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
// flexbox

// 플렉스 박스 믹스인 ---------------------------------------------------------------- /
@mixin flexbox($direction: row, $justify: flex-start, $items: stretch, $wrap: nowrap) {
display: flex;
flex-flow: $direction $wrap;
justify-content: $justify;
align-items: $items;
}

@mixin flexbox(
$direction: row,
$justify: center,
$items: center,
$wrap: nowrap
) {
display: flex;
flex-flow: $direction $wrap;
justify-content: $justify;
align-items: $items;
}
74 changes: 74 additions & 0 deletions src/sass/utils/_mixin.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
@use './unit' as *;
@use 'sass:math';

// font-size, font-weight, padding, margin, border, position,test

@mixin fontSB($size: initial, $bold: initial) {
font-size: $size;
font-weight: $bold;
}

@mixin autoMargin($marginX: auto) {
margin-left: $marginX;
margin-right: $marginX;
}

// padding 관련 믹스인
@mixin paddingY($paddingY: 0) {
padding-top: rem($paddingY);
padding-bottom: rem($paddingY);
}
@mixin paddingX($paddingX: 0) {
padding-left: rem($paddingX);
padding-right: rem($paddingX);
}

@mixin marginY($marginY: 0) {
margin-top: rem($marginY);
margin-bottom: rem($marginY);
}

@mixin marginX($marginX: 0) {
margin-left: rem($marginX);
margin-right: rem($marginX);
}

@mixin border($px: 1px, $type: solid, $color: #c8c8c8) {
border: $px $type $color;
}

@mixin position(
$position: absolute,
$top: initial,
$right: initial,
$bottom: initial,
$left: initial
) {
position: $position;
top: $top;
right: $right;
bottom: $bottom;
left: $left;
}

@mixin positionCenterX() {
@include position;
left: 50%;
transform: translateX(-50%);
}

@mixin positionCenterY() {
@include position;
top: 50%;
transform: translateY(-50%);
}

@mixin positionCenter(
$position: absolute,
$top: initial,
$right: initial,
$bottom: initial,
$left: initial
) {
position: $position;
}

0 comments on commit 7af04eb

Please sign in to comment.