@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 +1 -1
- package/styles/createTheme.js +5 -1
package/package.json
CHANGED
package/styles/createTheme.js
CHANGED
|
@@ -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
|
-
|
|
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));
|