Browse Source

Bugfix/improve typography for client app and charts (#6833)

* Improve typography for client app and charts

* Update changelog
pull/6834/head^2
Kenrick Tandrian 1 week ago
committed by GitHub
parent
commit
4a81658f60
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      CHANGELOG.md
  2. 4
      apps/client/src/app/app.component.ts
  3. 22
      apps/client/src/styles/theme.scss

4
CHANGELOG.md

@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Harmonized the unit styling in the value component - Harmonized the unit styling in the value component
- Upgraded `stripe` from version `20.4.1` to `21.0.1` - Upgraded `stripe` from version `20.4.1` to `21.0.1`
### Fixed
- Resolved an issue where charts and components defaulted to _Roboto_ instead of the preconfigured _Inter_ font family
## 3.1.0 - 2026-04-29 ## 3.1.0 - 2026-04-29
### Added ### Added

4
apps/client/src/app/app.component.ts

@ -28,6 +28,7 @@ import {
RouterOutlet RouterOutlet
} from '@angular/router'; } from '@angular/router';
import { DataSource } from '@prisma/client'; import { DataSource } from '@prisma/client';
import { Chart } from 'chart.js';
import { addIcons } from 'ionicons'; import { addIcons } from 'ionicons';
import { openOutline } from 'ionicons/icons'; import { openOutline } from 'ionicons/icons';
import { DeviceDetectorService } from 'ngx-device-detector'; import { DeviceDetectorService } from 'ngx-device-detector';
@ -255,6 +256,9 @@ export class GfAppComponent implements OnInit {
this.toggleTheme(isDarkTheme); this.toggleTheme(isDarkTheme);
// Default chart styles
Chart.defaults.font.family = getCssVariable('--font-family-sans-serif');
window.matchMedia('(prefers-color-scheme: dark)').addListener((event) => { window.matchMedia('(prefers-color-scheme: dark)').addListener((event) => {
if (!this.user?.settings.colorScheme) { if (!this.user?.settings.colorScheme) {
this.toggleTheme(event.matches); this.toggleTheme(event.matches);

22
apps/client/src/styles/theme.scss

@ -139,20 +139,28 @@ $_tertiary: map.merge(map.get($_palettes, tertiary), $_rest);
@include mat.elevation-classes(); @include mat.elevation-classes();
@include mat.table-density(-1); @include mat.table-density(-1);
// $gf-typography: mat.m2-define-typography-config(); $gf-typography: (
// Font families
brand-family: var(--font-family-sans-serif),
plain-family: var(--font-family-sans-serif),
// Font weights
bold-weight: 700,
medium-weight: 500,
regular-weight: 400
);
.theme-light { .theme-light {
$gf-theme-default: mat.define-theme( $gf-theme-default: mat.define-theme(
( (
color: ( color: (
primary: $_primary, primary: $_primary,
theme-type: light, tertiary: $_tertiary,
tertiary: $_tertiary theme-type: light
), ),
density: ( density: (
scale: -3 scale: -3
), ),
// typography: $gf-typography typography: $gf-typography
) )
); );
@ -229,13 +237,13 @@ $_tertiary: map.merge(map.get($_palettes, tertiary), $_rest);
( (
color: ( color: (
primary: $_primary, primary: $_primary,
theme-type: dark, tertiary: $_tertiary,
tertiary: $_tertiary theme-type: dark
), ),
density: ( density: (
scale: -3 scale: -3
), ),
// typography: $gf-typography typography: $gf-typography
) )
); );

Loading…
Cancel
Save