-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Theming] Add TYPOGRAPHY_CONSTANTS #520
Conversation
|
||
export const primaryTheme = { | ||
__type: 'primary', | ||
BOX_SHADOW: {}, | ||
COLORS: PRIMARY_COLORS, | ||
FONTS: PRIMARY_FONTS, | ||
TYPOGRAPHY: PRIMARY_TYPOGRAPHY, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went with just TYPOGRAPHY
instead of TYPOGRAPHY_CONSTANTS
since we're accessing it off the theme
now, so it is more obvious they are constants: there's no need to distinguish between TYPOGRAPHY
and TYPOGRAPHY_CONSTANTS
since they're not being imported from the same place like we currently do.
@@ -1,9 +1,11 @@ | |||
import PRIMARY_COLORS from '../colors/primary'; | |||
import PRIMARY_FONTS from '../fonts/primary'; | |||
import { PRIMARY_TYPOGRAPHY } from '../typography/primaryTypography'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I think named exports are preferable
@@ -0,0 +1,19 @@ | |||
// TODO: Update when values are finalized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping the values the same for now, rather than do empty strings like we are for Colors.
@@ -0,0 +1,18 @@ | |||
const fontSize = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These values are duplicated from src/constants/typography/index
because I don't think we should be wrapping them in throwOnUndefinedProperty
. The value-add is less certain the more we have converted over to TS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
What & Why
compareObjectsKeysLength
helper to include support for nested objects, along with error messages for why the test failed:- Objects of different lengths:
- Objects of same length with non-matching keys:
primaryTheme
andsecondaryTheme
having the same keys