【问题标题】:Primefaces customize rowEditor with theme iconPrimefaces 使用主题图标自定义 rowEditor
【发布时间】:2018-02-17 02:38:08
【问题描述】:


我想自定义 p:rowEditor 图标(铅笔等)与任何 Primefaces 主题(如 Sentinel)提供的图标(见此处:[https://www.primefaces.org/eos/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';
}

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

【问题讨论】:

    标签: css jsf primefaces jsf-2 roweditor


    【解决方案1】:

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

    components.css 定义:

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

    要覆盖它,请将 text-indent: 0; 添加到您的 CSS 中以获取 .ui-icon-pencil

    【讨论】:

      猜你喜欢
      • 2016-03-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-22
      • 1970-01-01
      • 2014-01-18
      • 1970-01-01
      • 2016-04-11
      相关资源
      最近更新 更多