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

Sb/add theme basics #725

Draft
wants to merge 1 commit into
base: wk/20231120-try-mui-joy
Choose a base branch
from
Draft

Conversation

shadoath
Copy link
Contributor

Initial code for expanding a theme.

@shadoath shadoath changed the base branch from main to wk/20231120-try-mui-joy November 28, 2023 16:38
@shadoath
Copy link
Contributor Author

@WilliamKelley, what are your thoughts on adding the theme so far? Right direction?

Copy link
Contributor

@WilliamKelley WilliamKelley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WilliamKelley, what are your thoughts on adding the theme so far? Right direction?

I'm not sure, what is "correct" to do to the theme depends on (1) how the configurated values affect components and (2) the structure and properties of the theme that is available to consumers.

Consumers should expect theme object that matches or is compatible with all our design system's properties. Knowing the best way to achieve that while customizing components requires that you have a component developed with our desired Props API and Styles. That's why I'm suggesting you do this only in tandem with a Button.

Comment on lines +13 to +16
brand: {
blue: string;
lightBlue: string;
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this not have to be brand: PaletteRange? That's what the docs would suggest. Can you link in your PR description to whatever you're following? That's the only what i can judge correct-ness.

Copy link
Contributor

@WilliamKelley WilliamKelley Nov 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this seems like it would expose color="brand" as an option for color-enabled components. But "brand" is not a valid color for us and is not our desired API. So this would be a wrong way to get these values (blue, light blue) in the theme

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried PalletteRange and got the following error when I tried to set a value to blue:

Type '{ blue: string; lightBlue: string; }' is not assignable to type '{ 50?: string | undefined; 100?: string | undefined; 200?: string | undefined; 300?: string | undefined; 400?: string | undefined; 500?: string | undefined; 600?: string | undefined; 700?: string | undefined; ... 27 more ...; solidDisabledBg?: string | undefined; }

Which is why I went with being specific to each one.

},
},
fontFamily: {
body: '"Poppins", sans-serif',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Poppins is only used for headings. Normal body text is Inter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I was putting something there as a placeholder. Where is all of the body/h1 => font documented?
I looked here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no defined mapping because there shouldn't be. See my comment in Figma on yours. Variants and the underlying html tag (component) are rightfully independent.

@WilliamKelley
Copy link
Contributor

Something more basic might be Typography, if you just want to tackle that first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants