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

Commit 350d8e2

Browse files
authored
Merge pull request #485 from devtools-html/styling
Tweak styling in order to integrate it in the console
2 parents 4b26b2e + f48ddcb commit 350d8e2

File tree

16 files changed

+68
-62
lines changed

16 files changed

+68
-62
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/bin/copy-assets.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@ function start() {
3232

3333
console.log(" output path is:", mcPath);
3434

35-
console.log(" copying reps.css...");
36-
copyFile(
37-
path.resolve(projectPath, "src/reps/reps.css"),
38-
path.join(mcPath, mcModulePath, "reps.css"),
39-
{cwd: projectPath}
40-
);
41-
4235
console.log(" creating reps.js bundle...");
4336
makeBundle({
4437
outputPath: path.join(mcPath, mcModulePath),

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/date-time.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ function DateTime(props) {
4242
}
4343

4444
function getTitle(grip) {
45-
return span({}, grip.class + " ");
45+
return span({
46+
className: "objectTitle"
47+
}, grip.class + " ");
4648
}
4749

4850
// Registration

packages/devtools-reps/src/reps/document.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ function getLocation(grip) {
4444
}
4545

4646
function getTitle(grip) {
47-
return span({}, grip.class + " ");
47+
return span({
48+
className: "objectTitle",
49+
}, grip.class + " ");
4850
}
4951

5052
// Registration

packages/devtools-reps/src/reps/function.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ function getTitle(props, grip) {
5252
title = "async " + title;
5353
}
5454

55-
return span({}, title);
55+
return span({
56+
className: "objectTitle",
57+
}, title);
5658
}
5759

5860
function summarizeFunction(grip) {

packages/devtools-reps/src/reps/grip-array.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ function getTitle(props, object) {
9898
}
9999

100100
let title = props.title || object.class || "Array";
101-
return span({}, title + " ");
101+
return span({
102+
className: "objectTitle",
103+
}, title + " ");
102104
}
103105

104106
function getPreviewItems(grip) {

packages/devtools-reps/src/reps/grip-map.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ function GripMap(props) {
6464

6565
function getTitle(props, object) {
6666
let title = props.title || (object && object.class ? object.class : "Map");
67-
return span({}, title);
67+
return span({
68+
className: "objectTitle",
69+
}, title);
6870
}
6971

7072
function safeEntriesIterator(props, object, max) {

packages/devtools-reps/src/reps/grip.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ function GripRep(props) {
6767

6868
function getTitle(props, object) {
6969
let title = props.title || object.class || "Object";
70-
return span({}, title);
70+
return span({
71+
className: "objectTitle",
72+
}, title);
7173
}
7274

7375
function safePropIterator(props, object, max) {

0 commit comments

Comments
 (0)