Skip to content

Commit

Permalink
refactor direct font reference to string in makeAllStyles
Browse files Browse the repository at this point in the history
  • Loading branch information
eatyourpeas committed Aug 11, 2024
1 parent 7ed361b commit 67de75d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/functions/makeAllStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ This function therefore instantiates defaults where user values have not been pr
This creates a styles object that is passed to the chart.
*/
import { AxisStyle, CentileStyle, SDSStyle, ChartStyle, GridlineStyle, MeasurementStyle } from '../interfaces/StyleObjects';
import montserratRegular from '../fonts/Montserrat/Montserrat-Regular.ttf';

const black = '#000000';
const white = '#FFFFFF';
Expand Down Expand Up @@ -67,7 +66,7 @@ function makeAllStyles(
toolTipMain: {
fontSize: chartStyle?.tooltipTextStyle?.size ?? 14,
fill: chartStyle?.tooltipTextStyle?.colour ?? black,
fontFamily: chartStyle?.tooltipTextStyle?.name ?? montserratRegular,
fontFamily: chartStyle?.tooltipTextStyle?.name ?? 'Montserrat',
fontStyle: chartStyle?.tooltipTextStyle?.style ?? 'normal',
textAnchor: "start"
},
Expand Down Expand Up @@ -187,7 +186,7 @@ function makeAllStyles(
},
centileLabel: {
fontSize: 6,
fontFamily: montserratRegular,
fontFamily: 'Montserrat',
fill: centileStyle?.centileStroke ?? black
},
heightSDS: {
Expand Down Expand Up @@ -259,7 +258,7 @@ function makeAllStyles(
},
eventTextStyle: {
size: measurementStyle?.eventTextStyle?.size ?? 14,
name: measurementStyle?.eventTextStyle?.name ?? montserratRegular,
name: measurementStyle?.eventTextStyle?.name ?? 'Montserrat',
colour: measurementStyle?.eventTextStyle?.colour ?? black,
style: measurementStyle?.eventTextStyle?.style ?? 'normal'
},
Expand Down

0 comments on commit 67de75d

Please sign in to comment.