Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

Commit 9a30b5f

Browse files
committed
Tweak styling in order to integrate it in the console
1 parent 065247f commit 9a30b5f

File tree

4 files changed

+43
-45
lines changed

4 files changed

+43
-45
lines changed

packages/devtools-components/src/tree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ const Tree = module.exports = createClass({
277277

278278
return dom.div(
279279
{
280-
className: "tree",
280+
className: `tree ${this.props.className ? this.props.className : ""}`,
281281
ref: "tree",
282282
onKeyDown: this._onKeyDown,
283283
onKeyPress: this._preventArrowKeyScrolling,

packages/devtools-reps/src/object-inspector/index.css

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

55
.tree {
6-
white-space: nowrap;
76
overflow: auto;
8-
min-width: 100%;
7+
display: inline-block;
8+
}
9+
10+
.tree.nowrap {
11+
white-space: nowrap;
912
}
1013

1114
.tree.noselect {
@@ -32,24 +35,23 @@
3235
}
3336

3437
.arrow svg {
35-
--width: 10px;
3638
fill: var(--theme-splitter-color);
37-
/*margin-top: 3px;*/
3839
transition: transform 0.125s ease;
39-
width: var(--width);
40-
/*margin-top: calc((16px - var(--width) / 2));*/
41-
}
42-
43-
html:not([dir="rtl"]) .arrow svg {
44-
margin-right: 5px;
40+
width: 10px;
41+
margin-inline-end: 5px;
4542
transform: rotate(-90deg);
4643
}
4744

48-
html[dir="rtl"] .arrow svg {
49-
margin-left: 5px;
45+
html[dir="rtl"] .arrow svg,
46+
.arrow svg:dir(rtl),
47+
.arrow svg:-moz-locale-dir(rtl) {
5048
transform: rotate(90deg);
5149
}
5250

5351
.arrow.expanded.expanded svg {
5452
transform: rotate(0deg);
5553
}
54+
55+
.object-label {
56+
color: var(--theme-highlight-blue);
57+
}

packages/devtools-reps/src/object-inspector/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ type Props = {
4545
itemHeight: number,
4646
mode: Mode,
4747
roots: Array<ObjectInspectorItem>,
48+
disableWrap: boolean,
4849
getObjectProperties: (actor:string) => any,
4950
loadObjectProperties: (value:Grip) => any,
5051
onFocus: ?(ObjectInspectorItem) => any,
@@ -333,6 +334,7 @@ class ObjectInspector extends Component {
333334
autoExpandAll = true,
334335
disabledFocus,
335336
itemHeight = 20,
337+
disableWrap = false,
336338
} = this.props;
337339

338340
const {
@@ -346,6 +348,7 @@ class ObjectInspector extends Component {
346348
}
347349

348350
return Tree({
351+
className: disableWrap ? "nowrap" : "",
349352
autoExpandAll,
350353
autoExpandDepth,
351354
disabledFocus,
@@ -374,6 +377,7 @@ ObjectInspector.propTypes = {
374377
autoExpandAll: PropTypes.bool,
375378
autoExpandDepth: PropTypes.number,
376379
disabledFocus: PropTypes.bool,
380+
disableWrap: PropTypes.bool,
377381
roots: PropTypes.array,
378382
getObjectProperties: PropTypes.func.isRequired,
379383
loadObjectProperties: PropTypes.func.isRequired,

packages/devtools-reps/src/reps/reps.css

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@
3030

3131
/******************************************************************************/
3232

33-
.objectLink:hover {
34-
cursor: pointer;
35-
text-decoration: underline;
36-
}
37-
3833
.inline {
3934
display: inline;
4035
white-space: normal;
@@ -49,15 +44,15 @@
4944
.objectBox-string,
5045
.objectBox-symbol,
5146
.objectBox-text,
52-
.objectLink-textNode,
47+
.objectBox-textNode,
5348
.objectBox-table {
5449
white-space: pre-wrap;
5550
}
5651

5752
.objectBox-number,
58-
.objectLink-styleRule,
59-
.objectLink-element,
60-
.objectLink-textNode,
53+
.objectBox-styleRule,
54+
.objectBox-element,
55+
.objectBox-textNode,
6156
.objectBox-array > .length {
6257
color: var(--number-color);
6358
}
@@ -68,13 +63,13 @@
6863
color: var(--string-color);
6964
}
7065

71-
.objectLink-function,
66+
.objectBox-function,
7267
.objectBox-stackTrace,
73-
.objectLink-profile {
68+
.objectBox-profile {
7469
color: var(--object-color);
7570
}
7671

77-
.objectLink-Location {
72+
.objectBox-Location {
7873
font-style: italic;
7974
color: var(--location-color);
8075
}
@@ -87,7 +82,7 @@
8782
color: var(--null-color);
8883
}
8984

90-
.objectLink-sourceLink {
85+
.objectBox-sourceLink {
9186
position: absolute;
9287
right: 4px;
9388
top: 2px;
@@ -107,29 +102,27 @@
107102

108103
/******************************************************************************/
109104

110-
.objectLink-event,
111-
.objectLink-eventLog,
112-
.objectLink-regexp,
113-
.objectLink-object,
114-
.objectLink-Date {
105+
.objectBox-event,
106+
.objectBox-eventLog,
107+
.objectBox-regexp,
108+
.objectBox-object,
109+
.objectBox-Date {
115110
font-weight: bold;
116111
color: var(--object-color);
117112
white-space: pre-wrap;
118113
}
119114

120115
/******************************************************************************/
121116

122-
.objectLink-object .nodeName,
123-
.objectLink-NamedNodeMap .nodeName,
124-
.objectLink-NamedNodeMap .objectEqual,
125-
.objectLink-NamedNodeMap .arrayLeftBracket,
126-
.objectLink-NamedNodeMap .arrayRightBracket,
127-
.objectLink-Attr .attrEqual,
128-
.objectLink-Attr .attrTitle {
117+
.objectBox-object .nodeName,
118+
.objectBox-NamedNodeMap .nodeName,
119+
.objectBox-NamedNodeMap .objectEqual,
120+
.objectBox-Attr .attrEqual,
121+
.objectBox-Attr .attrTitle {
129122
color: var(--node-color);
130123
}
131124

132-
.objectLink-object .nodeName {
125+
.objectBox-object .nodeName {
133126
font-weight: normal;
134127
}
135128

@@ -139,21 +132,20 @@
139132
.objectRightBrace,
140133
.arrayLeftBracket,
141134
.arrayRightBracket {
142-
cursor: pointer;
143-
font-weight: bold;
135+
color: var(--theme-highlight-blue);
144136
}
145137

146138
/******************************************************************************/
147139
/* Cycle reference*/
148140

149-
.objectLink-Reference {
141+
.objectBox-Reference {
150142
font-weight: bold;
151143
color: var(--reference-color);
152144
}
153145

154-
.objectBox-array > .objectTitle {
155-
font-weight: bold;
156-
color: var(--object-color);
146+
[class*="objectBox-"] > .objectTitle {
147+
color: var(--theme-highlight-blue);
148+
font-style: italic;
157149
}
158150

159151
.caption {

0 commit comments

Comments
 (0)