Created
June 27, 2019 17:12
-
-
Save kennygoff/a6f18ad4ab7d79f7157dc64d1ebc8f0e to your computer and use it in GitHub Desktop.
Revisions
-
kennygoff created this gist
Jun 27, 2019 .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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ import React from 'react'; import styled from '@emotion/styled'; import { keyframes } from '@emotion/core'; const pulse = props => keyframes` 0% { background-color: ${props.theme.colors.placeholder}; } 70% { background-color: ${props.theme.colors.placeholderAccent}; } 100% { background-color: ${props.theme.colors.placeholder}; } `; const Text = styled.span` &::before { content: "${props => '_'.repeat(props.contentWidth)}"; background-color: ${props => props.theme.colors.placeholder}; color: transparent; border-radius: 3px; animation: ${props => pulse(props)} 4s ease infinite; } `; export default Text;