mozilla / perfcompare

Improved Performance Comparison Tool
Mozilla Public License 2.0
39 stars 93 forks source link

Inject MaterialUI styles first so that typestyle styles can override them #668

Closed julienw closed 4 months ago

julienw commented 4 months ago

It's a small change that makes it possible to override MaterialUI styles with CSS modules (typestyle generates CSS modules). See the documentation for this: https://mui.com/material-ui/integrations/interoperability/#css-modules

From my testing It doesn't seem to change anything at the moment, but I tested locally that this was working (I tried changing the background-color of CompareButton using typestyle for example).

I believe that this issue is why we have so many specific styles in https://github.com/mozilla/perfcompare/blob/beta/src/theme/components.js: because we couldn't override them in components directly or in https://github.com/mozilla/perfcompare/tree/beta/src/styles, we had to inject them there.

I'm still not super happy about the fact we use typestyle and instead we should probably embrace material UI customization mechanism, but this is a good stop gap so that we can move forward more easily in this last sprint.

netlify[bot] commented 4 months ago

Deploy Preview for mozilla-perfcompare ready!

Name Link
Latest commit e20864fffa8a2a30eb82809538bd673540bb1fe2
Latest deploy log https://app.netlify.com/sites/mozilla-perfcompare/deploys/666188a5ea2ec70008e09686
Deploy Preview https://deploy-preview-668--mozilla-perfcompare.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.86%. Comparing base (3a2ba92) to head (0b423c5).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## beta #668 +/- ## ======================================= Coverage 91.86% 91.86% ======================================= Files 70 70 Lines 1573 1573 Branches 275 275 ======================================= Hits 1445 1445 Misses 102 102 Partials 26 26 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.