Skip to content

Commit

Permalink
feat: Add window config option to inherit or override mono font family (
Browse files Browse the repository at this point in the history
  • Loading branch information
anicholls committed Jan 28, 2021
1 parent 968130a commit d7ec090
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions modules/core/react/lib/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ import {default as colors, typeColors, statusColors} from '@workday/canvas-color
import {borderRadius} from './radius';
import {CSSProperties} from './types';

const inheritFont =
const inheritFont: boolean =
typeof window !== 'undefined' && get(window, 'window.workday.canvas.inheritFontFamily');
const inheritMonoFont: boolean | string =
typeof window !== 'undefined' && get(window, 'window.workday.canvas.inheritMonoFontFamily');

export const fontFamily = inheritFont
? 'inherit'
: '"Roboto", "Helvetica Neue", "Helvetica", Arial, sans-serif';
export const monoFontFamily = '"Roboto Mono", "Courier New", Courier, monospace';
export const monoFontFamily =
inheritMonoFont === true
? 'inherit'
: inheritMonoFont || '"Roboto Mono", "Courier New", Courier, monospace';

export interface CanvasTypeHierarchy {
dataViz1: CSSProperties;
Expand Down

0 comments on commit d7ec090

Please sign in to comment.