首页 > 其他 > 详细

[Angular] Separating Structural Styles From Theme Styles - Making Components Themeable

时间:2017-06-11 10:00:47      阅读:277      评论:0      收藏:0      [点我收藏+]

For the component‘s css file, we can improt two css files:

  • common.css
  • default-theme.css
@import "common.css";
@import "au-fa-input-default-theme.css";

 

In the default theme, it contains all the default theme related style.

:host {
  border-color: lightgrey;
}

:host(.input-focus) {
  border-color: #4D90FE;
  -webkit-box-shadow: 0 0 5px  #4D90FE;
  box-shadow: 0 0 5px  #4D90FE;
}

 

In the common.css, it contains all the common style for different themes:

/*Common for all input fields*/
.icon {
  width:20px;
  text-align: center;
  padding-left: 5px;
  padding-right: 2px;
  border:none;
  vertical-align: middle;
}

:host {
  border-width:1px;
  border-style: solid;
  padding: 1px 0;
  display: inline-block;
}

:host(.input-focus) {
  outline: none;
}

:host /deep/ input {
  border:none ;
  outline: none;
  height: 100%;
  box-sizing: border-box;
}

 

[Angular] Separating Structural Styles From Theme Styles - Making Components Themeable

原文:http://www.cnblogs.com/Answer1215/p/6980888.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!