ngx-admin icon indicating copy to clipboard operation
ngx-admin copied to clipboard

how can i change Font-Face

Open MHSoleimani opened this issue 5 years ago • 11 comments

**I'm submitting a

  • [x] feature request

Expected behavior: Hi, how can i change Font-Face (CSS) for whole of app ? i use Persian and English character together and i want to use fonts for them.

thanks in advance.

MHSoleimani avatar Mar 06 '19 19:03 MHSoleimani

in /styles/theme.scss we have :

`$nb-themes: nb-register-theme(( // app wise variables for each theme sidebar-header-gap: 2rem, sidebar-header-height: initial, layout-content-width: 1400px,

font-main: Yekan, font-secondary: Yekan,`

when font-main used and when font-secondary used ?

MHSoleimani avatar Mar 06 '19 20:03 MHSoleimani

You can find where font-main and font-secondary used by searching for it in theme mappings file.

yggg avatar Mar 07 '19 08:03 yggg

excellent ! thanks.

MHSoleimani avatar Mar 07 '19 19:03 MHSoleimani

You can find where font-main and font-secondary used by searching for it in theme mappings file.

Do you mean in order to change my app font I have to change it from _default.scss file inside nebular framework?

DanialV avatar Apr 28 '19 17:04 DanialV

@DanialV No, you need to overwrite the default config in your theme,.css or theme.css.

Sample code of how I change it to Roboto using google fonts.

@import url('https://fonts.googleapis.com/css?family=Roboto&display=swap');

$nb-themes: nb-register-theme((
  font-family-primary: unquote('Roboto, sans-serif'),
  font-family-secondary: font-family-primary,

), default, default);

Johnyoat avatar Mar 14 '20 00:03 Johnyoat

@DanialV No, you need to overwrite the default config in your theme,.css or theme.css.

Sample code of how I change it to Roboto using google fonts.

@import url('https://fonts.googleapis.com/css?family=Roboto&display=swap');

$nb-themes: nb-register-theme((
  font-family-primary: unquote('Roboto, sans-serif'),
  font-family-secondary: font-family-primary,

), default, default);

I'm doing that for the corporate theme but it doesn't work. Could you help me? My themes.scss looks like this

@import '~@nebular/theme/styles/theming';
@import '~@nebular/theme/styles/themes/corporate';
@import '~@nebular/theme/styles/themes/default';
@import url('https://fonts.googleapis.com/css?family=Roboto&display=swap');

$nb-themes: nb-register-theme((
  font-family-primary: unquote('Roboto, sans-serif'),
  font-family-secondary: font-family-primary,
),corporate, default);

mcguegi avatar May 21 '20 15:05 mcguegi

@DanialV No, you need to overwrite the default config in your theme,.css or theme.css. Sample code of how I change it to Roboto using google fonts.

@import url('https://fonts.googleapis.com/css?family=Roboto&display=swap');

$nb-themes: nb-register-theme((
  font-family-primary: unquote('Roboto, sans-serif'),
  font-family-secondary: font-family-primary,

), default, default);

I'm doing that for the corporate theme but it doesn't work. Could you help me? My themes.scss looks like this

@import '~@nebular/theme/styles/theming';
@import '~@nebular/theme/styles/themes/corporate';
@import '~@nebular/theme/styles/themes/default';
@import url('https://fonts.googleapis.com/css?family=Roboto&display=swap');

$nb-themes: nb-register-theme((
  font-family-primary: unquote('Roboto, sans-serif'),
  font-family-secondary: font-family-primary,
),corporate, default);

Sure @macaguegi The theme is misconfigured at the nb-register-theme and also you're importing multiple styles which makes it hard for the compiler to override.

Remove the the default style this -> @import '~@nebular/theme/styles/themes/default';

rewrite the nb-register-theme to

... ),defaulft,corporate);

so it should look like

@import '~@nebular/theme/styles/theming';
@import '~@nebular/theme/styles/themes/corporate';
@import url('https://fonts.googleapis.com/css?family=Roboto&display=swap');

$nb-themes: nb-register-theme((
  font-family-primary: unquote('Roboto, sans-serif'),
  font-family-secondary: font-family-primary,
),default, corporate);

Johnyoat avatar May 22 '20 00:05 Johnyoat

Hey @Johnyoat ,thank u! it works. Have a nice day 😃

mcguegi avatar May 23 '20 21:05 mcguegi

Hey @Johnyoat ,thank u! it works. Have a nice day 😃

@macaguegi You're welcome. Good to know. You too!

Johnyoat avatar May 23 '20 21:05 Johnyoat

`@import '~@nebular/theme/styles/theming'; @import '~@nebular/theme/styles/themes/corporate'; @import url('https://fonts.googleapis.com/css?family=Roboto&display=swap');

$nb-themes: nb-register-theme(( font-family-primary: unquote('Roboto, sans-serif'), font-family-secondary: font-family-primary, ),default, corporate);` I have problems doing it, it does not recognize the $

Meruxxx avatar Sep 02 '21 16:09 Meruxxx

anyone know how to use a local font instead of Google fonts, I have a networking issue with the google fonts

amsun10 avatar Jul 23 '23 09:07 amsun10