Skip to content

Refactored overriding inline styles#566

Merged
mmrtnz merged 5 commits intomui:css-in-jsfrom
mmrtnz:css-styles
Apr 24, 2015
Merged

Refactored overriding inline styles#566
mmrtnz merged 5 commits intomui:css-in-jsfrom
mmrtnz:css-styles

Conversation

@mmrtnz
Copy link
Copy Markdown
Contributor

@mmrtnz mmrtnz commented Apr 23, 2015

  • Refactored component inline-style structure.
    • Before components had a get function for each element that had inline-styles. Now, all inline-styles are contained in one function called getStyles(). This change was done to improve readability. Here is an example of what I mean:
// Before
_main: function() {
  return { /* inline styles for main */ };
},

_elementA: function() {
  return { /* inline styles for elementA */ };
},

...


// After
getStyles: function() {
  return {
    root: { /* inline styles for main */ },
    elementA: { /* inline styles for elementA */ },
    ...
  };
}
  • Remade merge functions of StylePropable
  • Created new utility file called Extend

mmrtnz added 5 commits April 20, 2015 10:05
…dded new styling function and tested it with checkbox.
…t style functions into a main style function called getStyles.
…), DropDownMenu (underline was not displaying), and Snackbar (would dismiss immediately after show).
Comment thread src/text-field.jsx
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This may resolve #569 #563.

mmrtnz added a commit that referenced this pull request Apr 24, 2015
Refactored overriding inline styles
@mmrtnz mmrtnz merged commit 1643c16 into mui:css-in-js Apr 24, 2015
@mmrtnz mmrtnz deleted the css-styles branch April 24, 2015 19:51
@zannager zannager added the scope: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5. label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants