You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Documentation for including core styles is not clear #1139
I appreciate the theming options out of the box! It seems that none of the prebuilt themes match the CSS styling of the previous release (alpha 8): a shade of green as primary, and a shade of pink as secondary I believe.
Is this an oversight? Because it means that to maintain the previous look, we need to build a custom theme.
I don't even see in the documentation that I have to include the css. I only make it work by searching the web.
Is this correct or did I watch in the wrong place?
simply put this in your index.html header: <link href="@angular/material/core/theming/prebuilt/indigo-pink.css" rel="stylesheet">
If this doesn't work for you try this: <link href="https://unpkg.com/@angular2-material/core/style/core.css" rel="stylesheet"> <link href="https://unpkg.com/@angular/material/core/theming/prebuilt/indigo-pink.css" rel="stylesheet">
I must point out @tommysella comment, I've spent some precious time finding out why the components were not styling correctly, till I included a theme. It doesn't looks like required in the docs.
Reacted by Ross, alvaromorenomorales, alexander taylor and Mila Rodriguez
Activity
artiz commentedon Sep 7, 2016
Workaround for webpack builds:
import 'style!@angular2-material/core/style/core.css';import 'style!@angular2-material/core/overlay/overlay.css';works for me in https://github.com/AngularClass/angular2-webpack-starter
elvirdolic commentedon Sep 27, 2016
In the latest version 2.0.0-alpha.9 this has changed.
instead of including overlay and core.css you have to include now a theme eg.
../node_modules/@angular/material/core/theming/prebuilt/purple-green.css
You have to change also the Module Import and use only MaterialModule instead of single Modules. It works then
RoxKilly commentedon Oct 2, 2016
I appreciate the theming options out of the box! It seems that none of the prebuilt themes match the CSS styling of the previous release (
alpha 8): a shade of green as primary, and a shade of pink as secondary I believe.Is this an oversight? Because it means that to maintain the previous look, we need to build a custom theme.
Tim-Schwalbe commentedon Oct 2, 2016
I don't even see in the documentation that I have to include the css. I only make it work by searching the web.
Is this correct or did I watch in the wrong place?
edited: It's here: https://github.com/angular/material2/blob/master/docs/theming.md
simply put this in your index.html header:
<link href="@angular/material/core/theming/prebuilt/indigo-pink.css" rel="stylesheet">If this doesn't work for you try this:
<link href="https://unpkg.com/@angular2-material/core/style/core.css" rel="stylesheet"><link href="https://unpkg.com/@angular/material/core/theming/prebuilt/indigo-pink.css" rel="stylesheet">tommysella commentedon Oct 3, 2016
Even though it's described in the https://github.com/angular/material2/blob/master/GETTING_STARTED.md, it would be good to make it more clear that it's a requirement, and really need to be included.
alexjoverm commentedon Oct 9, 2016
I must point out @tommysella comment, I've spent some precious time finding out why the components were not styling correctly, till I included a theme. It doesn't looks like required in the docs.
kara commentedon Oct 11, 2016
Closed by #1447.
peterpeterparker commentedon Aug 11, 2017
Ok I just gonna let that here because I had to modify a bit the solution of @artiz and @elvirdolic
First install
style-loaderThen in your module import like following
This tutorial about how to include material might also be useful
https://github.com/AngularClass/angular-starter/wiki/How-to-include-Material
angular-automatic-lock-bot commentedon Sep 6, 2019
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.