FontSize over the Components

UI Components for JSF
Post Reply
Driton
Posts: 70
Joined: 20 Jan 2010, 12:12

18 Feb 2010, 21:33

Hi all,

is it possible to set one fontsize over all components, e.g. font=Arial and fontSize 10 in each component?

Reegards Toni

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

18 Feb 2010, 23:59

Toni, can you explain more, maybe with a simple example use case?

Driton
Posts: 70
Joined: 20 Jan 2010, 12:12

19 Feb 2010, 10:08

Hi Cagatay,

sorry you are right.
I'm using very often the DataTable in the application, so that the data are displayed to big (default YUI 13px).
Then I have AccorditionPanel with a title which has also an default Fontsize 13px or 12px I'm not sure now.
I also use <p:panel.. and <p:dialog... which have his own Fontstyle and fontsize.

I found out that when I set on my own content.css font-size: 0.8em -> it takes effect only on some components, like dataTable but not on a panel.
Afgterthat I must add following , to take effect on panel and so on.

Code: Select all

<style type="text/css">
	.pf-panel-bd {
	font-size: 0.8em;
}
</style>
I hoppe that you did understand my explanation?

Now to my question: How and where can I set the Fontstyle and Fontsize which has effect on every Primefaces Component?
Is it possible?

PS: How can I display a DataTable without header? Now the header is showing as a small row on top.

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

19 Feb 2010, 10:48

Hello,

I think, it's not possible in PrimeFaces. Many PrimeFaces components overwrite "default" font-size (set e.g. for body, html) so that you should check it for every component and adjust if nessesary. Cagatay, you have room for improvement :-)

It's possible with RichFaces. There are rude global CSS settings, e.g. for all "headers" (table, panel, ...), etc. And there are fine granular CSS settings with more details.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

Driton
Posts: 70
Joined: 20 Jan 2010, 12:12

19 Feb 2010, 13:19

Hi Oleg,
thanks and yes I know that in RichFaces is it possible, but i didn't find it in PrimeFaces...
I have added in some places my Font-Size but it's very very disgusting to do it in that way. I hate ugly hacks, because nobody else can find it again.
But for disabling the header you have no Idea, or?
Regards Toni

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

19 Feb 2010, 13:39

There is also YUI Fonts plugin you can try;

http://developer.yahoo.com/yui/fonts/

Also for global font sizing why not;

Code: Select all

.yui-skin-sam {
   font-size:10px !important;
}
This should enforce on most of the PrimeFaces component, didn't try this though, just an idea.

Driton
Posts: 70
Joined: 20 Jan 2010, 12:12

19 Feb 2010, 13:59

Ok cagatay I'll test it on my components and let you know about the result.
Thanks a lot and kind regards, Toni

Driton
Posts: 70
Joined: 20 Jan 2010, 12:12

19 Feb 2010, 14:27

no sucess with that. Some of the components have now even smaller size as before!?! I must look into it deeper, whats happening there.
Thanks for your responses.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 53 guests