首页 文章

更改离子2中警报控制器的样式和文本修改

提问于
浏览
0

enter image description here

实际上我的警报控制器“ Headers ”太冗长,所以我想调整文本的大小,我添加了Css类,然后尝试通过给它的字体大小来改变SASS中的样式,遗憾的是没有用,按钮文本是大写的 . 所以无论如何要改变文本的字体大小,按钮颜色和大小以及将按钮文本更改为小写?

My typescript file

import { IonicPage,AlertController} from 'ionic-angular';
import { Component,ViewChild } from '@angular/core';
import 'rxjs/add/operator/toPromise';

@IonicPage()
@Component({
  selector: 'page-kpi',
  templateUrl: 'kpi.html',
})
export class KpiPage {

  @ViewChild(Nav) nav: Nav;
  temp2:any;
  lastUpdate:any;

 constructor(
    private alertCtrl: AlertController,
    public menuCtrl : MenuController,


   ) {
      this.platform.ready().then(() => {

              this.refreshbutton();

      }
    });


refreshbutton(){

    this.getSession();

  if(this.offline == true)
    {
       this.offlineRefreshAlert();
    }  
   else{
    let alert = this.alertCtrl.create({
            title: 'Do you really want to refresh the widgets?',
            message: 'Refresh process will take time to complete.',
            cssClass: 'alertLogCss',
            buttons: [
              {
                text: 'Cancel',
                role: 'cancel',
                handler: () => {
                  alert = null;
                }
              },
              {
                text: 'Refresh now',
                 handler: () => {
                   if(this.online == true){
                      this.refreshdata(this.result.sid);
                      this.loadingrefreshdashboard();
                   }
                   if(this.offline == true){

                      this.offlineRefreshAlert();
                   }



                 }
               }
            ]
          });
          alert.present();
        }
    }

}

我的SASS(CSS)文件

.alertLogCss{
  background-color: white;
  color: red;
  font-size: 4px;
  button{
      color: red;
      font-size: 5px;
  }
}

1 回答

  • 1

    你必须从那个页面scss块中添加css

    .alertLogCss{
        background-color: white;
        color: red;
        font-size: 4px;
        button{
            color: red !important;
            font-size: 10px;
            text-transform: lowercase !important;
        }
      }
    

    放入app.scss

相关问题