-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[typescript] Add test for style lib interop (#14482)
- Loading branch information
Showing
4 changed files
with
64 additions
and
0 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,27 @@ | ||
import React from 'react'; | ||
import styled from '@emotion/styled'; | ||
import Button from '@material-ui/core/Button'; | ||
import NoSsr from '@material-ui/core/NoSsr'; | ||
|
||
const StyledButton = styled(Button)` | ||
background: linear-gradient(45deg, #fe6b8b 30%, #ff8e53 90%); | ||
border-radius: 3px; | ||
border: 0; | ||
color: white; | ||
height: 48px; | ||
padding: 0 30px; | ||
box-shadow: 0 3px 5px 2px rgba(255, 105, 135, 0.3); | ||
`; | ||
|
||
function EmotionStyled() { | ||
return ( | ||
<NoSsr> | ||
<div> | ||
<Button>Material-UI</Button> | ||
<StyledButton>Emotion</StyledButton> | ||
</div> | ||
</NoSsr> | ||
); | ||
} | ||
|
||
export default EmotionStyled; |
27 changes: 27 additions & 0 deletions
27
docs/src/pages/guides/interoperability/StyledComponents.tsx
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,27 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import Button from '@material-ui/core/Button'; | ||
import NoSsr from '@material-ui/core/NoSsr'; | ||
|
||
const StyledButton = styled(Button)` | ||
background: linear-gradient(45deg, #fe6b8b 30%, #ff8e53 90%); | ||
border-radius: 3px; | ||
border: 0; | ||
color: white; | ||
height: 48px; | ||
padding: 0 30px; | ||
box-shadow: 0 3px 5px 2px rgba(255, 105, 135, 0.3); | ||
`; | ||
|
||
function StyledComponents() { | ||
return ( | ||
<NoSsr> | ||
<div> | ||
<Button>Material-UI</Button> | ||
<StyledButton>Styled Components</StyledButton> | ||
</div> | ||
</NoSsr> | ||
); | ||
} | ||
|
||
export default StyledComponents; |
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