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

Add optional stylesheet #6

Open
sloria opened this issue Oct 4, 2017 · 3 comments
Open

Add optional stylesheet #6

sloria opened this issue Oct 4, 2017 · 3 comments

Comments

@sloria
Copy link
Contributor

sloria commented Oct 4, 2017

It would be convenient to ship this package with an optional stylesheet for styling a basic skeleton screen.

import { createSkeletonProvider } from 'react-skeletor';
import 'react-skeletor/css/index.css';

export default createSkeletonProvider(
   dummyData,
   (props) => props.loading,
    'react-skeletor',
)(App);
/*  react-skeletor/css/index.css */
@keyframes progress {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}
.react-skeletor {
    animation: progress 1.2s ease-in-out infinite;
    color: rgba(0, 0, 0, 0.0);
    background-color: #eee;
    background-image: linear-gradient(90deg, #eee, #f5f5f5, #eee);
    background-repeat: no-repeat;
    border-radius: 4px;
}
@alex3165
Copy link
Contributor

alex3165 commented Oct 4, 2017

@sloria That's a good idea, we actually thought about it with @jamiecopeland when we first designed this library but we wanted something as lean as possible in the end. After a second thought it would probably make this library way simpler to use which is definitely what we want!

@jamiecopeland any thoughts?

@jamiecopeland
Copy link
Contributor

@sloria Yep, you're totally right, making things as convenient as possible is best and definitely at the top of our priority list, but since everyone has different technical requirements (CSS vs CSS in JS etc) and graphic design styles I think this would be best tackled via documentation and examples. We'll work on extending what's already there with some simple copy-and-pasteable examples which should make it super easy to get started and save adding any unnecessary bulk to the existing code. Thanks for the nudge. Watch this space for updates soon!

@sloria
Copy link
Contributor Author

sloria commented Oct 6, 2017

Sounds like a fine approach to me.

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

No branches or pull requests

3 participants