@toptal/picasso-page 5.1.10 → 5.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../src/Page/Page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAGvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAGlE,MAAM,WAAW,KAAM,SAAQ,SAAS,EAAE,cAAc,CAAC,cAAc,CAAC;IACtE,wFAAwF;IACxF,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,iBAAiB,CAAA;IACzB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,yEAAyE;IACzE,QAAQ,EAAE,SAAS,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,eAAO,MAAM,WAAW,iCAA4C,CAAA;AAOpE,eAAO,MAAM,IAAI,8EA6Bf,CAAA;AAIF,eAAe,IAAI,CAAA"}
1
+ {"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../../src/Page/Page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAGvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAGlE,MAAM,WAAW,KAAM,SAAQ,SAAS,EAAE,cAAc,CAAC,cAAc,CAAC;IACtE,wFAAwF;IACxF,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,iBAAiB,CAAA;IACzB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,yEAAyE;IACzE,QAAQ,EAAE,SAAS,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,eAAO,MAAM,WAAW,iCAA4C,CAAA;AAOpE,eAAO,MAAM,IAAI,8EAkCf,CAAA;AAIF,eAAe,IAAI,CAAA"}
@@ -22,7 +22,7 @@ const useStyles = makeStyles(styles, {
22
22
  export const Page = forwardRef(function Page(props, ref) {
23
23
  const { children, className, hamburgerId = 'hamburger', style, width, fullWidth } = props, rest = __rest(props, ["children", "className", "hamburgerId", "style", "width", "fullWidth"]);
24
24
  const classes = useStyles();
25
- return (React.createElement("div", Object.assign({}, rest, { ref: ref, className: cx(classes.root, className), style: Object.assign(Object.assign({}, style), { '--header-height': '3.5rem' }) }),
25
+ return (React.createElement("div", Object.assign({}, rest, { ref: ref, className: cx(classes.root, className, '[--content-padding-horizontal:1em] md:[--content-padding-horizontal:2em]', '[--header-height:3.5rem] [--content-width-wide:90em] [--content-width:75em]'), style: Object.assign({}, style) }),
26
26
  React.createElement(PageContext.Provider, { value: { width, fullWidth } },
27
27
  React.createElement(PageHamburgerContextProvider, { hamburgerId: hamburgerId }, children))));
28
28
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Page.js","sourceRoot":"","sources":["../../../src/Page/Page.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAA;AAE/D,OAAO,MAAM,MAAM,UAAU,CAAA;AAc7B,MAAM,CA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E,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,SAAS,CAAA;IAC5B,kDAAkD;IAClD,YAAY,CAAC,EAAE,SAAS,CAAA;CACzB;AAMD,eAAO,MAAM,UAAU,2EA8BrB,CAAA;AAaF,eAAe,UAAU,CAAA"}
1
+ {"version":3,"file":"PageFooter.d.ts","sourceRoot":"","sources":["../../../src/PageFooter/PageFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,KAAiC,MAAM,OAAO,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAOvD,MAAM,WAAW,KAAM,SAAQ,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC;IACnE,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,SAAS,CAAA;IAC5B,kDAAkD;IAClD,YAAY,CAAC,EAAE,SAAS,CAAA;CACzB;AAED,eAAO,MAAM,UAAU,2EAiCrB,CAAA;AAaF,eAAe,UAAU,CAAA"}
@@ -10,25 +10,17 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import React, { useContext, forwardRef } from 'react';
13
- import { makeStyles } from '@material-ui/core/styles';
14
- import cx from 'classnames';
13
+ import { twJoin, twMerge } from '@toptal/picasso-tailwind-merge';
15
14
  import { PageContext } from '../Page';
16
- import styles from './styles';
17
- const useStyles = makeStyles(styles, {
18
- name: 'PicassoPageFooter',
19
- });
15
+ import { getMaxWidthClass } from './styles';
20
16
  export const PageFooter = forwardRef(function PageFooter(props, ref) {
21
17
  const { className, style, rightContent, copyrightContent } = props, rest = __rest(props, ["className", "style", "rightContent", "copyrightContent"]);
22
- const classes = useStyles();
23
18
  const { width, fullWidth } = useContext(PageContext);
24
- const contentClassnames = cx({
25
- [classes.fullWidth]: fullWidth || width === 'full',
26
- [classes.wide]: width === 'wide',
27
- }, classes.content);
28
- return (React.createElement("footer", Object.assign({}, rest, { ref: ref, className: cx(classes.root, className), style: style }),
19
+ const contentClassnames = twJoin(getMaxWidthClass({ width, fullWidth }), 'box-border', 'flex justify-between xs:max-lg:flex-col', 'text-white text-md leading-[1em]', 'mx-auto pt-2 pb-6 px-[--content-padding-horizontal]');
20
+ return (React.createElement("footer", Object.assign({}, rest, { ref: ref, className: twMerge('bg-[#262d3d] w-full', className), style: style }),
29
21
  React.createElement("div", { className: contentClassnames },
30
- React.createElement("div", { className: classes.left }, copyrightContent),
31
- React.createElement("div", { className: classes.right }, rightContent))));
22
+ React.createElement("div", { className: 'flex items-center justify-center mt-4' }, copyrightContent),
23
+ React.createElement("div", { className: 'flex items-center justify-center mt-4 xs:max-lg:-order-1 xs:max-md:flex-col' }, rightContent))));
32
24
  });
33
25
  const CopyrightContent = () => (React.createElement(React.Fragment, null, `© Copyright 2010 – ${new Date().getFullYear()} Toptal, LLC`));
34
26
  PageFooter.defaultProps = {
@@ -1 +1 @@
1
- {"version":3,"file":"PageFooter.js","sourceRoot":"","sources":["../../../src/PageFooter/PageFooter.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,MAAM,MAAM,UAAU,CAAA;AAS7B,MAAM,SAAS,GAAG,UAAU,CAAQ,MAAM,EAAE;IAC1C,IAAI,EAAE,mBAAmB;CAC1B,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAqB,SAAS,UAAU,CAC1E,KAAK,EACL,GAAG;IAEH,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,gBAAgB,KAAc,KAAK,EAAd,IAAI,UAAK,KAAK,EAArE,0DAA6D,CAA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: Theme) => import("@material-ui/styles").StyleRules<{}, "content" | "left" | "right" | "wide" | "root" | "fullWidth" | "centered">;
3
- export default _default;
1
+ import type { PageContextProps } from '../Page/types';
2
+ export declare const getMaxWidthClass: ({ fullWidth, width }: PageContextProps) => "max-w-full" | "max-w-[--content-width-wide]" | "max-w-[--content-width]";
4
3
  //# sourceMappingURL=styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/PageFooter/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;uDAGP,KAAK;AAAnD,wBAwDI"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/PageFooter/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAErD,eAAO,MAAM,gBAAgB,yBAA0B,gBAAgB,8EAUtE,CAAA"}
@@ -1,54 +1,10 @@
1
- import { createStyles } from '@material-ui/core/styles';
2
- export default ({ palette, screens, layout }) => createStyles({
3
- root: {
4
- backgroundColor: palette.grey.darker,
5
- width: '100%',
6
- },
7
- content: {
8
- boxSizing: 'border-box',
9
- display: 'flex',
10
- justifyContent: 'space-between',
11
- margin: '0 auto',
12
- paddingTop: '0.5rem',
13
- paddingBottom: '1.5rem',
14
- paddingLeft: layout.contentMobilePaddingHorizontal,
15
- paddingRight: layout.contentMobilePaddingHorizontal,
16
- maxWidth: layout.contentWidth,
17
- color: palette.common.white,
18
- fontSize: '0.875rem',
19
- lineHeight: '1em',
20
- [screens('xs', 'sm', 'md')]: {
21
- flexDirection: 'column',
22
- },
23
- [screens('md', 'lg', 'xl')]: {
24
- paddingLeft: layout.contentPaddingHorizontal,
25
- paddingRight: layout.contentPaddingHorizontal,
26
- },
27
- },
28
- centered: {},
29
- wide: {
30
- maxWidth: layout.contentWidthWide,
31
- },
32
- fullWidth: {
33
- maxWidth: '100%',
34
- },
35
- left: {
36
- display: 'flex',
37
- alignItems: 'center',
38
- justifyContent: 'center',
39
- marginTop: '1rem',
40
- },
41
- right: {
42
- display: 'flex',
43
- alignItems: 'center',
44
- justifyContent: 'center',
45
- marginTop: '1rem',
46
- [screens('xs', 'sm', 'md')]: {
47
- order: -1,
48
- },
49
- [screens('xs', 'sm')]: {
50
- flexDirection: 'column',
51
- },
52
- },
53
- });
1
+ export const getMaxWidthClass = ({ fullWidth, width }) => {
2
+ if (fullWidth || width === 'full') {
3
+ return 'max-w-full';
4
+ }
5
+ if (width === 'wide') {
6
+ return 'max-w-[--content-width-wide]';
7
+ }
8
+ return 'max-w-[--content-width]';
9
+ };
54
10
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/PageFooter/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEvD,eAAe,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAS,EAAE,EAAE,CACrD,YAAY,CAAC;IACX,IAAI,EAAE;QACJ,eAAe,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM;QACpC,KAAK,EAAE,MAAM;KACd;IACD,OAAO,EAAE;QACP,SAAS,EAAE,YAAY;QACvB,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,eAAe;QAC/B,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,QAAQ;QACpB,aAAa,EAAE,QAAQ;QACvB,WAAW,EAAE,MAAM,CAAC,8BAA8B;QAClD,YAAY,EAAE,MAAM,CAAC,8BAA8B;QACnD,QAAQ,EAAE,MAAM,CAAC,YAAY;QAC7B,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK;QAC3B,QAAQ,EAAE,UAAU;QACpB,UAAU,EAAE,KAAK;QAEjB,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE;YAC3B,aAAa,EAAE,QAAQ;SACxB;QAED,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE;YAC3B,WAAW,EAAE,MAAM,CAAC,wBAAwB;YAC5C,YAAY,EAAE,MAAM,CAAC,wBAAwB;SAC9C;KACF;IACD,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAC,gBAAgB;KAClC;IACD,SAAS,EAAE;QACT,QAAQ,EAAE,MAAM;KACjB;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,SAAS,EAAE,MAAM;KAClB;IACD,KAAK,EAAE;QACL,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,SAAS,EAAE,MAAM;QAEjB,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE;YAC3B,KAAK,EAAE,CAAC,CAAC;SACV;QAED,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE;YACrB,aAAa,EAAE,QAAQ;SACxB;KACF;CACF,CAAC,CAAA"}
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/PageFooter/styles.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,SAAS,EAAE,KAAK,EAAoB,EAAE,EAAE;IACzE,IAAI,SAAS,IAAI,KAAK,KAAK,MAAM,EAAE;QACjC,OAAO,YAAY,CAAA;KACpB;IAED,IAAI,KAAK,KAAK,MAAM,EAAE;QACpB,OAAO,8BAA8B,CAAA;KACtC;IAED,OAAO,yBAAyB,CAAA;AAClC,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/picasso-page",
3
- "version": "5.1.10",
3
+ "version": "5.1.11",
4
4
  "description": "Toptal UI components library - Page",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/Page/Page.tsx CHANGED
@@ -47,8 +47,13 @@ export const Page = forwardRef<HTMLDivElement, Props>(function Page(
47
47
  <div
48
48
  {...rest}
49
49
  ref={ref}
50
- className={cx(classes.root, className)}
51
- style={{ ...style, '--header-height': '3.5rem' } as React.CSSProperties}
50
+ className={cx(
51
+ classes.root,
52
+ className,
53
+ '[--content-padding-horizontal:1em] md:[--content-padding-horizontal:2em]',
54
+ '[--header-height:3.5rem] [--content-width-wide:90em] [--content-width:75em]'
55
+ )}
56
+ style={{ ...style } as React.CSSProperties}
52
57
  >
53
58
  <PageContext.Provider value={{ width, fullWidth }}>
54
59
  <PageHamburgerContextProvider hamburgerId={hamburgerId}>
@@ -6,8 +6,7 @@ exports[`Page renders 1`] = `
6
6
  class="Picasso-root"
7
7
  >
8
8
  <div
9
- class="Page-root"
10
- style="--header-height: 3.5rem;"
9
+ class="Page-root [--content-padding md:[--content-padding [--header [--content-width [--content"
11
10
  >
12
11
  <div>
13
12
  Test
@@ -1,13 +1,11 @@
1
1
  import type { ReactNode, HTMLAttributes } from 'react'
2
2
  import React, { useContext, forwardRef } from 'react'
3
- import type { Theme } from '@material-ui/core/styles'
4
- import { makeStyles } from '@material-ui/core/styles'
5
- import cx from 'classnames'
6
3
  import type { BaseProps } from '@toptal/picasso-shared'
4
+ import { twJoin, twMerge } from '@toptal/picasso-tailwind-merge'
7
5
 
8
6
  import { PageContext } from '../Page'
9
7
  import type { PageContextProps } from '../Page/types'
10
- import styles from './styles'
8
+ import { getMaxWidthClass } from './styles'
11
9
 
12
10
  export interface Props extends BaseProps, HTMLAttributes<HTMLElement> {
13
11
  /** Content for copyright. You can override default if needed. */
@@ -16,37 +14,36 @@ export interface Props extends BaseProps, HTMLAttributes<HTMLElement> {
16
14
  rightContent?: ReactNode
17
15
  }
18
16
 
19
- const useStyles = makeStyles<Theme>(styles, {
20
- name: 'PicassoPageFooter',
21
- })
22
-
23
17
  export const PageFooter = forwardRef<HTMLElement, Props>(function PageFooter(
24
18
  props,
25
19
  ref
26
20
  ) {
27
21
  const { className, style, rightContent, copyrightContent, ...rest } = props
28
- const classes = useStyles()
29
22
  const { width, fullWidth } = useContext<PageContextProps>(PageContext)
30
23
 
31
- const contentClassnames = cx(
32
- {
33
- [classes.fullWidth]: fullWidth || width === 'full',
34
- [classes.wide]: width === 'wide',
35
- },
36
- classes.content
24
+ const contentClassnames = twJoin(
25
+ getMaxWidthClass({ width, fullWidth }),
26
+ 'box-border',
27
+ 'flex justify-between xs:max-lg:flex-col',
28
+ 'text-white text-md leading-[1em]',
29
+ 'mx-auto pt-2 pb-6 px-[--content-padding-horizontal]'
37
30
  )
38
31
 
39
32
  return (
40
33
  <footer
41
34
  {...rest}
42
35
  ref={ref}
43
- className={cx(classes.root, className)}
36
+ className={twMerge('bg-[#262d3d] w-full', className)}
44
37
  style={style}
45
38
  >
46
39
  <div className={contentClassnames}>
47
- <div className={classes.left}>{copyrightContent}</div>
40
+ <div className='flex items-center justify-center mt-4'>
41
+ {copyrightContent}
42
+ </div>
48
43
 
49
- <div className={classes.right}>{rightContent}</div>
44
+ <div className='flex items-center justify-center mt-4 xs:max-lg:-order-1 xs:max-md:flex-col'>
45
+ {rightContent}
46
+ </div>
50
47
  </div>
51
48
  </footer>
52
49
  )
@@ -2,9 +2,9 @@ import React from 'react'
2
2
  import { Page, Typography } from '@toptal/picasso'
3
3
 
4
4
  const Example = () => (
5
- <div>
5
+ <Page>
6
6
  <Page.Footer copyrightContent={<CopyrightContent />} />
7
- </div>
7
+ </Page>
8
8
  )
9
9
 
10
10
  const CopyrightContent = () => (
@@ -2,9 +2,9 @@ import React from 'react'
2
2
  import { Page } from '@toptal/picasso'
3
3
 
4
4
  const Example = () => (
5
- <div>
5
+ <Page>
6
6
  <Page.Footer />
7
- </div>
7
+ </Page>
8
8
  )
9
9
 
10
10
  export default Example
@@ -13,9 +13,9 @@ const StyledLink = styled(Link)`
13
13
  `
14
14
 
15
15
  const Example = () => (
16
- <div>
16
+ <Page>
17
17
  <Page.Footer rightContent={<Links />} />
18
- </div>
18
+ </Page>
19
19
  )
20
20
 
21
21
  const Links = () => (
@@ -1,60 +1,13 @@
1
- import type { Theme } from '@material-ui/core/styles'
2
- import { createStyles } from '@material-ui/core/styles'
1
+ import type { PageContextProps } from '../Page/types'
3
2
 
4
- export default ({ palette, screens, layout }: Theme) =>
5
- createStyles({
6
- root: {
7
- backgroundColor: palette.grey.darker,
8
- width: '100%',
9
- },
10
- content: {
11
- boxSizing: 'border-box',
12
- display: 'flex',
13
- justifyContent: 'space-between',
14
- margin: '0 auto',
15
- paddingTop: '0.5rem',
16
- paddingBottom: '1.5rem',
17
- paddingLeft: layout.contentMobilePaddingHorizontal,
18
- paddingRight: layout.contentMobilePaddingHorizontal,
19
- maxWidth: layout.contentWidth,
20
- color: palette.common.white,
21
- fontSize: '0.875rem',
22
- lineHeight: '1em',
3
+ export const getMaxWidthClass = ({ fullWidth, width }: PageContextProps) => {
4
+ if (fullWidth || width === 'full') {
5
+ return 'max-w-full'
6
+ }
23
7
 
24
- [screens('xs', 'sm', 'md')]: {
25
- flexDirection: 'column',
26
- },
8
+ if (width === 'wide') {
9
+ return 'max-w-[--content-width-wide]'
10
+ }
27
11
 
28
- [screens('md', 'lg', 'xl')]: {
29
- paddingLeft: layout.contentPaddingHorizontal,
30
- paddingRight: layout.contentPaddingHorizontal,
31
- },
32
- },
33
- centered: {},
34
- wide: {
35
- maxWidth: layout.contentWidthWide,
36
- },
37
- fullWidth: {
38
- maxWidth: '100%',
39
- },
40
- left: {
41
- display: 'flex',
42
- alignItems: 'center',
43
- justifyContent: 'center',
44
- marginTop: '1rem',
45
- },
46
- right: {
47
- display: 'flex',
48
- alignItems: 'center',
49
- justifyContent: 'center',
50
- marginTop: '1rem',
51
-
52
- [screens('xs', 'sm', 'md')]: {
53
- order: -1,
54
- },
55
-
56
- [screens('xs', 'sm')]: {
57
- flexDirection: 'column',
58
- },
59
- },
60
- })
12
+ return 'max-w-[--content-width]'
13
+ }