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

Document colorManipulator methods #19506

Closed
1 task done
danielo515 opened this issue Feb 1, 2020 · 3 comments
Closed
1 task done

Document colorManipulator methods #19506

danielo515 opened this issue Feb 1, 2020 · 3 comments
Labels
docs Improvements or additions to the documentation

Comments

@danielo515
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

Today I discovered that materialui provides a set of color manipulation helpers under @material-ui/core/styles/colorManipulator.
I searched through the docs and I didn't saw any reference to any of the methods contained there, albeit they areextremelyy useful.

Motivation 🔦

I am pretty sure that there is a lot of people which are using material-ui looking for small libraries for this kind of simple tasks and having this will be very handy.

@oliviertassinari oliviertassinari added duplicate This issue or pull request already exists docs Improvements or additions to the documentation and removed duplicate This issue or pull request already exists labels Feb 1, 2020
@bartlomiejzuber
Copy link

As far as I know, mui says that everything below 2nd level deep is consider as private and you shouldn't use it. Instead I would recommend to use some alternative like:
https://www.npmjs.com/package/color or https://github.com/gka/chroma.js/

ex.

import color from "color";

const backgroundColor = color("rgba(247,248,249,0.5)");
const useStyles = makeStyles((theme: Theme) => ({
  container: {
    backgroundColor: backgroundColor.string()
  },
  dragging: {
    backgroundColor: backgroundColor.darken(0.05).string()
  },
  over: {
    backgroundColor: backgroundColor.darken(0.1).string()
  }
}));

@danielo515
Copy link
Author

That is the thing. Why should I add 16 extra KB to an already big bundle for something that is built into the library that I'm already using?

@mbrookes
Copy link
Member

mbrookes commented Feb 4, 2020

Duplicate of #13039?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

No branches or pull requests

4 participants