GithubHelp home page GithubHelp logo

alex996 / react-css-spinners Goto Github PK

View Code? Open in Web Editor NEW
59.0 59.0 21.0 14.72 MB

CSS-only spinners for React

Home Page: https://alex996.github.io/react-css-spinners

License: MIT License

JavaScript 6.80% CSS 31.14% TypeScript 62.05%

react-css-spinners's People

Contributors

alex996 avatar elagrebiali avatar miguelangeltorresfp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-css-spinners's Issues

Tree shaking and static proprties

Hey @alex996, thanks for putting together this repo. I found your videos on Youtube really helpful. One thing I noticed when trying to implement this approach for building a library is that if you set any static properties on components (such as you would for setting defaultProps or propTypes, those components cannot tree shaken. Are you familiar with any solutions to work around this problem?

e.g.

This one tree shakes fine:

import React from 'react'
import styles from './styles.css'

const Ripple = props => (
  <>
    <style>{styles}</style>
    <div className="lds-ripple">
      <div />
      <div />
    </div>
  </>
)

export default Ripple

However, this one won't:

import React from 'react'
import PropTypes from 'prop-types';
import styles from './styles.css'

const Ripple = props => (
  <>
    <style>{styles}</style>
    <div className="lds-ripple">
      <div />
      <div />
    </div>
  </>
)

Ripple.propTypes = {
  className: PropTypes.string,
}

Ripple.defaultProps = {
  className: "lds-ripple",
};

export default Ripple

[Clarification]: package.json lint-staged

Should your lint-staged configuration in the package.json include .ts extensions?
Here's an example:

...
 "lint-staged": { 
    "*.{ts, js}": [
      "npm run lint:fix",
      "npm run test:staged",
      "git add"
    ]
  },
...

CSS variables forced in style prop

Wouldn't it be better to define the default value of the CSS variables in the CSS file and to not define them via the style prop?
That way, it's easy to modify them in another CSS file (without having to use !important).
If styling props are passed, define them individually via style.

engine requirement unnecessary for libary

Hi,

thanks for this lib. I think you should remove the engine requirement, its not needed in this library and preventing installation with yarn.

error [email protected]: The engine "node" is incompatible with this module. Expected version ">=10". Got "8.15.0"
error Found incompatible module.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.