-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FX-5686] Migrate PageContent to TailwindCSS (#4576)
- Loading branch information
1 parent
9ad1de1
commit ad34150
Showing
3 changed files
with
27 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@toptal/picasso-page': patch | ||
--- | ||
|
||
- migrate `PageContent` to TailwindCSS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,13 @@ | ||
import type { Theme } from '@material-ui/core/styles' | ||
import { createStyles } from '@material-ui/core/styles' | ||
import type { PageContextProps } from '../Page/types' | ||
|
||
export default ({ layout, palette }: Theme) => | ||
createStyles({ | ||
root: { | ||
flex: 1, | ||
width: '100%', | ||
display: 'flex', | ||
justifyContent: 'center', | ||
}, | ||
content: { | ||
height: '100%', | ||
flexGrow: 1, | ||
maxWidth: layout.contentWidth, | ||
backgroundColor: palette.grey.lightest, | ||
backgroundClip: 'content-box', | ||
}, | ||
hasSidebar: { | ||
background: `linear-gradient(90deg, ${palette.grey.lighter} 50%, ${palette.grey.lightest} 50%)`, | ||
}, | ||
wide: { | ||
maxWidth: layout.contentWidthWide, | ||
}, | ||
fullWidth: { | ||
maxWidth: '100%', | ||
}, | ||
flex: { | ||
display: 'flex', | ||
}, | ||
}) | ||
export const getMaxWidthClass = ({ fullWidth, width }: PageContextProps) => { | ||
if (fullWidth || width === 'full') { | ||
return 'max-w-full' | ||
} | ||
|
||
if (width === 'wide') { | ||
return 'max-w-[90em]' | ||
} | ||
|
||
return 'max-w-[75em]' | ||
} |