Skip to content

Commit e3efe91

Browse files
committed
Fix Tailwinds overrides for migration process
1 parent 3c950c1 commit e3efe91

2 files changed

Lines changed: 50 additions & 2 deletions

File tree

src/app/components/Social/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ import DocsIcon from '@mui/icons-material/MenuBook'
1616
import HomeIcon from '@mui/icons-material/Cottage'
1717
import { COLORS } from '../../../styles/theme/colors'
1818
import { socialMedia } from '../../utils/externalLinks'
19+
import { styled } from '@mui/material/styles'
20+
21+
const StyledImage = styled('img')({
22+
height: '40px',
23+
})
1924

2025
type SocialLinkProps = {
2126
label: string
@@ -43,7 +48,7 @@ const SocialLink: FC<SocialLinkProps> = ({ label, href, isMobile, imgSrc, img })
4348
>
4449
<Box sx={{ display: 'flex', justifyContent: 'center', mb: 3 }}>
4550
<>
46-
{imgSrc && <img src={imgSrc} alt={label} height={40} />}
51+
{imgSrc && <StyledImage src={imgSrc} alt={label} />}
4752
{img}
4853
</>
4954
</Box>

src/styles/tailwind.css

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,49 @@
11
@import '@oasisprotocol/ui-library/src/styles/global.css';
22

3-
/* During migration to Oasis UI Library, we need to override MUI styles that are applied globally */
3+
/* Specific fixes needed during migration to Oasis UI Library */
4+
5+
/* Override MUI styles that are applied globally */
46
[class*=' text-'] {
57
font-family: var(--default-font-family);
68
}
9+
10+
/* Override Tailwind's header reset for actual HTML header elements within MUI components */
11+
[class*='Mui'] h1:not([class*='MuiTypography']),
12+
[class*='Mui'] h2:not([class*='MuiTypography']),
13+
[class*='Mui'] h3:not([class*='MuiTypography']),
14+
[class*='Mui'] h4:not([class*='MuiTypography']),
15+
[class*='Mui'] h5:not([class*='MuiTypography']),
16+
[class*='Mui'] h6:not([class*='MuiTypography']) {
17+
font-size: revert;
18+
font-weight: revert;
19+
}
20+
21+
/* Override Tailwind's vertical-align reset for MUI SVG components */
22+
[class*='Mui'] img,
23+
[class*='Mui'] svg,
24+
[class*='Mui'] video,
25+
[class*='Mui'] canvas,
26+
[class*='Mui'] audio,
27+
[class*='Mui'] iframe,
28+
[class*='Mui'] embed,
29+
[class*='Mui'] object {
30+
vertical-align: revert;
31+
}
32+
33+
/* Override Tailwind's table cell padding reset for actual HTML td elements within MUI components */
34+
[class*='Mui'] td:not([class*='MuiTableCell']),
35+
[class*='Mui'] th:not([class*='MuiTableCell']) {
36+
padding: 1px;
37+
}
38+
39+
/* Override Tailwind's table border-collapse reset for actual HTML table elements within MUI components */
40+
[class*='Mui'] table:not([class*='MuiTable']),
41+
[class*='Mui'] tbody:not([class*='MuiTableBody']) {
42+
border-collapse: revert;
43+
}
44+
45+
/* Override Tailwind's image list margin */
46+
[class*='MuiImageList'] {
47+
margin-block-start: revert;
48+
margin-block-end: revert;
49+
}

0 commit comments

Comments
 (0)