Skip to content
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
1 change: 0 additions & 1 deletion packages/material-ui/src/styles/createMixins.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Spacing } from './createSpacing';
import { CSSProperties } from './withStyles';

export interface Mixins {
gutters: (styles?: CSSProperties) => CSSProperties;
toolbar: CSSProperties;
// ... use interface declaration merging to add custom mixins
}
Expand Down
29 changes: 0 additions & 29 deletions packages/material-ui/src/styles/createMixins.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,5 @@
export default function createMixins(breakpoints, spacing, mixins) {
return {
gutters: (styles = {}) => {
// To deprecate in v4.1
// warning(
// false,
// [
// 'Material-UI: Theme.mixins.gutters() is deprecated.',
// 'You can use the source of the mixin directly:',
// `
// paddingLeft: theme.spacing(2),
// paddingRight: theme.spacing(2),
// [theme.breakpoints.up('sm')]: {
// paddingLeft: theme.spacing(3),
// paddingRight: theme.spacing(3),
// },
// `,
// ].join('\n'),
// );

return {
paddingLeft: spacing(2),
paddingRight: spacing(2),
...styles,
[breakpoints.up('sm')]: {
paddingLeft: spacing(3),
paddingRight: spacing(3),
...styles[breakpoints.up('sm')],
},
};
},
toolbar: {
minHeight: 56,
[`${breakpoints.up('xs')} and (orientation: landscape)`]: {
Expand Down
20 changes: 4 additions & 16 deletions packages/material-ui/src/styles/createMixins.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,12 @@ import createMixins from './createMixins';
import createMuiTheme from './createMuiTheme';

describe('createMixins', () => {
it('should be able to override the breakpoint', () => {
it('should be able add other mixins', () => {
const theme = createMuiTheme();
const mixins = createMixins(theme.breakpoints, theme.spacing, {});
const mixins = createMixins(theme.breakpoints, theme.spacing, { test: { display: 'block' } });

const mixin = mixins.gutters({
display: 'flex',
[theme.breakpoints.up('sm')]: {
paddingLeft: 1,
},
});
expect(mixin).to.deep.equal({
'@media (min-width:600px)': {
paddingLeft: 1,
paddingRight: 24,
},
display: 'flex',
paddingLeft: 16,
paddingRight: 16,
expect(mixins.test).to.deep.equal({
display: 'block',
});
});
});
6 changes: 0 additions & 6 deletions packages/material-ui/src/styles/createMuiTheme.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ describe('createMuiTheme', () => {
expect(muiTheme.transitions.duration.shorter).to.not.equal(undefined);
});

it('should use the defined spacing for the gutters mixin', () => {
const spacing = 100;
const muiTheme = createMuiTheme({ spacing });
expect(muiTheme.mixins.gutters().paddingLeft).to.equal(spacing * 2);
});

describe('shadows', () => {
it('should provide the default array', () => {
const muiTheme = createMuiTheme();
Expand Down