Skip to content

Conversation

@carloskelly13
Copy link
Contributor

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.

Screen Shot 2019-09-04 at 12 34 40 PM

document.body.style.color =
themeContext.colors[rest.textColor] ||
rest.textColor ||
themeContext.colors.primary;
Copy link
Contributor Author

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

  1. The theme label
  2. A raw value
  3. The default theme value

ListItem,
UnorderedList,
Text
};
Copy link
Contributor Author

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'
}
};
Copy link
Contributor Author

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

Copy link
Contributor

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?

Copy link
Contributor Author

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.

@rgerstenberger
Copy link

Does theming allow for adding a logo (say Formidable's ;)) somewhere on all slides (say bottom right)?

tertiary: '#1e2852'
},
fonts: {
header: 'Helvetica Neue',

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)({});
Copy link
Contributor

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 ({})?

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 have to do something either ({}) or back-ticks. IMO, a blank object looks less strange.

Copy link
Contributor

@SunburtReynolds SunburtReynolds left a 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.

@carloskelly13 carloskelly13 merged commit 477773b into task/rewrite Sep 9, 2019
@carloskelly13 carloskelly13 deleted the task/rewrite-theming-base branch September 9, 2019 11:09
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.

3 participants