Primefaces使用主题图标自定义rowEditor

时间:2017-09-08 08:22:05

标签: css jsf primefaces jsf-2 roweditor


我想使用Sentinel等任何Primefaces主题提供的p:rowEditor图标(铅笔等)进行自定义(请参阅此处:[https://www.primefaces.org/eos/sentinel/font-icons.xhtml][1]

我编辑了我的自定义CSS文件,我试图覆盖复制用于Sentinel主题CSS文件的CSS元素的行编辑器类,结果如下:

.ui-datatable table tbody tr td .ui-row-editor .ui-icon-pencil
{
  background: none !important;
  font-family: "fontello";
  font-style: normal;
  font-weight: normal;
  speak: none;

  display: inline-block;
  text-decoration: inherit;
  width: 1em;
  margin-right: .2em;
  text-align: center;
  /* opacity: .8; */

  /* For safety - reset parent styles, that can break glyph codes*/
  font-variant: normal;
  text-transform: none;

  /* fix buttons height, for twitter bootstrap */
  line-height: 1em;

  /* Animation center compensation - margins should be symmetric */
  /* remove if not needed */
  margin-left: .2em;
}

.ui-datatable table tbody tr td .ui-row-editor .ui-icon-pencil:before {
    content: '\e851';
}

没有机会让它发挥作用。我看到一切都是空白也许我需要调整任何位置属性? 有什么建议吗? 谢谢!

1 个答案:

答案 0 :(得分:1)

最有可能的是,text-indent属性是不显示内容的原因。

components.css定义:

.ui-icon{
    text-indent: -99999px;
}

要覆盖它,请将text-indent: 0;添加到.ui-icon-pencil的css中。

相关问题