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] Improve styling solution #7461

Merged
merged 1 commit into from
Jul 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ tmp
# OS files
.DS_STORE

# Screenshors generated for Argos-CI
test/regressions/screenshots/

# npm files
node_modules
package-lock.json
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Please note that `@next` will only point to pre-releases; to get the latest stab
### Roboto Font

Material-UI was designed with the [Roboto](http://www.google.com/fonts/specimen/Roboto)
font in mind. So be sure to follow [those instructions](https://github.com/callemall/material-ui/blob/next/docs/src/pages/style/typography.md#general).
font in mind. So be sure to follow [those instructions](https://github.com/callemall/material-ui/blob/v1-alpha/docs/src/pages/style/typography.md#general).

### Packaging for use with separate React

Expand Down
40 changes: 9 additions & 31 deletions docs/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,33 @@
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import MuiThemeProvider, { MUI_SHEET_ORDER } from 'material-ui/styles/MuiThemeProvider';
import { createMuiTheme } from 'material-ui/styles';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import createMuiTheme from 'material-ui/styles/theme';
import createPalette from 'material-ui/styles/palette';
import blue from 'material-ui/colors/blue';
import pink from 'material-ui/colors/pink';
import { lightTheme, darkTheme, setPrismTheme } from 'docs/src/utils/prism';
import AppRouter from 'docs/src/components/AppRouter';

let styleManager;

function App(props) {
const { dark } = props;

const palette = createPalette({
primary: blue,
accent: pink,
type: dark ? 'dark' : 'light',
const theme = createMuiTheme({
palette: createPalette({
primary: blue,
accent: pink,
type: dark ? 'dark' : 'light',
}),
});

const theme = createMuiTheme({ palette });

if (!styleManager) {
const themeContext = MuiThemeProvider.createDefaultContext({ theme });
styleManager = themeContext.styleManager;
} else {
styleManager.updateTheme(theme);
}

styleManager.setSheetOrder(
MUI_SHEET_ORDER.concat([
'Link',
'AppContent',
'AppDrawer',
'AppDrawerNavItem',
'AppFrame',
'MarkdownDocs',
'MarkdownElement',
'Demo',
]),
);

if (dark) {
setPrismTheme(darkTheme);
} else {
setPrismTheme(lightTheme);
}

return (
<MuiThemeProvider theme={theme} styleManager={styleManager}>
<MuiThemeProvider theme={theme}>
<AppRouter />
</MuiThemeProvider>
);
Expand Down
3 changes: 1 addition & 2 deletions docs/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ const docs = (state = { dark: false }, action) => {
return state;
};

export const store = createStore(docs);

const store = createStore(docs);
const rootEl = document.querySelector('#app');

render(
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/AppBar/AppBar.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This property accepts the following keys:
- `colorPrimary`
- `colorAccent`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Avatar/Avatar.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This property accepts the following keys:
- `colorDefault`
- `img`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Badge/Badge.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This property accepts the following keys:
- `colorPrimary`
- `colorAccent`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can overrides all the class names injected by Material-UI thanks to the `cla
This property accepts the following keys:
- `root`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This property accepts the following keys:
- `hiddenLabel`
- `icon`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Button/Button.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This property accepts the following keys:
- `disabled`
- `fab`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Card/Card.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You can overrides all the class names injected by Material-UI thanks to the `cla
This property accepts the following keys:
- `root`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Card/CardActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This property accepts the following keys:
- `root`
- `actionSpacing`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Card/CardContent.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You can overrides all the class names injected by Material-UI thanks to the `cla
This property accepts the following keys:
- `root`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Card/CardHeader.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This property accepts the following keys:
- `avatar`
- `content`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Card/CardMedia.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You can overrides all the class names injected by Material-UI thanks to the `cla
This property accepts the following keys:
- `root`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Checkbox/Checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This property accepts the following keys:
- `checked`
- `disabled`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Chip/Chip.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This property accepts the following keys:
- `label`
- `deleteIcon`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Dialog/Dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ This property accepts the following keys:
- `paperWidthMd`
- `fullScreen`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Dialog/DialogActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This property accepts the following keys:
- `action`
- `button`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Dialog/DialogContent.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You can overrides all the class names injected by Material-UI thanks to the `cla
This property accepts the following keys:
- `root`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Dialog/DialogContentText.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You can overrides all the class names injected by Material-UI thanks to the `cla
This property accepts the following keys:
- `root`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Dialog/DialogTitle.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You can overrides all the class names injected by Material-UI thanks to the `cla
This property accepts the following keys:
- `root`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Divider/Divider.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This property accepts the following keys:
- `light`
- `absolute`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Drawer/Drawer.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ This property accepts the following keys:
- `docked`
- `modal`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Form/FormControl.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This property accepts the following keys:
- `marginDense`
- `fullWidth`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Form/FormControlLabel.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This property accepts the following keys:
- `hasLabel`
- `label`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Form/FormGroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This property accepts the following keys:
- `root`
- `row`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Form/FormHelperText.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This property accepts the following keys:
- `error`
- `disabled`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Form/FormLabel.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This property accepts the following keys:
- `error`
- `disabled`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Grid/Grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ This property accepts the following keys:
- `@media (min-width:1280px)`
- `@media (min-width:1920px)`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Icon/Icon.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This property accepts the following keys:
- `colorError`
- `colorPrimary`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/IconButton/IconButton.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This property accepts the following keys:
- `icon`
- `keyboardFocused`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Input/Input.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ This property accepts the following keys:
- `inputMultiline`
- `fullWidth`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Input/InputLabel.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This property accepts the following keys:
- `animated`
- `disabled`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/Input/Textarea.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This property accepts the following keys:
- `textarea`
- `shadow`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/List/List.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This property accepts the following keys:
- `dense`
- `subheader`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/List/ListItem.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This property accepts the following keys:
- `gutters`
- `button`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/component-api/List/ListItemAvatar.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This property accepts the following keys:
- `root`
- `icon`

Have a look at [overriding with class names](/customization/overrides#overriding-with-class-names)
Have a look at [overriding with classes](/customization/overrides#overriding-with-classes)
section for more detail.

If using the `overrides` key of the theme as documented
Expand Down
Loading