summaryrefslogtreecommitdiffstats
path: root/devtools/client/themes/markup.css
blob: 0569b7ce76b726c916a28bd4eea3a814b610f5f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

:root {
  --markup-outline: var(--theme-splitter-color);
}

.theme-dark:root {
  --markup-outline: var(--theme-highlight-pink);
}

* {
  padding: 0;
  margin: 0;
}

:root {
  -moz-control-character-visibility: visible;
}

body {
  -moz-user-select: none;
}

/* Force height and width (possibly overflowing) from inline elements.
 * This allows long overflows of text or input fields to still be styled with
 * the container, rather than the background disappearing when scrolling */
#root {
  float: left;
  min-width: 100%;
}

/* Don't display a parent-child outline for the root elements */
#root > ul > li > .children {
  background: none;
}

html.dragging {
  overflow-x: hidden;
}

body.dragging .tag-line {
  cursor: grabbing;
}

#root-wrapper:after {
   content: "";
   display: block;
   clear: both;
   position:relative;
}

.html-editor {
  display: none;
  position: absolute;
  z-index: 2;

  /* Use the same margin/padding trick used by .child tags to ensure that
   * the editor covers up any content to the left (including expander arrows
   * and hover effects). */
  margin-left: -1000em;
  padding-left: 1000em;
}

.html-editor-inner {
  border: solid .1px;
  flex: 1 1 auto;

  /* Keep the editor away from the markup view floating scrollbars */
  margin-inline-end: 12px;
}

.html-editor iframe {
  height: 100%;
  width: 100%;
  border: none;
  margin: 0;
  padding: 0;
}

.children {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Tags are organized in a UL/LI tree and indented thanks to a left padding.
 * A very large padding is used in combination with a slightly smaller margin
 * to make sure childs actually span from edge-to-edge. */
.child {
  margin-left: -1000em;
  padding-left: 1001em;
}

/* Normally this element takes space in the layout even if it's position: relative
 * by adding height: 0 we let surrounding elements to fill the blank space */
.child.dragging {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
  z-index: 1;
  height: 0;
}

/* Indicates a tag-line in the markup-view as being an active drop target by
 * drawing a horizontal line where the dragged element would be inserted if
 * dropped here */
.tag-line.drop-target::before,
.tag-line.drag-target::before {
  content: '';
  position: absolute;
  top: 0;
  width: 100%;
  /* Offset these by 1000px to make sure they cover the full width of the view */
  padding-left: 1000px;
  left: -1000px;
}

.tag-line.drag-target::before {
  border-top: 2px solid var(--theme-content-color2);
}

.tag-line.drop-target::before {
  border-top: 2px solid var(--theme-contrast-background);
}

/* In case the indicator is put on the closing .tag-line, the indentation level
 * will become misleading, so we push it forward to match the indentation level */
ul.children + .tag-line::before {
  margin-left: 14px;
}

.tag-line {
  min-height: 1.4em;
  line-height: 1.4em;
  position: relative;
  cursor: default;
  padding-left: 2px;
}

.tag-line[selected] + .children {
  background-image: linear-gradient(to top, var(--markup-outline), var(--markup-outline));
  background-repeat: no-repeat;
  /* Shorten the outline height by 4px to account for the 2px top padding and
   * allow for a 2px bottom padding */
  background-size: 1.5px calc(100% - 4px);
  /* Align the outline to under the expander arrow and provide 2px top
   * padding */
  background-position: -6px 2px;
  border-left: 6px solid transparent;
  margin-left: -6px;
}

.html-editor-container {
  position: relative;
  min-height: 200px;
}

/* This extra element placed in each tag is positioned absolutely to cover the
 * whole tag line and is used for background styling (when a selection is made
 * or when the tag is flashing) */
.tag-line .tag-state {
  position: absolute;
  left: -1000em;
  right: 0;
  height: 100%;
  z-index: 0;
}

.expander {
  display: inline-block;
  margin-left: -14px;
  vertical-align: middle;
  /* Make sure the expander still appears above the tag-state */
  position: relative;
  z-index: 1;
}

.child.collapsed .child, .child.collapsed .children {
  display: none;
}

.child > .tag-line:first-child .close {
  display: none;
}

.child.collapsed > .tag-line:first-child .close {
  display: inline;
}

.child.collapsed > .tag-line ~ .tag-line {
  display: none;
}

.child.collapsed .close {
  display: inline;
}

.expandable.collapsed .close::before {
  /* Display an ellipsis character in collapsed nodes that can be expanded. */
  content: "\2026";
  display: inline-block;
  width: 12px;
  height: 8px;
  margin: 0 2px;
  line-height: 3px;
  color: var(--theme-body-color-inactive);
  border-radius: 3px;
  border-style: solid;
  border-width: 1px;
  text-align: center;
  vertical-align: middle;
}

/* Hide HTML void elements (img, hr, br, …) closing tag when the element is not
 * expanded (it can be if it has pseudo-elements attached) */
.child.collapsed > .tag-line .void-element .close {
  display: none;
}

.closing-bracket {
  pointer-events: none;
}

.newattr {
  display: inline-block;
  width: 1em;
  height: 1ex;
  margin-right: -1em;
  padding: 1px 0;
}

.attr-value .link {
  text-decoration: underline;
}

.newattr:focus {
  margin-right: 0;
}

.flash-out {
  transition: background .5s;
}

.markupview-events {
  display: none;
  cursor: pointer;
}

.editor {
  /* Make sure the editor still appears above the tag-state */
  position: relative;
  z-index: 1;
}

.editor.text {
  display: inline-block;
}

.editor.text pre,
.editor.comment pre {
  font: inherit;
}

/* Whitespace only text nodes are sometimes shown in the markup-view, and when they do
   they get a greyed-out whitespace symbol so users know what they are */
.editor.text .whitespace {
  padding: 0 .5em;
}

.editor.text .whitespace::before {
  content: "";
  display: inline-block;
  height: 4px;
  width: 4px;
  border: 1px solid var(--theme-body-color-inactive);
  border-radius: 50%;
}

.tag-line[selected] .editor.text .whitespace::before {
  border-color: white;
}

.more-nodes {
  padding-left: 16px;
}

.styleinspector-propertyeditor {
  border: 1px solid #CCC;
}

/* Draw a circle next to nodes that have a pseudo class lock.
   Center vertically with the 1.4em line height on .tag-line */
.child.pseudoclass-locked::before {
  content: "";
  background: var(--theme-highlight-lightorange);
  border-radius: 50%;
  width: .8em;
  height: .8em;
  margin-top: .3em;
  left: 1px;
  position: absolute;
  z-index: 1;
}

/* Firebug Theme */

.theme-firebug .theme-fg-color3 {
  color: var(--theme-graphs-full-blue);
}

.theme-firebug .open,
.theme-firebug .close,
.theme-firebug .attr-name.theme-fg-color2 {
  color: var(--theme-highlight-purple);
}

.theme-firebug .attr-value.theme-fg-color6 {
  color: var(--theme-highlight-red);
}

.theme-firebug .markupview-events {
  font-size: var(--theme-toolbar-font-size);
}

/* Selected nodes in the tree should have light selected text.
   theme-selected doesn't work in this case since the text is a
   sibling of the class, not a child. */
.theme-selected ~ .editor,
.theme-selected ~ .editor .theme-fg-color1,
.theme-selected ~ .editor .theme-fg-color2,
.theme-selected ~ .editor .theme-fg-color3,
.theme-selected ~ .editor .theme-fg-color4,
.theme-selected ~ .editor .theme-fg-color5,
.theme-selected ~ .editor .theme-fg-color6,
.theme-selected ~ .editor .theme-fg-color7,
.theme-selected ~ .editor .close::before {
  color: var(--theme-selection-color);
}

/* Make sure even text nodes are white when selected in the Inspector panel. */
.theme-firebug .theme-selected ~ .editor .open,
.theme-firebug .theme-selected ~ .editor .close {
  color: var(--theme-selection-color);
}

/* In case a node isn't displayed in the page, we fade the syntax highlighting */
.not-displayed .open,
.not-displayed .close {
  opacity: .7;
}

/* Events */
.markupview-events {
  font-size: 8px;
  font-weight: bold;
  line-height: 10px;
  border-radius: 3px;
  padding: 0px 2px;
  margin-inline-start: 5px;
  -moz-user-select: none;
}

.markupview-events {
  background-color: var(--theme-body-color-alt);
  color: var(--theme-body-background);
}