Skip to content

[core] Start simplifying styling API#7730

Merged
oliviertassinari merged 1 commit into
mui:v1-betafrom
oliviertassinari:style-API-v1
Aug 11, 2017
Merged

[core] Start simplifying styling API#7730
oliviertassinari merged 1 commit into
mui:v1-betafrom
oliviertassinari:style-API-v1

Conversation

@oliviertassinari

@oliviertassinari oliviertassinari commented Aug 10, 2017

Copy link
Copy Markdown
Member

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 added the breaking change Introduces changes that are not backward compatible. label Aug 11, 2017
@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

patrickml commented Aug 18, 2017

Copy link
Copy Markdown

@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
Copy Markdown
Member Author

Have a look at the diff of #7740.

@molszanski

Copy link
Copy Markdown

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

@oliviertassinari

oliviertassinari commented Aug 25, 2017

Copy link
Copy Markdown
Member Author
-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
Copy Markdown

Much appreciated

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

Labels

breaking change Introduces changes that are not backward compatible.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants