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

[core] Start simplifying styling API #7730

Merged
merged 1 commit into from
Aug 11, 2017
Merged

[core] Start simplifying styling API #7730

merged 1 commit into from
Aug 11, 2017

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Aug 10, 2017

First step toward #7636.

  • Move the name option from createStyleSheet to withStyles.
  • Move the option argument from createStyleSheet to withStyles.

Now, we should be able to hide createStyleSheet quite easily.

@oliviertassinari oliviertassinari merged commit ce455cc into mui:v1-beta Aug 11, 2017
@oliviertassinari oliviertassinari deleted the style-API-v1 branch August 11, 2017 21:39
sebald pushed a commit to PTW-Freiburg/material-ui that referenced this pull request Aug 15, 2017
* upstream/v1-beta: (24 commits)
  v1.0.0-beta.5
  Update CHANGELOG.md
  [CHANGELOG] Prepare v1.0.0-beta.5
  chore(package): update size-limit to version 0.9.0 (mui#7757)
  [docs] Fix yarn docs:build script (mui#7745)
  [docs] Update the readme
  [Radio] Fix accessibility issue (mui#7742)
  [Tabs][BottomNavigation] Use value over index property (mui#7741)
  [core] Remove createStyleSheet (mui#7740)
  [core] Start simplifying styling API (mui#7730)
  [LinearProgress] Use transform instead width (mui#7732)
  Fix Typo (mui#7736)
  Documentation Fix - Fixing up the README documentation (mui#7733)
  [ButtonBase] Expose internal component (mui#7727)
  [Popover] Refactor popover transition - separation of concerns (mui#7720)
  Button documentation fix (mui#7726)
  Update supported-components.md (mui#7722)
  chore(package): update webpack to version 3.5.3 (mui#7723)
  [flow] flow type transitions Slide, Fade, Collapse (fixes)
  Create CODE_OF_CONDUCT.md
  ...
iquabius added a commit to iquabius/olimat that referenced this pull request Aug 17, 2017
@patrickml
Copy link

patrickml commented Aug 18, 2017

@oliviertassinari with createStyleSheets removed how should we access the theme data?

For example I am currently doing things like this

export default createStyleSheet(theme => ({
  container: {
    borderBottom: `solid 1px ${theme.palette.common.faintBlack}`,
    display: 'flex',
    justifyContent: 'space-between',
    alignContent: 'center',
  }
}));

@oliviertassinari
Copy link
Member Author

Have a look at the diff of #7740.

@molszanski
Copy link

Looked through the diff. Still don't get how to use the theme now in an elegant way. Tips appreciated :)

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Aug 25, 2017

-export default createStyleSheet(theme => ({
+export default theme => ({
  container: {
    borderBottom: `solid 1px ${theme.palette.common.faintBlack}`,
    display: 'flex',
    justifyContent: 'space-between',
    alignContent: 'center',
  }
-}));
+});

@molszanski
Copy link

Much appreciated

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

Successfully merging this pull request may close these issues.

3 participants