shuhei/material-colors

Cannot use dot-notation in javascript

Opened this issue · 1 comments

Using this via javascript (es6)

import { red } from 'material-colors';

const style = {
  color: red['500'] // <-- awkwardness here
};

500 cannot be retrieved via dot-notation (i.e. red.500 is not valid javascript).

I'd like to retrieve the primary color via dot-notation: red.primary. I think it only makes sense for the primary color (as named by google).

What do you think?

I think names like 500 are good enough, but it's also a good idea to add aliases, primary and secondary, because I can imagine many people use only primary and secondary.