PrimeFaces使用主题图标自定义roweditor




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

我编辑了自定义CSS文件,并尝试覆盖行编辑器类,将使用CSS元素复制到Sentinel主题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';
}

没有机会使它起作用。我看到所有空白。也许我需要调整任何位置属性?有建议吗?谢谢!

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

components.css定义:

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

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

最新更新