community-platform icon indicating copy to clipboard operation
community-platform copied to clipboard

[refactor] Remove direct usage of Theme from "SettingsPage.tsx"

Open thisislawatts opened this issue 1 year ago • 3 comments

Remove the following

// TODO: Remove direct usage of Theme
import { preciousPlasticTheme } from 'oa-themes'
const theme = preciousPlasticTheme.styles

At the moment we are importing the theme object directly and accessing its style properties. We should avoid doing this and instead make use of sx property available on all ThemeUI components to load these values out of the theme definition.

Read more about it here:

The sx prop lets you add any valid CSS to an element, while using values from your theme to keep styles consistent. You can think of the style object that the sx prop accepts as a superset of CSS. https://theme-ui.com/sx-prop

The aim should be for there to be no visual differences. However there may be circumstances where this would introduce better visual consistency across the UI. Feel free to reach out on Discord if you think you have found one of those scenarios.

Here's an example where the same change has been made, although I would call out that this specific file required more work than most 🤗 https://github.com/ONEARMY/community-platform/pull/2282

thisislawatts avatar May 02 '23 18:05 thisislawatts

Hi , Can i work on this ?

yatheeshraju avatar May 29 '23 15:05 yatheeshraju

yes, go for it! :)

davehakkens avatar Jun 01 '23 09:06 davehakkens

Any update here @yatheeshraju ?

AlfonsoGhislieri avatar Jun 22 '23 13:06 AlfonsoGhislieri

This is already solved and should be closed, or am I wrong? I took a look at the master branch and seems it is already done

manacespereira avatar Jul 12 '23 14:07 manacespereira

I agree that this issue has been done and it's on the master branch. I will put has done 👍

balhelhas avatar Aug 08 '23 11:08 balhelhas

Hi @balhelhas! Since this has already been moved to "done", can you close this issue, please?

ajotka avatar Sep 26 '23 12:09 ajotka