Angularjs   发布时间:2022-04-20  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了角度材料排版的不透明度大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我可以通过以下方式使用Angular Material的排版样式:

.title {
  @include mat-typography-level-to-styles($typography-config,'caption');
}

.title-with-opacity {
  @include mat-typography-level-to-styles($typography-config,'caption');
  opacity: 0.54;
}

应用时,它看起来像这样

角度材料排版的不透明度

但是,对比度不会@L_674_3@应用于所使用的排版级别.

问:如何在没有单独指定的情况下获得Material Design Specs指定的排版级别的不透明度(对比度)?

解决方法@H_801_19@ @H_197_20@ 我所知道的,

@include mat-typography-level-to-styles($typography-config,'caption');

它将包括认配置的级别标题的排版样式,其中包含

因此,您无法获得对比度,但您可以使用以下自定义配置:

$custom-typography: mat-typography-config(
      $font-family: 'Roboto,monospace',// other default overrides
      $color: mat-color($priMary,lighter-contrast)
    );

//include custom config like this
@include mat-typography-level-to-styles($custom-typography);

其他方式:

.title-with-opacity {
  @include mat-typography-level-to-styles($typography-config,'caption');
  color: mat-color($priMary,lighter-contrast);
}

官方文档不是很好,如果上述方法都不奏效,那么您自己为opacity属性值的方式要好得多.让我知道它是否有效,因为这是未经测试的方法,但上述解决方案基于文档.

大佬总结

以上是大佬教程为你收集整理的角度材料排版的不透明度全部内容,希望文章能够帮你解决角度材料排版的不透明度所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。