Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme Overrides should use theme variables #49

Open
joebochill opened this issue Nov 22, 2022 · 0 comments
Open

Theme Overrides should use theme variables #49

joebochill opened this issue Nov 22, 2022 · 0 comments
Labels
brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering enhancement New feature or request
Milestone

Comments

@joebochill
Copy link
Collaborator

Describe the desired behavior

Theme styleOverrides should be built using the theme variable/function instead of hardcoding colors.

Describe the current behavior

The current styleOverrides in the theme use hardcoded colors (e.g., from ThemeColors or BLUIColors variables):

image

This causes problems when trying to do custom themes that 'extend' our base theme (e.g., we want to change the primary color but keep all of the non-color based theme settings like fonts, etc.). Because these colors are hardcoded in the overrides, even if you set the primary color to 'red' (for example), you'll still see a #007BC1 FAB.

Is this request related to a current issue?

This was discovered when working on holiday themes on the doc site.

Additional Context

https://mui.com/material-ui/customization/theme-components/#overrides-based-on-props

For example:

- primary: {
+ primary: ({ ownerState, theme }) => ({
-    backgroundColor: ThemeColors.primary.main,
+    backgroundColor: theme.palette.primary.main,
-    color: WhiteText,
+    color: theme.palette.common.white
     "&:hover": {
-        backgroundColor: BLUIColors.blue[300],
+        backgroundColor: theme.palette.primary.light
     },
- }
+ })
@joebochill joebochill added enhancement New feature or request needs-review Issues that we would like to revisit/review labels Nov 22, 2022
@daileytj daileytj added this to the 7.2.0 milestone Nov 30, 2022
@jeffvg jeffvg removed the needs-review Issues that we would like to revisit/review label Dec 8, 2022
@joebochill joebochill added the brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering label Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering enhancement New feature or request
Development

No branches or pull requests

3 participants