-
Notifications
You must be signed in to change notification settings - Fork 4
refactor(skeleton): apply vanilla-extract #165
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
Open
jiji-hoon96
wants to merge
10
commits into
release/v1
Choose a base branch
from
refactor/skeleton-vanilla-extract
base: release/v1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f53651b
refactor(skeleton): migrate to Vanilla Extract
jiji-hoon96 9a52892
refactor(skeleton): migrate to Vanilla Extract
jiji-hoon96 bedd8d4
refactor(skeleton): migrate to Vanilla Extract
jiji-hoon96 8e48286
refactor(skeleton): migrate to Vanilla Extract
jiji-hoon96 a737ae2
fix(skeleton): migrate to Vanilla Extract
jiji-hoon96 5896bb1
fix: delete unnecessary package
jiji-hoon96 14acd98
fix: build error
jiji-hoon96 5b06b6f
chore: token dependency to skeleton package
jiji-hoon96 ed04a0f
Merge branch 'release/v1' of https://github.com/sipe-team/side into r…
jiji-hoon96 431267b
Merge branch 'release/v1' of https://github.com/sipe-team/side into r…
jiji-hoon96 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
import { color, radius } from '@sipe-team/tokens'; | ||
import { keyframes, style } from '@vanilla-extract/css'; | ||
import { recipe } from '@vanilla-extract/recipes'; | ||
|
||
//FIXME : background color 바꿔야함. 지금 x-lay 같음... | ||
|
||
const fadeInOut = keyframes({ | ||
'0%': { opacity: 1 }, | ||
'50%': { opacity: 0.8 }, | ||
'100%': { opacity: 1 }, | ||
}); | ||
|
||
export const SkeletonVariant = { | ||
rectangular: 'rectangular', | ||
circle: 'circle', | ||
text: 'text', | ||
rounded: 'rounded', | ||
} as const; | ||
|
||
export type SkeletonVariant = (typeof SkeletonVariant)[keyof typeof SkeletonVariant]; | ||
|
||
const baseSkeletonStyle = style({ | ||
backgroundColor: color.gray200, | ||
backgroundImage: 'none', | ||
backgroundClip: 'border-box', | ||
border: 'none', | ||
boxShadow: 'none', | ||
color: 'transparent', | ||
outline: 'none', | ||
pointerEvents: 'none', | ||
userSelect: 'none', | ||
cursor: 'default', | ||
overflow: 'hidden', | ||
position: 'relative', | ||
|
||
'::before': { | ||
content: '""', | ||
position: 'absolute', | ||
top: 0, | ||
left: 0, | ||
right: 0, | ||
bottom: 0, | ||
background: `linear-gradient(90deg, transparent, ${color.gray200}, transparent)`, | ||
animation: `${fadeInOut} 1.5s ease-in-out infinite`, | ||
}, | ||
}); | ||
|
||
export const skeleton = recipe({ | ||
base: baseSkeletonStyle, | ||
|
||
variants: { | ||
variant: { | ||
[SkeletonVariant.rectangular]: { | ||
borderRadius: radius.sm, | ||
}, | ||
[SkeletonVariant.circle]: { | ||
borderRadius: radius.full, | ||
aspectRatio: '1', | ||
}, | ||
[SkeletonVariant.text]: { | ||
borderRadius: radius.sm, | ||
height: '1em', | ||
width: '100%', | ||
}, | ||
[SkeletonVariant.rounded]: { | ||
borderRadius: radius.md, | ||
}, | ||
}, | ||
|
||
loading: { | ||
true: {}, | ||
false: { | ||
animation: 'none', | ||
backgroundColor: 'transparent', | ||
|
||
'::before': { | ||
display: 'none', | ||
}, | ||
}, | ||
}, | ||
|
||
pulse: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 제가 Pulse 애니메이션 효과를 봤을때는 현재 가운데 Y축을 기준으로 X축으로 gradient를 퍼지는것 같은데 색상때문이지는 모르겠는데 잘 안보여서요. 일반적인 스켈레톤 pulse는 전체 UI색상을 제어하지 않나싶은데.. 어떻게 생각하시나요 ? Reference |
||
true: { | ||
'::before': { | ||
animation: `${fadeInOut} 1.2s ease-in-out infinite`, | ||
}, | ||
}, | ||
false: { | ||
'::before': { | ||
animation: `${fadeInOut} 2s ease-in-out infinite`, | ||
}, | ||
}, | ||
}, | ||
}, | ||
|
||
defaultVariants: { | ||
variant: SkeletonVariant.rectangular, | ||
loading: true, | ||
pulse: false, | ||
}, | ||
}); | ||
|
||
export const shimmer = keyframes({ | ||
'0%': { transform: 'translateX(-100%)' }, | ||
'100%': { transform: 'translateX(100%)' }, | ||
}); | ||
|
||
export const shimmerEffect = style({ | ||
'::before': { | ||
background: `linear-gradient(90deg, transparent, ${color.white}, transparent)`, | ||
animation: `${shimmer} 2s infinite`, | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.