Skip to content

Commit 4c784a8

Browse files
committed
Fix global styling from react devtools
1 parent 5e9f2ed commit 4c784a8

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

packages/app/src/app/components/Preview/DevTools/React-Devtools/elements.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ export const Container = styled.div`
77
height: 100%;
88
color: ${props =>
99
props.theme['editor.foreground'] || 'rgba(255, 255, 255, 0.8)'};
10+
11+
* {
12+
box-sizing: border-box;
13+
-webkit-font-smoothing: var(--font-smoothing);
14+
}
1015
`;

packages/app/src/app/pages/Sandbox/Editor/Workspace/elements.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const getContainerStyles = props => {
2020
theme.templateColor ||
2121
theme.secondary);
2222
let styles = `
23-
${styleProps => styleProps.noTransition || 'transition: 0.3s ease all;'}
23+
${props.noTransition ? '' : 'transition: 0.3s ease all;'}
2424
position: relative;
2525
display: flex;
2626
font-size: 14px;

packages/common/src/global.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,20 @@ a {
6767
.react-console::-webkit-scrollbar-thumb:hover {
6868
background-color: rgba(0, 0, 0, 0.4);
6969
}
70+
71+
/**
72+
* The React DevTools has a file called root.css with the rule
73+
*
74+
* * {
75+
* box-sizing: content-box;
76+
* -webkit-font-smoothing: antialiased;
77+
* }
78+
*
79+
* which changes the styles in all CodeSandbox elements. This is our current
80+
* hack to fix it, we have a bit more specificity so we get our stylings back until
81+
* the issue has been fixed.
82+
**/
83+
body * {
84+
box-sizing: initial;
85+
-webkit-font-smoothing: antialiased;
86+
}

0 commit comments

Comments
 (0)