Skip to content

Commit

Permalink
test with apps
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed Apr 26, 2024
1 parent 6c09a12 commit 9a853d0
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 15 deletions.
5 changes: 3 additions & 2 deletions apps/pigment-css-next-app/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"rules": {
"import/prefer-default-export": "off",
"import/extensions": "off",
"import/no-unresolved": "off"
}
"import/no-unresolved": "off",
"react/no-unknown-property": ["error", { "ignore": ["sx"] }],
},
}
2 changes: 1 addition & 1 deletion apps/pigment-css-next-app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ theme.getColorSchemeSelector = (colorScheme) => {
*/
const pigmentOptions = {
theme,
transformLibraries: ['local-ui-lib'],
transformLibraries: ['local-ui-lib', '@mui/material'],
sourceMap: true,
displayName: true,
};
Expand Down
41 changes: 38 additions & 3 deletions apps/pigment-css-next-app/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
import Image from 'next/image';
import { styled, css } from '@pigment-css/react';
import Button from '@mui/material/Button';
import styles from './page.module.css';

declare global {
namespace React {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface HTMLAttributes<T> {
sx?: any;
}
}
}

const visuallyHidden = css({
border: 0,
clip: 'rect(0 0 0 0)',
Expand Down Expand Up @@ -93,8 +103,16 @@ export default function Home() {
return (
<Main>
<div className={visuallyHidden}>I am invisible</div>
<Description>
<p>
<Description
sx={{
'&::before': {
content: '"🚀"',
display: 'inline-block',
border: '1px solid',
},
}}
>
<p sx={{ boxShadow: '0 0 4px 0 rgba(0 0 0 / 0.12)' }}>
Get started by editing&nbsp;
<code className={styles.code}>src/app/page.tsx</code>
</p>
Expand All @@ -117,7 +135,12 @@ export default function Home() {
</div>
</Description>

<div className={styles.center}>
<div
className={styles.center}
sx={{
border: '1px solid',
}}
>
<Image
className={styles.logo}
src="/next.svg"
Expand Down Expand Up @@ -176,6 +199,18 @@ export default function Home() {
</h2>
<p>Instantly deploy your Next.js site to a shareable URL with Vercel.</p>
</a>
<Button
sx={{
color: 'red',
backgroundColor: 'blue',
'&:hover': {
color: 'blue',
backgroundColor: 'red',
},
}}
>
Hello
</Button>
</div>
</Main>
);
Expand Down
9 changes: 0 additions & 9 deletions apps/pigment-css-next-app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"],
"references": [
{
"path": "../../packages/mui-system/tsconfig.build.json"
},
{
"path": "../../packages/mui-base/tsconfig.build.json"
},
{
"path": "../../packages/mui-material/tsconfig.build.json"
},
{
"path": "../../packages/pigment-css-react/tsconfig.json"
}
Expand Down

0 comments on commit 9a853d0

Please sign in to comment.