-
Couldn't load subscription status.
- Fork 699
Base Theming #717
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
Base Theming #717
Conversation
| document.body.style.color = | ||
| themeContext.colors[rest.textColor] || | ||
| rest.textColor || | ||
| themeContext.colors.primary; |
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.
We want to set the body color to the theme background and text color to theme text color. We can source the theme from either
- The theme label
- A raw value
- The default theme value
| ListItem, | ||
| UnorderedList, | ||
| Text | ||
| }; |
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.
This unifies all of our exports into a single point.
| textMargin: '16px', | ||
| listMargin: '16px 0' | ||
| } | ||
| }; |
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 are some defaults for our theme's space, colors, and fonts. https://styled-system.com/getting-started
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.
Do you think we should make our theme public/available to the public?
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.
Yes! I plan on creating a helper that lets you use or extend it, which really is Object.assign. But still a helper.
|
Does theming allow for adding a logo (say Formidable's ;)) somewhere on all slides (say bottom right)? |
src/theme/default-theme.js
Outdated
| tertiary: '#1e2852' | ||
| }, | ||
| fonts: { | ||
| header: 'Helvetica Neue', |
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.
Looks like this should include fallback fonts?
| margin: 'textMargin' | ||
| }; | ||
|
|
||
| const Heading = styled(Text)({}); |
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.
Do you have to include ({})?
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.
I have to do something either ({}) or back-ticks. IMO, a blank object looks less strange.
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.
Looks great to me.
This PR adds base theming via Styled System and Styled Components plus a handful of Text components like Header and List.
Each component is a styled component with themed defaults. Meaning the user can either customize it with styled system props
<Text fontSize />or extend it using Styled Components directly.Styled theme props can either take the name of a theme label or a raw value
<Text fontSize="big" />or<Text fontSize="24px" />. This PR has a default theme based on Formidable colors.