components icon indicating copy to clipboard operation
components copied to clipboard

color="primary" not working

Open moneychaudhary opened this issue 9 years ago • 12 comments

<md-toolbar color="primary"> Home </md-toolbar>

shows white color as background index.html `<!doctype html>

MeanStarter Loading the Angular Material App... `

moneychaudhary avatar Jul 05 '17 14:07 moneychaudhary

Please provide a reproduction plunker or follow the issue template

willshowell avatar Jul 05 '17 14:07 willshowell

may i provide you the link github repo

moneychaudhary avatar Jul 05 '17 14:07 moneychaudhary

If it's a troubleshooting issue, post it on Stack Overflow (link back here and I'll take a look).

If you think it's a bug, sure, but please make sure the github repo is as simplified as possible while still showing the bug.

willshowell avatar Jul 05 '17 14:07 willshowell

template url : https://github.com/moneychaudhary/Mean-Starter/blob/master/src/app/templates/app.component.html index file url : https://github.com/moneychaudhary/Mean-Starter/blob/master/src/index.html Please check this out i have tried a lot, material is working but color of themes is not working.

moneychaudhary avatar Jul 05 '17 14:07 moneychaudhary

As you can see in the console, the prebuilt theme you're linking to isn't being found.

screen shot 2017-07-05 at 10 34 30 am

This or this should help you.

willshowell avatar Jul 05 '17 14:07 willshowell

I feel like I've seen this come up a lot recently, so perhaps the docs should be updated if the suggested solution of linking in index.html doesn't work out of the box with the cli.

willshowell avatar Jul 05 '17 14:07 willshowell

Just cloned your repository and served the application.

The toolbar doesn't show up in primary color because the theme could not be loaded properly.

You included the theme in the index.html file but Webpack is not able to include this theme in your bundle.

Just add your theme to the .angular-cli.json file under the styles section.

Edit: Just saw @willshowell's response. 👍

devversion avatar Jul 05 '17 14:07 devversion

it works! Thanks

moneychaudhary avatar Jul 05 '17 15:07 moneychaudhary

Hello, i have the same issue in this repo here. https://github.com/oddskill/angularmaterial2template I added the template via webpack and in the index.html but no color is shown. Any ideas ?

chiller2020 avatar Aug 21 '17 17:08 chiller2020

I'd really like to know what's up with this as well. Imported the indigo-pink theme in my styles.css and there's no console errors, but setting color="primary" on an <md-toolbar> element does nothing at all.

ShawnMercado avatar Sep 25 '17 22:09 ShawnMercado

if you comment out below class in sidenav component.css file. it will work. This is added by default when you setup the sidenav.

/* .sidenav .mat-toolbar { background: inherit; } */

nbangera avatar Oct 27 '18 22:10 nbangera

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.