Skip to content

Add optional stylesheet #6

@sloria

Description

@sloria

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions