Skip to content

Commit ae62078

Browse files
committed
Opt-out of Docker styles in a better way
This commit removes the `dockerDesktopTheme` class from our body in the HTML, rather than inserting it, and then removing it via JS.
1 parent 841f41c commit ae62078

2 files changed

Lines changed: 1 addition & 19 deletions

File tree

ui/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8" />
55
</head>
6-
<body class="dockerDesktopTheme">
6+
<body>
77
<div id="root"></div>
88
</body>
99
</html>

ui/src/entry.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import NeedsAuthView from "src/views/needs-auth-view"
1414
import OnboardingView from "src/views/onboarding-view"
1515

1616
export default function App() {
17-
useRemoveDockerStyles()
18-
1917
return (
2018
<Tooltip.Provider>
2119
<div className="text-sm h-full">
@@ -109,19 +107,3 @@ const showOnboarding = (state: BackendState, user?: object) => {
109107
}
110108
return false
111109
}
112-
113-
/**
114-
* useRemoveDockerStyles removes the `dockerDesktopTheme` classname that gets
115-
* injected by Docker Desktop. These styles seem like they may change regularly,
116-
* so opting out lets us control our UI better, and only make changes when
117-
* necessary.
118-
*/
119-
function useRemoveDockerStyles() {
120-
useEffect(() => {
121-
const dockerThemeClass = "dockerDesktopTheme"
122-
const $body = document.body;
123-
if ($body && $body.classList.contains(dockerThemeClass)) {
124-
$body.classList.remove(dockerThemeClass)
125-
}
126-
}, [])
127-
}

0 commit comments

Comments
 (0)