修改RichFaces的默认字体和大小

毕竟是老外的框架,默认的字体大小弄个11px
明显不符合中国国情,不够和谐
不过还好,RichFaces与其他JAVA开源框架一样,提供了很强大的定制功能
只需三步即可修正这个问题

一、复制[color=blue]richfaces-impl.jar/META-INF/skins/DEFAULT.skin.properties[/color]至[color=green]ClassPath[/color]下
并改名为[color=blue]common.skin.properties[/color]

二、修改其中与字体大小相关的设置,将11px改为12px,如下

generalSizeFont=12px
headerSizeFont=12px
tabSizeFont=12
buttonSizeFont=12 (这两个为啥没有px?)

再顺便将默认字体也改下,首选宋体(SimSun),如下

generalFamilyFont=SimSun, Arial, Verdana, sans-serif
headerFamilyFont=SimSun, Arial, Verdana, sans-serif
tabFamilyFont=SimSun, Arial, Verdana, sans-serif
buttonFamilyFont=SimSun, Arial, Verdana, sans-serif


三、web.xml添加一行配置

<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>common</param-value>
</context-param>


启动服务 查看页面 太和谐了... :arrow:

附上最终配置

#Colors
headerBackgroundColor=#D4CFC7
headerGradientColor=#EDEAE6
headerTextColor=#000000
headerWeightFont=bold

generalBackgroundColor=#FFFFFF
generalTextColor=#000000
generalSizeFont=12px
generalFamilyFont=SimSun, Arial, Verdana, sans-serif

controlTextColor=#000000
controlBackgroundColor=#ffffff
additionalBackgroundColor=#F1EEE9

shadowBackgroundColor=#000000
shadowOpacity=1

panelBorderColor=#C4C0B9
subBorderColor=#ffffff

tabBackgroundColor=#E3DED5
tabDisabledTextColor=#B1ADA7

trimColor=#DFDCD5

tipBackgroundColor=\#FAE6B0
tipBorderColor=\#E5973E

selectControlColor=#E79A00

generalLinkColor=#0078D0
hoverLinkColor=#0090FF
visitedLinkColor=#0090FF

# Fonts
headerSizeFont=12px
headerFamilyFont=SimSun, Arial, Verdana, sans-serif

tabSizeFont=12
tabFamilyFont=SimSun, Arial, Verdana, sans-serif

buttonSizeFont=12
buttonFamilyFont=SimSun, Arial, Verdana, sans-serif

tableBackgroundColor=#FFFFFF
tableFooterBackgroundColor=#cccccc
tableSubfooterBackgroundColor=#f1f1f1
tableBorderColor=#C4C0C9
tableBorderWidth=1px

#Calendar colors
calendarWeekBackgroundColor=#F1EEE9

calendarHolidaysBackgroundColor=#FFEBDA
calendarHolidaysTextColor=#FF7800

calendarCurrentBackgroundColor=#FF7800
calendarCurrentTextColor=#FFEBDA

calendarSpecBackgroundColor=#F1EEE9
calendarSpecTextColor=#000000

warningColor=#FFE6E6
warningBackgroundColor=#FF0000

editorBackgroundColor=#F1F1F1
editBackgroundColor=#FEFFDA

#Gradients
gradientType=plain
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值