Skip to content

Commit 6b4110e

Browse files
jarildarkwing
authored andcommitted
ligned breakpoints and XHR breakpoints panes (firefox-devtools#8094)
1 parent 15f9126 commit 6b4110e

9 files changed

+119
-104
lines changed

src/components/SecondaryPanes/Breakpoints/Breakpoints.css

+47-36
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,24 @@
66
margin: 2px 3px;
77
}
88

9-
.pane.breakpoints-list {
10-
padding-bottom: 0.35em;
11-
}
12-
139
.breakpoints-list * {
1410
user-select: none;
1511
}
1612

13+
.breakpoints-list {
14+
margin-top: 4px;
15+
margin-bottom: 4px;
16+
}
17+
1718
.breakpoints-list .breakpoint-heading {
1819
text-overflow: ellipsis;
19-
overflow: hidden;
20-
display: flex;
2120
width: 100%;
22-
align-items: center;
21+
font-size: 12px;
22+
line-height: 16px;
23+
}
24+
25+
.breakpoint-heading:not(:first-child) {
26+
margin-top: 2px;
2327
}
2428

2529
.breakpoints-list .breakpoint-heading .filename {
@@ -34,64 +38,65 @@
3438

3539
.breakpoints-list .breakpoint-heading,
3640
.breakpoints-list .breakpoint {
37-
font-size: 12px;
3841
color: var(--theme-content-color1);
3942
position: relative;
40-
transition: all 0.25s ease;
4143
cursor: pointer;
4244
}
4345

4446
.breakpoints-list .breakpoint-heading,
4547
.breakpoints-list .breakpoint,
4648
.breakpoints-exceptions,
4749
.breakpoints-exceptions-caught {
48-
padding: 0.25em 1em;
50+
display: flex;
51+
align-items: center;
52+
overflow: hidden;
53+
padding-top: 2px;
54+
padding-bottom: 2px;
55+
padding-inline-start: 16px;
56+
padding-inline-end: 12px;
4957
}
5058

5159
.breakpoints-exceptions {
52-
padding-bottom: 0.5em;
53-
padding-top: 0.5em;
60+
padding-bottom: 3px;
61+
padding-top: 3px;
5462
user-select: none;
5563
}
5664

57-
.breakpoints-list .breakpoint {
58-
min-height: var(--breakpoint-expression-height);
59-
overflow: hidden;
65+
.breakpoints-exceptions-caught {
66+
padding-bottom: 3px;
67+
padding-top: 3px;
68+
padding-inline-start: 36px;
6069
}
6170

62-
.breakpoints-exceptions-caught {
63-
padding: 0 1em 0.5em 3em;
64-
margin-top: -0.25em;
71+
.breakpoints-exceptions-options {
72+
padding-top: 4px;
73+
padding-bottom: 4px;
6574
}
6675

67-
html[dir="rtl"] .breakpoints-exceptions-caught {
68-
padding: 0 3em 0.5em 1em;
76+
.xhr-breakpoints-pane .breakpoints-exceptions-options {
77+
border-bottom: 1px solid var(--theme-splitter-color);
6978
}
7079

7180
.breakpoints-exceptions-options:not(.empty) {
7281
border-bottom: 1px solid var(--theme-splitter-color);
73-
margin-bottom: 3px;
7482
}
7583

7684
.breakpoints-exceptions input,
7785
.breakpoints-exceptions-caught input {
7886
padding-inline-start: 2px;
87+
margin-top: 0px;
88+
margin-bottom: 0px;
7989
margin-inline-start: 0;
90+
margin-inline-end: 2px;
8091
vertical-align: text-bottom;
8192
}
8293

8394
.breakpoint-exceptions-label {
84-
padding-top: 2px;
85-
padding-inline-start: 2px;
95+
line-height: 14px;
8696
padding-inline-end: 8px;
8797
cursor: default;
88-
}
89-
90-
.breakpoints-list .breakpoint,
91-
.breakpoints-exceptions,
92-
.breakpoints-exceptions-caught {
93-
display: flex;
94-
align-items: center;
98+
overflow: hidden;
99+
text-overflow: ellipsis;
95100
}
96101

97102
html[dir="rtl"] .breakpoints-list .breakpoint,
@@ -128,11 +133,17 @@ html .breakpoints-list .breakpoint.paused {
128133
background-color: var(--search-overlays-semitransparent);
129134
}
130135

136+
.breakpoint-line-close {
137+
margin-inline-start: 4px;
138+
}
139+
131140
.breakpoints-list .breakpoint .breakpoint-line {
132141
font-size: 11px;
133142
color: var(--theme-comment);
134143
min-width: 16px;
135144
text-align: end;
145+
padding-top: 1px;
146+
padding-bottom: 1px;
136147
}
137148

138149
.breakpoints-list .breakpoint:hover .breakpoint-line,
@@ -145,24 +156,24 @@ html .breakpoints-list .breakpoint.paused {
145156
}
146157

147158
.breakpoints-list .breakpoint-label {
148-
max-width: calc(100% - var(--breakpoint-expression-right-clear-space));
149159
display: inline-block;
150-
padding-inline-end: 8px;
151160
cursor: pointer;
152161
flex-grow: 1;
153162
text-overflow: ellipsis;
154163
overflow: hidden;
155-
padding-top: 2px;
156164
font-size: 11px;
157165
}
158166

159-
.breakpoints-list .breakpoint-label,
167+
.breakpoints-list .breakpoint-label span,
160168
.breakpoint-line-close {
161-
line-height: 1.4em;
169+
display: inline;
170+
line-height: 14px;
162171
}
163172

164173
.breakpoint-checkbox {
165-
margin-inline-start: 0;
174+
margin-inline-start: 0px;
175+
margin-top: 0px;
176+
margin-bottom: 0px;
166177
vertical-align: text-bottom;
167178
}
168179

src/components/SecondaryPanes/Breakpoints/index.js

+34-28
Original file line numberDiff line numberDiff line change
@@ -77,43 +77,49 @@ class Breakpoints extends Component<Props> {
7777

7878
renderBreakpoints() {
7979
const { breakpointSources, selectedSource } = this.props;
80+
if (!breakpointSources.length) {
81+
return null;
82+
}
83+
8084
const sources = [
8185
...breakpointSources.map(({ source, breakpoints }) => source)
8286
];
8387

84-
return [
85-
...breakpointSources.map(({ source, breakpoints, i }) => {
86-
const path = getDisplayPath(source, sources);
87-
const sortedBreakpoints = sortSelectedBreakpoints(
88-
breakpoints,
89-
selectedSource
90-
);
91-
92-
return [
93-
<BreakpointHeading
94-
source={source}
95-
sources={sources}
96-
path={path}
97-
key={source.url}
98-
/>,
99-
...sortedBreakpoints.map(breakpoint => (
100-
<Breakpoint
101-
breakpoint={breakpoint}
88+
return (
89+
<div className="pane breakpoints-list">
90+
{breakpointSources.map(({ source, breakpoints, i }) => {
91+
const path = getDisplayPath(source, sources);
92+
const sortedBreakpoints = sortSelectedBreakpoints(
93+
breakpoints,
94+
selectedSource
95+
);
96+
97+
return [
98+
<BreakpointHeading
10299
source={source}
103-
selectedSource={selectedSource}
104-
key={makeBreakpointId(
105-
getSelectedLocation(breakpoint, selectedSource)
106-
)}
107-
/>
108-
))
109-
];
110-
})
111-
];
100+
sources={sources}
101+
path={path}
102+
key={source.url}
103+
/>,
104+
...sortedBreakpoints.map(breakpoint => (
105+
<Breakpoint
106+
breakpoint={breakpoint}
107+
source={source}
108+
selectedSource={selectedSource}
109+
key={makeBreakpointId(
110+
getSelectedLocation(breakpoint, selectedSource)
111+
)}
112+
/>
113+
))
114+
];
115+
})}
116+
</div>
117+
);
112118
}
113119

114120
render() {
115121
return (
116-
<div className="pane breakpoints-list">
122+
<div>
117123
{this.renderExceptionsOptions()}
118124
{this.renderBreakpoints()}
119125
</div>

src/components/SecondaryPanes/Expressions.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
.expressions-list {
4545
/* TODO: add normalize */
4646
margin: 0;
47-
padding: 0;
47+
padding: 4px 0px;
4848
}
4949

5050
.expression-input-container {

src/components/SecondaryPanes/SecondaryPanes.css

+5
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,8 @@
5757
width: 20em;
5858
overflow: auto;
5959
}
60+
61+
.secondary-panes input[type="checkbox"] {
62+
margin: 0;
63+
margin-inline-end: 4px;
64+
}

src/components/SecondaryPanes/XHRBreakpoints.css

+17-28
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
44

55
.xhr-input-container {
6-
display: block;
6+
display: flex;
77
border: 1px solid transparent;
88
}
99

@@ -19,27 +19,25 @@
1919
border: 1px solid red;
2020
}
2121

22-
.xhr-container label {
23-
display: flex;
24-
}
25-
2622
.xhr-input-form {
2723
display: inline-flex;
2824
width: 100%;
29-
padding: 0.5em 1em 0.5em 1em;
25+
padding-inline-start: 20px;
26+
padding-inline-end: 12px;
3027
}
3128

3229
.xhr-checkbox {
3330
margin-inline-start: 0;
31+
margin-inline-end: 4px;
3432
}
3533

3634
.xhr-input-url {
3735
border: 1px;
38-
padding: 0em 0.6em 0em 0.6em;
36+
padding: 3px 0px;
3937
flex-grow: 1;
4038
background-color: var(--theme-sidebar-background);
41-
font-size: 12px;
42-
line-height: 18px;
39+
font-size: inherit;
40+
line-height: 14px;
4341
color: var(--theme-body-color);
4442
}
4543

@@ -57,26 +55,26 @@
5755
border-left: 4px solid transparent;
5856
width: 100%;
5957
color: var(--theme-body-color);
60-
padding: 0.25em 1em;
58+
padding-inline-start: 16px;
59+
padding-inline-end: 12px;
6160
background-color: var(--theme-body-background);
6261
display: flex;
6362
align-items: center;
6463
position: relative;
65-
min-height: var(--breakpoint-expression-height);
6664
}
6765

6866
:root.theme-light .xhr-container:hover {
69-
background-color: var(--theme-selection-background-hover);
67+
background-color: var(--search-overlays-semitransparent);
7068
}
7169

7270
:root.theme-dark .xhr-container:hover {
73-
background-color: var(--theme-selection-background-hover);
71+
background-color: var(--search-overlays-semitransparent);
7472
}
7573

7674
.xhr-label-method {
77-
padding: 0px 2px 0px 2px;
78-
line-height: 15px;
75+
line-height: 14px;
7976
display: inline-block;
77+
margin-inline-end: 2px;
8078
}
8179

8280
.xhr-input-method {
@@ -96,27 +94,18 @@
9694
text-overflow: ellipsis;
9795
overflow: hidden;
9896
padding: 0px 2px 0px 2px;
99-
line-height: 15px;
100-
font-size: 11px;
97+
line-height: 14px;
10198
}
10299

103100
.xhr-container label {
104101
flex-grow: 1;
105102
display: flex;
106-
padding-inline-end: 36px;
107103
align-items: center;
108104
overflow-x: hidden;
109105
}
110106

111107
.xhr-container__close-btn {
112-
position: absolute;
113-
top: calc(50% - 8px);
114-
}
115-
116-
[dir="ltr"] .xhr-container__close-btn {
117-
right: 12px;
118-
}
119-
120-
[dir="rtl"] .xhr-container__close-btn {
121-
left: 12px;
108+
display: flex;
109+
padding-top: 2px;
110+
padding-bottom: 2px;
122111
}

src/components/shared/Accordion.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575
.accordion ._content {
7676
border-bottom: 1px solid var(--theme-splitter-color);
77-
font-size: 12px;
77+
font-size: var(--theme-body-font-size);
7878
}
7979

8080
.accordion div:last-child ._content {

test/mochitest/browser_dbg-breakpoints-actions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
44

55
function openFirstBreakpointContextMenu(dbg) {
6-
rightClickElement(dbg, "breakpointItem", 3);
6+
rightClickElement(dbg, "breakpointItem", 2);
77
}
88

99
// Tests to see if we can trigger a breakpoint action via the context menu

0 commit comments

Comments
 (0)