Skip to content

Commit c7518f2

Browse files
Biki-dasAndyPengc12
authored andcommitted
Devtools:-Removed unused CSS (facebook#27032)
I tried to check out for the CSS bundle using the [eslint-plugin-css-modules](https://www.npmjs.com/package/eslint-plugin-css-modules), and ran it locally , seems like There are lot of unused styles and classes present . I have attached the output below after running the lint command. https://gist.github.com/Biki-das/647ceb7383b43cca9c8619e1dc33fe0d All the shared.css files should not be touched i feel as they are being used randomly by some file Thoughts @hoxyq
1 parent b830b1d commit c7518f2

18 files changed

+4
-109
lines changed

packages/react-devtools-shared/src/devtools/views/Components/EditableValue.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,3 @@
3333
background-color: var(--color-button-background-focus);
3434
outline: none;
3535
}
36-
37-
.ResetButton {
38-
flex: 0 0 auto;
39-
padding: 0 0.5rem;
40-
}

packages/react-devtools-shared/src/devtools/views/Components/Element.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@
2222
user-select: none;
2323
}
2424

25-
.ScrollAnchor {
26-
height: 100%;
27-
width: 0;
28-
}
29-
3025
.SelectedElement {
3126
background-color: var(--color-background-selected);
3227
color: var(--color-text-selected);

packages/react-devtools-shared/src/devtools/views/Components/InspectedElement.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -264,24 +264,20 @@ export default function InspectedElementWrapper(_: Props): React.Node {
264264
<div
265265
className={
266266
element.isStrictModeNonCompliant
267-
? styles.StrictModeNonCompliantComponent
267+
? styles.StrictModeNonCompliant
268268
: styles.Component
269269
}
270270
title={element.displayName}>
271271
{element.displayName}
272272
</div>
273273
</div>
274274
{canOpenInEditor && (
275-
<Button
276-
className={styles.IconButton}
277-
onClick={onOpenInEditor}
278-
title="Open in editor">
275+
<Button onClick={onOpenInEditor} title="Open in editor">
279276
<ButtonIcon type="editor" />
280277
</Button>
281278
)}
282279
{canToggleError && (
283280
<Toggle
284-
className={styles.IconButton}
285281
isChecked={isErrored}
286282
onChange={toggleErrored}
287283
title={
@@ -294,7 +290,6 @@ export default function InspectedElementWrapper(_: Props): React.Node {
294290
)}
295291
{canToggleSuspense && (
296292
<Toggle
297-
className={styles.IconButton}
298293
isChecked={isSuspended}
299294
onChange={toggleSuspended}
300295
title={
@@ -307,23 +302,20 @@ export default function InspectedElementWrapper(_: Props): React.Node {
307302
)}
308303
{store.supportsNativeInspection && (
309304
<Button
310-
className={styles.IconButton}
311305
onClick={highlightElement}
312306
title="Inspect the matching DOM element">
313307
<ButtonIcon type="view-dom" />
314308
</Button>
315309
)}
316310
{!hideLogAction && (
317311
<Button
318-
className={styles.IconButton}
319312
onClick={logElement}
320313
title="Log this component data to the console">
321314
<ButtonIcon type="log-data" />
322315
</Button>
323316
)}
324317
{!hideViewSourceAction && (
325318
<Button
326-
className={styles.IconButton}
327319
disabled={!canViewSource}
328320
onClick={viewSource}
329321
title="View source for this element">

packages/react-devtools-shared/src/devtools/views/Components/KeyValue.css

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
display: flex;
33
}
44

5-
.DisabledItem {
6-
opacity: 0.5;
7-
}
8-
95
.Name {
106
color: var(--color-attribute-name-not-editable);
117
flex: 0 0 auto;
@@ -40,20 +36,11 @@
4036
flex: 1;
4137
}
4238

43-
.None {
44-
color: var(--color-dimmer);
45-
font-style: italic;
46-
}
47-
4839
.ExpandCollapseToggleSpacer {
4940
flex: 0 0 1rem;
5041
width: 1rem;
5142
}
5243

53-
.Empty {
54-
color: var(--color-dimmer);
55-
}
56-
5744
.DeleteArrayItemButton {
5845
padding: 0;
5946
margin-right: 0.125rem;

packages/react-devtools-shared/src/devtools/views/Components/NativeStyleEditor/StyleEditor.css

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,3 @@
5050
box-shadow: 0px 1px 3px var(--color-shadow);
5151
}
5252

53-
.Empty {
54-
color: var(--color-dimmer);
55-
font-style: italic;
56-
user-select: none;
57-
padding-left: 1rem;
58-
}

packages/react-devtools-shared/src/devtools/views/Components/NewArrayValue.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
color: var(--color-text-invalid) !important;
1414
}
1515

16-
.Input:focus,
1716
.Invalid:focus {
1817
background-color: var(--color-button-background-focus);
1918
}

packages/react-devtools-shared/src/devtools/views/Components/OwnersStack.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,7 @@ export default function OwnerStack(): React.Node {
191191
))}
192192
</div>
193193
<div className={styles.VRule} />
194-
<Button
195-
className={styles.IconButton}
196-
onClick={() => selectOwner(null)}
197-
title="Back to tree view">
194+
<Button onClick={() => selectOwner(null)} title="Back to tree view">
198195
<ButtonIcon type="close" />
199196
</Button>
200197
</div>

packages/react-devtools-shared/src/devtools/views/Profiler/HoveredFiberInfo.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
text-overflow: ellipsis;
2323
}
2424

25-
.Label {
26-
font-weight: bold;
27-
}
28-
2925
.CurrentCommit {
3026
margin: 0.25rem 0;
3127
display: block;

packages/react-devtools-shared/src/devtools/views/Profiler/SidebarSelectedFiberInfo.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
overflow-y: auto;
1414
}
1515

16-
.WhatChanged {
17-
margin-bottom: 1rem;
18-
}
19-
2016
.Component {
2117
flex: 1;
2218
color: var(--color-component-name);

packages/react-devtools-shared/src/devtools/views/Profiler/SidebarSelectedFiberInfo.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ export default function SidebarSelectedFiberInfo(_: Props): React.Node {
108108
</div>
109109

110110
<Button
111-
className={styles.IconButton}
112111
onClick={() => selectFiber(null, null)}
113112
title="Back to commit view">
114113
<ButtonIcon type="close" />

0 commit comments

Comments
 (0)