Question

Override the font family and other Css styles in form

  • 20 October 2020
  • 2 replies
  • 51 views

Badge +1

How can we override the theme styles to change the font family ,size and other styles for all k2 controls in the form. Please advise.


2 replies

Userlevel 2
Badge +5

Hi @velraj,

 

Here are a couple of links that hopefully has exactly what you are looking for:

https://help.k2.com/onlinehelp/k2five/devref/current/default.htm#Themes/Custom-Themes.htm

https://help.k2.com/onlinehelp/k2five/DevRef/5.3/default.htm#Controls/Add-Custom-CSS.html

Hope these help :)

 

Note: For the first link (using an existing theme), I recommend using the granite theme if Grey Void does not work (I believe it also has a seperate CSS file)

 

Kind Regards 

Prineel

Userlevel 1
Badge +4

Hello 

You can achieve this by importing fonts from google or hard-coding values in the [ThemeName].css file you should be able to override the fonts by finding and replacing it as follows.

*{font-family: "Arial", Helvetica, sans-serif !important;}

https://fonts.google.com/

I would recommend testing/checking the changes to ensure that this applies to all media queries to ensure consistency across media devices such as phones, tablets, desktop and caters for all resolutions so that it scales. 

As mentioned, this should be a custom theme - and as part of this exercise, ensure that every time you upgrade you maintain the css files between K2 versions as there may be changes that arise. 

https://help.k2.com/onlinehelp/k2five/devref/current/default.htm#Themes/Custom-Themes.htm

https://help.k2.com/onlinehelp/k2five/DevRef/5.3/default.htm#Controls/Add-Custom-CSS.html

Reply