Skip to content

Instantly share code, notes, and snippets.

@js2me
Created November 14, 2019 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save js2me/8c90fe65ffd7f9933a137d245ed94294 to your computer and use it in GitHub Desktop.
Save js2me/8c90fe65ffd7f9933a137d245ed94294 to your computer and use it in GitHub Desktop.
DotLine
export const DotLine = styled.div<{ size: number, count: number, distance: number }>`
background: black;
width: ${({ size }) => `${size}px`};
height: ${({ size }) => `${size}px`};
opacity: 0.65;
border-radius: ${({ size }) => `${size / 2}px`};
box-shadow: ${({ count, distance }) => count === 1 ? 'none' : Array(count-1).fill(1).map((_, i) => `0 ${(i+1) * distance}px`).join(', ')};
margin-top: ${({ distance, size }) => `${distance * -(size + size/2)}px`};
&:not(:last-child) {
margin-right: ${({ size }) => `${size + size / 2}px`};
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment