markup.css 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. :root {
  5. --markup-outline: var(--theme-splitter-color);
  6. }
  7. .theme-dark:root {
  8. --markup-outline: var(--theme-highlight-pink);
  9. }
  10. * {
  11. padding: 0;
  12. margin: 0;
  13. }
  14. :root {
  15. -moz-control-character-visibility: visible;
  16. }
  17. body {
  18. -moz-user-select: none;
  19. }
  20. /* Force height and width (possibly overflowing) from inline elements.
  21. * This allows long overflows of text or input fields to still be styled with
  22. * the container, rather than the background disappearing when scrolling */
  23. #root {
  24. float: left;
  25. min-width: 100%;
  26. }
  27. /* Don't display a parent-child outline for the root elements */
  28. #root > ul > li > .children {
  29. background: none;
  30. }
  31. html.dragging {
  32. overflow-x: hidden;
  33. }
  34. body.dragging .tag-line {
  35. cursor: grabbing;
  36. }
  37. #root-wrapper:after {
  38. content: "";
  39. display: block;
  40. clear: both;
  41. position:relative;
  42. }
  43. .html-editor {
  44. display: none;
  45. position: absolute;
  46. z-index: 2;
  47. /* Use the same margin/padding trick used by .child tags to ensure that
  48. * the editor covers up any content to the left (including expander arrows
  49. * and hover effects). */
  50. margin-left: -1000em;
  51. padding-left: 1000em;
  52. }
  53. .html-editor-inner {
  54. border: solid .1px;
  55. flex: 1 1 auto;
  56. /* Keep the editor away from the markup view floating scrollbars */
  57. margin-inline-end: 12px;
  58. }
  59. .html-editor iframe {
  60. height: 100%;
  61. width: 100%;
  62. border: none;
  63. margin: 0;
  64. padding: 0;
  65. }
  66. .children {
  67. list-style: none;
  68. padding: 0;
  69. margin: 0;
  70. }
  71. /* Tags are organized in a UL/LI tree and indented thanks to a left padding.
  72. * A very large padding is used in combination with a slightly smaller margin
  73. * to make sure childs actually span from edge-to-edge. */
  74. .child {
  75. margin-left: -1000em;
  76. padding-left: 1001em;
  77. }
  78. /* Normally this element takes space in the layout even if it's position: relative
  79. * by adding height: 0 we let surrounding elements to fill the blank space */
  80. .child.dragging {
  81. position: relative;
  82. pointer-events: none;
  83. opacity: 0.7;
  84. z-index: 1;
  85. height: 0;
  86. }
  87. /* Indicates a tag-line in the markup-view as being an active drop target by
  88. * drawing a horizontal line where the dragged element would be inserted if
  89. * dropped here */
  90. .tag-line.drop-target::before,
  91. .tag-line.drag-target::before {
  92. content: '';
  93. position: absolute;
  94. top: 0;
  95. width: 100%;
  96. /* Offset these by 1000px to make sure they cover the full width of the view */
  97. padding-left: 1000px;
  98. left: -1000px;
  99. }
  100. .tag-line.drag-target::before {
  101. border-top: 2px solid var(--theme-content-color2);
  102. }
  103. .tag-line.drop-target::before {
  104. border-top: 2px solid var(--theme-contrast-background);
  105. }
  106. /* In case the indicator is put on the closing .tag-line, the indentation level
  107. * will become misleading, so we push it forward to match the indentation level */
  108. ul.children + .tag-line::before {
  109. margin-left: 14px;
  110. }
  111. .tag-line {
  112. min-height: 1.4em;
  113. line-height: 1.4em;
  114. position: relative;
  115. cursor: default;
  116. padding-left: 2px;
  117. }
  118. .tag-line[selected] + .children {
  119. background-image: linear-gradient(to top, var(--markup-outline), var(--markup-outline));
  120. background-repeat: no-repeat;
  121. /* Shorten the outline height by 4px to account for the 2px top padding and
  122. * allow for a 2px bottom padding */
  123. background-size: 1.5px calc(100% - 4px);
  124. /* Align the outline to under the expander arrow and provide 2px top
  125. * padding */
  126. background-position: -6px 2px;
  127. border-left: 6px solid transparent;
  128. margin-left: -6px;
  129. }
  130. .html-editor-container {
  131. position: relative;
  132. min-height: 200px;
  133. }
  134. /* This extra element placed in each tag is positioned absolutely to cover the
  135. * whole tag line and is used for background styling (when a selection is made
  136. * or when the tag is flashing) */
  137. .tag-line .tag-state {
  138. position: absolute;
  139. left: -1000em;
  140. right: 0;
  141. height: 100%;
  142. z-index: 0;
  143. }
  144. .expander {
  145. display: inline-block;
  146. margin-left: -14px;
  147. vertical-align: middle;
  148. /* Make sure the expander still appears above the tag-state */
  149. position: relative;
  150. z-index: 1;
  151. }
  152. .child.collapsed .child, .child.collapsed .children {
  153. display: none;
  154. }
  155. .child > .tag-line:first-child .close {
  156. display: none;
  157. }
  158. .child.collapsed > .tag-line:first-child .close {
  159. display: inline;
  160. }
  161. .child.collapsed > .tag-line ~ .tag-line {
  162. display: none;
  163. }
  164. .child.collapsed .close {
  165. display: inline;
  166. }
  167. .expandable.collapsed .close::before {
  168. /* Display an ellipsis character in collapsed nodes that can be expanded. */
  169. content: "\2026";
  170. display: inline-block;
  171. width: 12px;
  172. height: 8px;
  173. margin: 0 2px;
  174. line-height: 3px;
  175. color: var(--theme-body-color-inactive);
  176. border-radius: 3px;
  177. border-style: solid;
  178. border-width: 1px;
  179. text-align: center;
  180. vertical-align: middle;
  181. }
  182. /* Hide HTML void elements (img, hr, br, …) closing tag when the element is not
  183. * expanded (it can be if it has pseudo-elements attached) */
  184. .child.collapsed > .tag-line .void-element .close {
  185. display: none;
  186. }
  187. .closing-bracket {
  188. pointer-events: none;
  189. }
  190. .newattr {
  191. display: inline-block;
  192. width: 1em;
  193. height: 1ex;
  194. margin-right: -1em;
  195. padding: 1px 0;
  196. }
  197. .attr-value .link {
  198. text-decoration: underline;
  199. }
  200. .newattr:focus {
  201. margin-right: 0;
  202. }
  203. .flash-out {
  204. transition: background .5s;
  205. }
  206. .markupview-events {
  207. display: none;
  208. cursor: pointer;
  209. }
  210. .editor {
  211. /* Make sure the editor still appears above the tag-state */
  212. position: relative;
  213. z-index: 1;
  214. }
  215. .editor.text {
  216. display: inline-block;
  217. }
  218. .editor.text pre,
  219. .editor.comment pre {
  220. font: inherit;
  221. }
  222. /* Whitespace only text nodes are sometimes shown in the markup-view, and when they do
  223. they get a greyed-out whitespace symbol so users know what they are */
  224. .editor.text .whitespace {
  225. padding: 0 .5em;
  226. }
  227. .editor.text .whitespace::before {
  228. content: "";
  229. display: inline-block;
  230. height: 4px;
  231. width: 4px;
  232. border: 1px solid var(--theme-body-color-inactive);
  233. border-radius: 50%;
  234. }
  235. .tag-line[selected] .editor.text .whitespace::before {
  236. border-color: white;
  237. }
  238. .more-nodes {
  239. padding-left: 16px;
  240. }
  241. .styleinspector-propertyeditor {
  242. border: 1px solid #CCC;
  243. }
  244. /* Draw a circle next to nodes that have a pseudo class lock.
  245. Center vertically with the 1.4em line height on .tag-line */
  246. .child.pseudoclass-locked::before {
  247. content: "";
  248. background: var(--theme-highlight-lightorange);
  249. border-radius: 50%;
  250. width: .8em;
  251. height: .8em;
  252. margin-top: .3em;
  253. left: 1px;
  254. position: absolute;
  255. z-index: 1;
  256. }
  257. /* Firebug Theme */
  258. .theme-firebug .theme-fg-color3 {
  259. color: var(--theme-graphs-full-blue);
  260. }
  261. .theme-firebug .open,
  262. .theme-firebug .close,
  263. .theme-firebug .attr-name.theme-fg-color2 {
  264. color: var(--theme-highlight-purple);
  265. }
  266. .theme-firebug .attr-value.theme-fg-color6 {
  267. color: var(--theme-highlight-red);
  268. }
  269. .theme-firebug .markupview-events {
  270. font-size: var(--theme-toolbar-font-size);
  271. }
  272. /* Selected nodes in the tree should have light selected text.
  273. theme-selected doesn't work in this case since the text is a
  274. sibling of the class, not a child. */
  275. .theme-selected ~ .editor,
  276. .theme-selected ~ .editor .theme-fg-color1,
  277. .theme-selected ~ .editor .theme-fg-color2,
  278. .theme-selected ~ .editor .theme-fg-color3,
  279. .theme-selected ~ .editor .theme-fg-color4,
  280. .theme-selected ~ .editor .theme-fg-color5,
  281. .theme-selected ~ .editor .theme-fg-color6,
  282. .theme-selected ~ .editor .theme-fg-color7,
  283. .theme-selected ~ .editor .close::before {
  284. color: var(--theme-selection-color);
  285. }
  286. /* Make sure even text nodes are white when selected in the Inspector panel. */
  287. .theme-firebug .theme-selected ~ .editor .open,
  288. .theme-firebug .theme-selected ~ .editor .close {
  289. color: var(--theme-selection-color);
  290. }
  291. /* In case a node isn't displayed in the page, we fade the syntax highlighting */
  292. .not-displayed .open,
  293. .not-displayed .close {
  294. opacity: .7;
  295. }
  296. /* Events */
  297. .markupview-events {
  298. font-size: 8px;
  299. font-weight: bold;
  300. line-height: 10px;
  301. border-radius: 3px;
  302. padding: 0px 2px;
  303. margin-inline-start: 5px;
  304. -moz-user-select: none;
  305. }
  306. .markupview-events {
  307. background-color: var(--theme-body-color-alt);
  308. color: var(--theme-body-background);
  309. }