@vertigis/react-ui 14.0.1 → 14.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertigis/react-ui",
3
- "version": "14.0.1",
3
+ "version": "14.1.0",
4
4
  "description": "Utilities and React components used in VertiGIS applications.",
5
5
  "keywords": [
6
6
  "vertigis",
@@ -1040,7 +1040,11 @@ function createTheme(options = {}) {
1040
1040
  // If we are using light mode, then we want to use our defined light theme palette
1041
1041
  const modeOptions = mode === "light" ? lightThemeOverrides : {};
1042
1042
  const { dense = false, ...overrides } = options;
1043
- const defaultTheme = createMuiTheme();
1043
+ // If the incoming options override either the fontSize or htmlFontSize,
1044
+ // these need to be specified when creating the theme so that we end up
1045
+ // with the correct implementation of pxToRem().
1046
+ const { fontSize = 14, htmlFontSize = 16 } = options.typography ?? {};
1047
+ const defaultTheme = createMuiTheme({ typography: { fontSize, htmlFontSize } });
1044
1048
  const mergedOptions = deepAssign({}, getDefaultOptions(defaultTheme.typography.pxToRem), modeOptions, dense ? defaultDenseOptions : {}, overrides);
1045
1049
  const createdTheme = createMuiTheme(mergedOptions);
1046
1050
  return overrideTheme(createdTheme, getOverrides(createdTheme));