justify-items()

justify-items 믹스인

용도

justify-items 속성을 빠르고 효율적으로 처리할 때 사용하는 믹스인입니다.

사용법

justify-items() 믹스인에 정렬 키워드를 전달합니다.

justify-items($value:string)

.usage {
  @include justify-items(first-baseline);
}

매개변수(parameter)

유형(type)

필수(required)

기본 값(default)

$value

string

✔︎

위 예시 코드는 아래의 CSS로 컴파일 되어 출력됩니다.

.usage {
  justify-items: first baseline;
}

로직

justify-items() 믹스인은 다음의 로직에 의해 작성되었습니다.

@mixin justify-items($value) {
  @if $value == 'auto' {
    justify-items: auto;
  }
  @if $value == 'normal' {
    justify-items: normal;
  }
  @if $value == 'stretch' {
    justify-items: stretch;
  }

  @if $value == 'start' {
    justify-items: start;
  }
  @if $value == 'end' {
    justify-items: end;
  }
  @if $value == 'center' {
    justify-items: center;
  }
  @if $value == 'left' {
    justify-items: left;
  }
  @if $value == 'right' {
    justify-items: right;
  }

  @if $value == 'baseline' {
    justify-items: baseline;
  }
  @if $value == 'first-baseline' {
    justify-items: first baseline;
  }
  @if $value == 'last-baseline' {
    justify-items: last baseline;
  }

  @if $value == 'safe' {
    justify-items: safe center;
  }
  @if $value == 'unsafe' {
    justify-items: unsafe center;
  }

  @if $value == 'inherit' {
    justify-items: inherit;
  }
  @if $value == 'initial' {
    justify-items: initial;
  }
  @if $value == 'unset' {
    justify-items: unset;
  }
}
  1. 전달 받은 인자 값을 분석해 내부적으로 조건 처리

  2. 조건과 일치하는 경우, 코드 출력

참고

믹스인에 사용된 Sass의 빌트인 모듈은 다음과 같습니다.

Last updated