I just wanna ask how to change these build-in colors in Angular 2 material.
Its specified in the ng2-material docs:
color: "primary"|"accent"|"warn"
How to change colors in these palettes? Or even how to just change that blue color of the text?
I've tried this and it doesn't work.
md-input: {
color: black;
border-color: black
}
The answer given by @Logan H was right, but is outdated.
These are the new links for:
Theming your angular 2 material project Github.
Theming your angular 2 material project Official documentation website.
The steps are the same as @Logan H said in his answer:
.angular-cli.json
src/theme.scss
In the comments is explained where to find the set of colors and options to choose. pallette.scss (\node_modules\@angular\material\core\theming_palette.scss)
UPDATE
In the last version of angular material 2 (Beta 3) some paths have changed, see here.
The breaking changes are:
New path to import pallette or to create your own theme. The path changes in src/theme.scss from @import '~@angular/material/core/theming/all-theme'; to @import '~@angular/material/theming'; The same would happen if you are just importing a pre-built theme, the new path for amber theme is @import '~@angular/material/prebuilt-themes/deeppurple-amber.css';
Since Material 2 Beta 3 depends on Angular 4 (Angular latest version), we need to import in our main module the animation module from BrowserAnimationsModule or NoopAnimationsModule and I quote:
I found this on the Angular2 Material github page
Angular Material Home Page
So assuming you are using
Angular-CLI
Color Pallette - For selecting the colors you want to use and their shades, eg brown = $md-brown then choose a shade like 800.
1.) First Create a
./src/forest-theme.scss
file (Whatever name you want)2.) Next: Add a new entry to the "styles" list in
angular-cli.json
pointing to the theme file (e.g., forest-theme.scss).angular-cli.json
3.) Then in your component you should be able to do something like this
That should do it, any questions this page should answer them
Update
Angular Material has its own web site with plenty of Guides