Skip to content

Commit 5b95c39

Browse files
authored
[theme] Always return default spacing value with px units (#22552)
1 parent e4d6eac commit 5b95c39

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+206
-95
lines changed

docs/src/modules/components/AppTableOfContents.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const useStyles = makeStyles((theme) => ({
3636
},
3737
item: {
3838
fontSize: '.8125rem',
39-
padding: theme.spacing(0.5, 0, 0.5, `${Math.max(0, theme.spacing(1) - 3)}px`),
39+
padding: theme.spacing(0.5, 0, 0.5, '5px'),
4040
borderLeft: `3px solid transparent`,
4141
boxSizing: 'border-box',
4242
'&:hover': {

docs/src/modules/components/TopLayoutBlog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const styles = (theme) => ({
1919
},
2020
container: {
2121
marginBottom: theme.spacing(20),
22-
maxWidth: 680 + theme.spacing(8 + 4),
22+
maxWidth: `calc(680px + ${theme.spacing(12)})`,
2323
'& .markdownElement': {
2424
fontSize: 18,
2525
lineHeight: 1.7,

docs/src/modules/components/TopLayoutCompany.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const styles = (theme) => ({
1313
},
1414
container: {
1515
marginBottom: theme.spacing(20),
16-
maxWidth: 680 + theme.spacing(8 + 4),
16+
maxWidth: `calc(680px + ${theme.spacing(12)})`,
1717
'& .markdownElement': {
1818
[theme.breakpoints.up('md')]: {
1919
paddingRight: theme.spacing(4),

docs/src/modules/components/ad.styles.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ const adBodyImageStyles = (theme) => ({
66
display: 'block',
77
overflow: 'hidden',
88
border: `1px solid ${fade(theme.palette.action.active, 0.12)}`,
9-
padding: `${theme.spacing(1.5)}px ${theme.spacing(1.5)}px ${theme.spacing(1.5)}px ${
10-
theme.spacing(1.5) + 130
11-
}px`,
9+
padding: `${theme.spacing(1.5)} ${theme.spacing(1.5)} ${theme.spacing(
10+
1.5,
11+
)} calc(${theme.spacing(1.5)} + 130px)`,
1212
borderRadius: theme.shape.borderRadius,
1313
},
1414
imgWrapper: {

docs/src/pages/components/app-bar/PrimarySearchAppBar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const useStyles = makeStyles((theme) => ({
5858
inputInput: {
5959
padding: theme.spacing(1, 1, 1, 0),
6060
// vertical padding + font size from searchIcon
61-
paddingLeft: `calc(1em + ${theme.spacing(4)}px)`,
61+
paddingLeft: `calc(1em + ${theme.spacing(4)})`,
6262
transition: theme.transitions.create('width'),
6363
width: '100%',
6464
[theme.breakpoints.up('md')]: {

docs/src/pages/components/app-bar/PrimarySearchAppBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const useStyles = makeStyles((theme: Theme) =>
6464
inputInput: {
6565
padding: theme.spacing(1, 1, 1, 0),
6666
// vertical padding + font size from searchIcon
67-
paddingLeft: `calc(1em + ${theme.spacing(4)}px)`,
67+
paddingLeft: `calc(1em + ${theme.spacing(4)})`,
6868
transition: theme.transitions.create('width'),
6969
width: '100%',
7070
[theme.breakpoints.up('md')]: {

docs/src/pages/components/app-bar/SearchAppBar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const useStyles = makeStyles((theme) => ({
5151
inputInput: {
5252
padding: theme.spacing(1, 1, 1, 0),
5353
// vertical padding + font size from searchIcon
54-
paddingLeft: `calc(1em + ${theme.spacing(4)}px)`,
54+
paddingLeft: `calc(1em + ${theme.spacing(4)})`,
5555
transition: theme.transitions.create('width'),
5656
width: '100%',
5757
[theme.breakpoints.up('sm')]: {

docs/src/pages/components/app-bar/SearchAppBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const useStyles = makeStyles((theme: Theme) =>
5757
inputInput: {
5858
padding: theme.spacing(1, 1, 1, 0),
5959
// vertical padding + font size from searchIcon
60-
paddingLeft: `calc(1em + ${theme.spacing(4)}px)`,
60+
paddingLeft: `calc(1em + ${theme.spacing(4)})`,
6161
transition: theme.transitions.create('width'),
6262
width: '100%',
6363
[theme.breakpoints.up('sm')]: {

docs/src/pages/components/buttons/ButtonBase.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ const useStyles = makeStyles((theme) => ({
8181
},
8282
imageTitle: {
8383
position: 'relative',
84-
padding: `${theme.spacing(2)}px ${theme.spacing(4)}px ${
85-
theme.spacing(1) + 6
86-
}px`,
84+
padding: `${theme.spacing(2)} ${theme.spacing(4)} calc(${theme.spacing(
85+
1,
86+
)} + 6px)`,
8787
},
8888
imageMarked: {
8989
height: 3,

docs/src/pages/components/buttons/ButtonBase.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ const useStyles = makeStyles((theme: Theme) =>
8282
},
8383
imageTitle: {
8484
position: 'relative',
85-
padding: `${theme.spacing(2)}px ${theme.spacing(4)}px ${
86-
theme.spacing(1) + 6
87-
}px`,
85+
padding: `${theme.spacing(2)} ${theme.spacing(4)} calc(${theme.spacing(
86+
1,
87+
)} + 6px)`,
8888
},
8989
imageMarked: {
9090
height: 3,

0 commit comments

Comments
 (0)