Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jiho]Skeleton UI #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

[jiho]Skeleton UI #3

wants to merge 2 commits into from

Conversation

peanudge
Copy link
Collaborator

@peanudge peanudge commented Mar 26, 2023

작업 내용

스켈레톤 UI 가 특별한 CSS 요소라고 하기보다는 컨텐츠가 보여지기 전에 미리 보여주기 위해서 가장 적절한 방법에 대한 고민인 것 같습니다.

활용한 스켈레톤 UI 관련된 CSS는 굉장히 짧습니다. 아래와 같이 skeleton class selector만 컨텐츠 요소들에 적용하면 쉽게 로딩 전 UI에 예상 컨텐츠 크기만큼 무언가 있다는 느낌을 줄 수 있습니다.

.skeleton {
  animation: skeleton-loading 1s linear infinite alternate;
}

.skeleton-text {
  height: 2rem;
  margin: 0.5rem;
  width: auto;
}

.skeleton-text.thick {
  height: 1rem;
}

@keyframes skeleton-loading {
  0% {
    background-color: hsl(200, 20%, 70%);
  }
  100% {
    background-color: hsl(200, 20%, 95%);
  }
}

생각보다 큰 수고없이 적용할 수 있을 것 같습니다. CSS 영역은 생각보다 간단히 해결할 수 있는 부분이 아닌가 싶습니다.

결과

스크린샷 2023-03-26 오후 11 26 36

@peanudge peanudge self-assigned this Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant