stylex
stylex copied to clipboard
[Question] Do we have a solution for overriding any properties this with `stylex.createTheme`?
To customize themes, the customer can configure any variables (color, font, size...) in the Settings feature and save it to the local storage and init when app start. Do we have a solution for overriding properties with stylex.createTheme
?
Currently it will throw err if we use fn: theme.stylex.ts: Only static values are allowed inside of a stylex.create() call
const getOverrideColors = () => {
// Get from localStorage or api on app init
return {
//
};
};
const overrideColors = getOverrideColors();
export const darkTheme = stylex.createTheme(colors, {
...colorRepos,
...overrideColors,
});