угловой материал стол bg цвет

Я успешно закончил создание своей первой таблицы угловых материалов. Я создал источник данных в компоненте и добавил его в таблицу, и таблица отрисовывается правильно. Но таблица отображается черным цветом, а текст - белым цветом, как показано ниже.

введите описание изображения здесь

Но я не добавлял никаких стилей в list.component.css. styles.css, как показано ниже

/* You can add global styles to this file, and also import other style files */
@import "~@angular/material/prebuilt-themes/purple-green.css";
@import 'https://fonts.googleapis.com/icon?family=Material+Icons';
@import "~bootstrap/dist/css/bootstrap.min.css";
@import "~font-awesome/css/font-awesome.css";

body {
  margin: 0;
  font-family: Roboto, sans-serif;
}

Я следил за некоторыми примерами в Интернете, чтобы выполнить, и у них есть белый цвет bg и черный текст. Что я здесь делаю не так. У меня есть вопросы, поскольку я не добавлял никаких стилей, он должен быть черно-белым или использовать тему, которую я настроил в styles.css purple-green.css. Как узнать, какой CSS используется и как остановить или изменить.

Ниже мой html

<h2>Property List</h2>

<mat-table class="lessons-table mat-elevation-z8" [dataSource]="datasource" >

  <!--<ng-container matColumnDef="id">
    <mat-header-cell *matHeaderCellDef> Id </mat-header-cell>
    <mat-cell *matCellDef="let property">
      {{property.id}}
    </mat-cell>
  </ng-container>-->
  <ng-container matColumnDef="erfSize">
    <mat-header-cell *matHeaderCellDef> ERF Size </mat-header-cell>
    <mat-cell *matCellDef="let property">
      <a [routerLink]="['/property-edit', property.id]">{{property.erfSize}}</a>
    </mat-cell>
  </ng-container>
  <ng-container matColumnDef="area">
    <mat-header-cell *matHeaderCellDef> Area </mat-header-cell>
    <mat-cell *matCellDef="let property"> {{property.area}} </mat-cell>
  </ng-container>
  <ng-container matColumnDef="buildingGLA">
    <mat-header-cell *matHeaderCellDef> Building GLA </mat-header-cell>
    <mat-cell *matCellDef="let property"> {{property.buildingGLA}} </mat-cell>
  </ng-container>
  <ng-container matColumnDef="buildingGBA">
    <mat-header-cell *matHeaderCellDef> Building GBA </mat-header-cell>
    <mat-cell *matCellDef="let property"> {{property.buildingGBA}} </mat-cell>
  </ng-container>
  <ng-container matColumnDef="parkingType">
    <mat-header-cell *matHeaderCellDef> Parking Type </mat-header-cell>
    <mat-cell *matCellDef="let property"> {{property.parkingType}} </mat-cell>
  </ng-container>
  <mat-header-row *matHeaderRowDef="columnsToDisplay"></mat-header-row>
  <mat-row *matRowDef="let row; columns: columnsToDisplay;"></mat-row>

</mat-table>


person nani21984    schedule 15.05.2018    source источник
comment
каждый добавленный CSS может отражать цвет. вы можете попробовать сменить тему и посмотреть. Если вы поместите сюда ссылку на свой html, я могу помочь вам найти, что не так.   -  person iStepashka    schedule 15.05.2018
comment
Спасибо, я обновил свой вопрос с помощью html.   -  person nani21984    schedule 15.05.2018
comment
Кажется, что ваш стол использует темную тему материала, вы настроили темную тему где-нибудь в своем приложении?   -  person Michael Doye    schedule 15.05.2018


Ответы (1)


внутри purple-green.scss есть определение темной темы, что делает ее темной для просмотра внутри файла: $ theme: mat-dark-theme ($ primary, $ accent);

person iStepashka    schedule 15.05.2018
comment
Я изменил предварительно созданную тему на indigo-pink.css, и она больше не темная. Итак, mat-dark-theme была установлена ​​как тема по умолчанию в purple-green.css - person nani21984; 16.05.2018