MewsSystems / mews-flutter

Flutter and Dart open-source packages maintained by Mews.
59 stars 22 forks source link

optimus: how can i customize theme colors? #594

Open rchavik opened 4 months ago

rchavik commented 4 months ago

I assume it's in figma as described here: https://www.mews.design/latest/resources/tools-and-resources-bRuMkF8t

Is this available for the community to fork?

witwash commented 4 months ago

@rchavik, you can override colors like this, for example. If there is an OptimusTheme in the context the component will use a token from it, if not, it will fall back to the default theme (default OptimusTheme theme, to be precise).

OptimusTheme(
                  lightTheme: OptimusThemeData(
                    brightness: Brightness.light,
                    colors: const OptimusColors(Brightness.light), 
                    tokens: OptimusTokens.light.copyWith( // override with copyWith
                      textStaticInverse: Colors.red,
                      borderAlertInfo: Colors.blue,
                    ),
                  ),
                  child: child,
);
rchavik commented 4 months ago

Hi.. thanks for responding.

Sorry, I wasn't clear in my question. I was referring to file optimus/lib/src/tokens/tokens_dark.dart; as the file comment says this file should not be edited manually; so I was wondering if this is to be edited elsewhere.