-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Enable sx
prop on any components
#37
Changes from 14 commits
4b98e48
695b502
6b8d613
2f6b209
438f2a4
ed9d466
451b6dc
cb60b51
4ccdd28
44bd1b5
6e11cd3
6c09a12
9a853d0
ede976b
c1ec425
49fab1b
f680a67
118c6be
344c70a
b3ea954
ace4f80
1259b9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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; | ||
} | ||
Comment on lines
+9
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to test that we can modify the types of JSX elements. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, we can use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's for POC at this point. There is one issue to fix from Pigment side which is delegating Once that's done, I will add docs for it. |
||
} | ||
} | ||
|
||
const visuallyHidden = css({ | ||
border: 0, | ||
clip: 'rect(0 0 0 0)', | ||
|
@@ -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)' }}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I ❤️ this! |
||
Get started by editing | ||
<code className={styles.code}>src/app/page.tsx</code> | ||
</p> | ||
|
@@ -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" | ||
|
@@ -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> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/processors/ | ||
/utils/ | ||
LICENSE | ||
/private-runtime/ |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore
sx
prop on JSX html tag.