atom-material / atom-material-ui

A dynamic UI theme for Atom that follows Google's Material Design Guidelines
MIT License
817 stars 204 forks source link

Syntax theme allowed to define primary color? #332

Closed zacs closed 7 years ago

zacs commented 7 years ago

More of a question than an issue: is it possible for a syntax theme to be aware of Material UI and to proactively set the primary color so that it matches the syntax theme? Would it be as simple as specifying atom-material-ui.colors.abaseColor specifically in a syntax theme, or would that not be respected by Material UI?

silvestreh commented 7 years ago

I would advice against writing other package's settings. That said, yeah, I believe you can read it with atom.config.get('atom-material-ui.colors.abaseColor').

You'll need to write some JS for that though, because AFAIK you can't get those settings using stylesheets. You can use the fs module to write a LESS stylesheet with AMU's color settings and then use those throughout your syntax theme.

But beware, not everyone uses AMU, so your code should take that into account and fail graciously. And by failing I mean you should provide some default values to work around the case where AMU isn't even installed.