material icon indicating copy to clipboard operation
material copied to clipboard

Misleading theme configuration documentation

Open ghost opened this issue 11 years ago • 7 comments

In this page: https://material.angularjs.org/#/Theming/03_configuring_a_theme It says that, to configure theme:

angular.module('myApp', ['ngMaterial'])
.config(function($mdThemingProvider) {
  $mdThemingProvider.theme('default')
    .primaryPalette('pink')
    .accentPalette('orange');
});

But actually, the Theme object is like this: screenshot from 2015-01-26 09 47 02

So actually primaryPalette() should be primaryColor(), accentPalette() should be accentColor(), etc

ghost avatar Jan 26 '15 02:01 ghost

primaryPalette and accentPalette are now the way to go. https://github.com/angular/material/issues/1252

What version of angular-material are you using?

dapids avatar Jan 26 '15 08:01 dapids

0e0846feb562d32079eff427abbc045f2681c24e renamed primaryColor to primaryPalette. At the moment, it's only available in master.

The docs are built from master; you're probably using an older version, which means that the live docs don't match the code you're using.

PaulMougel avatar Jan 26 '15 08:01 PaulMougel

Ah, right. I thought since I use the newly released 0.7.0, it should be no problem.

ghost avatar Jan 26 '15 10:01 ghost

To be fair, this just caught me too. I just updated to 0.7.0, and went to check the docs to see how to use the new theming, and then had to figure this out.

In general, I think having the documentation built from master is misleading. I'd much rather see the documentation match the current latest release, rather then being perpetually out of date.

ethanmick avatar Jan 26 '15 21:01 ethanmick

@Wayfarer247 Documentation versioning is planned, see #918, and should be deployed soon-ish.

PaulMougel avatar Jan 26 '15 22:01 PaulMougel

Thanks @PaulMougel, can't wait to see that!

ethanmick avatar Jan 26 '15 22:01 ethanmick

It looks like the docs are updated now–I'm seeing primaryPalette(). They aren't built off of master at it's latest commit, but rather at the last release (this prevents breaking of the docs on bad builds). From the landing page:

These docs were generated from source in the master branch: at commit v0.7.0 - SHA f592f21 .

There is a version picker coming, as @PaulMougel mentioned (https://github.com/angular/material/issues/918) as well as some infrastructure changes that should always keep us up to date.

marcysutton avatar Jan 26 '15 22:01 marcysutton