Skip to content

V0.12 theming documentation#1716

Merged
shaurya947 merged 8 commits intomui:masterfrom
shaurya947:v0.12-theming-documentation
Sep 24, 2015
Merged

V0.12 theming documentation#1716
shaurya947 merged 8 commits intomui:masterfrom
shaurya947:v0.12-theming-documentation

Conversation

@shaurya947
Copy link
Contributor

Breaking Changes:

Shaurya Arora and others added 7 commits September 24, 2015 13:51
Raw Theme is made up of spacing, palette, and font family, whereas MUI theme is made of key:value pairs, each of which represents the styling of a material-ui component based on the given raw theme. In addition, the MUI theme also contains a reference to the raw theme from which it was produced.

In every material-ui component, the "state" is used for the theme, and theme is passed down using context. Within the component, theme is always accessed using state. When a component is first mounted, we check whether a theme object is passed down using context in the getInitialState() method. If one is not found, we initialize a default MUI theme based on the default (light) raw theme. Moreover, to listen for updates when the parent changes the theme, the new context is always checked in componentWillReceiveProps().

Now, the ThemeManager module simply contains functions that return new MUI theme objects (support for immutability). The theme itself (raw theme) is a plain JS object containing key:value pairs for spacing, palette, and font family. Users can easily define their own raw themes and require() them in their modules.
Completed updates to getting started section. Themes page is a work in progress.
Copy link
Member

Choose a reason for hiding this comment

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

For a lot of properties, you can omit the unit. Here for instance 24.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for noticing that! I know that some properties do need the unit, so I'll hold off on that for now, and take my time to clean things up a little in the future ;)

Copy link
Member

Choose a reason for hiding this comment

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

src/icon-button.jsx had double definitions of some functions due to human error in previous commit.
shaurya947 added a commit that referenced this pull request Sep 24, 2015
@shaurya947 shaurya947 merged commit ebc4c50 into mui:master Sep 24, 2015
@shaurya947 shaurya947 deleted the v0.12-theming-documentation branch September 24, 2015 20:30
@zannager zannager added the customization: theme Higher level theming customizability. label Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

customization: theme Higher level theming customizability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants