boxmodel.css 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  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. #boxmodel-wrapper {
  5. border-bottom-style: solid;
  6. border-bottom-width: 1px;
  7. border-color: var(--theme-splitter-color);
  8. }
  9. #boxmodel-container {
  10. /* The view will grow bigger as the window gets resized, until 400px */
  11. max-width: 400px;
  12. margin: 0px auto;
  13. padding: 0;
  14. }
  15. /* Header */
  16. #boxmodel-header,
  17. #boxmodel-info {
  18. display: flex;
  19. align-items: center;
  20. padding: 4px 17px;
  21. }
  22. #layout-geometry-editor {
  23. visibility: hidden;
  24. }
  25. #layout-geometry-editor::before {
  26. background: url(images/geometry-editor.svg) no-repeat center center / 16px 16px;
  27. }
  28. /* Main: contains the box-model regions */
  29. #boxmodel-main {
  30. position: relative;
  31. box-sizing: border-box;
  32. /* The regions are semi-transparent, so the white background is partly
  33. visible */
  34. background-color: white;
  35. color: var(--theme-selection-color);
  36. /* Make sure there is some space between the window's edges and the regions */
  37. margin: 0 14px 4px 14px;
  38. width: calc(100% - 2 * 14px);
  39. }
  40. .boxmodel-margin,
  41. .boxmodel-size {
  42. color: var(--theme-highlight-blue);
  43. }
  44. /* Regions are 3 nested elements with wide borders and outlines */
  45. #boxmodel-content {
  46. height: 18px;
  47. }
  48. #boxmodel-margins,
  49. #boxmodel-borders,
  50. #boxmodel-padding {
  51. border-color: hsla(210,100%,85%,0.2);
  52. border-width: 18px;
  53. border-style: solid;
  54. outline: dotted 1px hsl(210,100%,85%);
  55. }
  56. #boxmodel-margins {
  57. /* This opacity applies to all of the regions, since they are nested */
  58. opacity: .8;
  59. }
  60. /* Regions colors */
  61. #boxmodel-margins {
  62. border-color: #edff64;
  63. }
  64. #boxmodel-borders {
  65. border-color: #444444;
  66. }
  67. #boxmodel-padding {
  68. border-color: #6a5acd;
  69. }
  70. #boxmodel-content {
  71. background-color: #87ceeb;
  72. }
  73. .theme-firebug #boxmodel-main,
  74. .theme-firebug #boxmodel-borders,
  75. .theme-firebug #boxmodel-content {
  76. border-style: solid;
  77. }
  78. .theme-firebug #boxmodel-main,
  79. .theme-firebug #boxmodel-header {
  80. font-family: var(--proportional-font-family);
  81. }
  82. .theme-firebug #boxmodel-main {
  83. color: var(--theme-body-color);
  84. font-size: var(--theme-toolbar-font-size);
  85. }
  86. .theme-firebug #boxmodel-header {
  87. font-size: var(--theme-toolbar-font-size);
  88. }
  89. /* Editable region sizes are contained in absolutely positioned <p> */
  90. #boxmodel-main > p {
  91. position: absolute;
  92. pointer-events: none;
  93. margin: 0;
  94. text-align: center;
  95. }
  96. #boxmodel-main > p > span,
  97. #boxmodel-main > p > input {
  98. vertical-align: middle;
  99. pointer-events: auto;
  100. }
  101. /* Coordinates for the region sizes */
  102. .boxmodel-top,
  103. .boxmodel-bottom {
  104. width: calc(100% - 2px);
  105. text-align: center;
  106. }
  107. .boxmodel-padding.boxmodel-top {
  108. top: 37px;
  109. }
  110. .boxmodel-padding.boxmodel-bottom {
  111. bottom: 38px;
  112. }
  113. .boxmodel-border.boxmodel-top {
  114. top: 19px;
  115. }
  116. .boxmodel-border.boxmodel-bottom {
  117. bottom: 20px;
  118. }
  119. .boxmodel-margin.boxmodel-top {
  120. top: 1px;
  121. }
  122. .boxmodel-margin.boxmodel-bottom {
  123. bottom: 2px;
  124. }
  125. .boxmodel-size,
  126. .boxmodel-margin.boxmodel-left,
  127. .boxmodel-margin.boxmodel-right,
  128. .boxmodel-border.boxmodel-left,
  129. .boxmodel-border.boxmodel-right,
  130. .boxmodel-padding.boxmodel-left,
  131. .boxmodel-padding.boxmodel-right {
  132. top: 22px;
  133. line-height: 80px;
  134. }
  135. .boxmodel-size {
  136. width: calc(100% - 2px);
  137. }
  138. .boxmodel-margin.boxmodel-right,
  139. .boxmodel-margin.boxmodel-left,
  140. .boxmodel-border.boxmodel-left,
  141. .boxmodel-border.boxmodel-right,
  142. .boxmodel-padding.boxmodel-right,
  143. .boxmodel-padding.boxmodel-left {
  144. width: 21px;
  145. }
  146. .boxmodel-padding.boxmodel-left {
  147. left: 35px;
  148. }
  149. .boxmodel-padding.boxmodel-right {
  150. right: 35px;
  151. }
  152. .boxmodel-border.boxmodel-left {
  153. left: 16px;
  154. }
  155. .boxmodel-border.boxmodel-right {
  156. right: 17px;
  157. }
  158. .boxmodel-margin.boxmodel-right {
  159. right: 0;
  160. }
  161. .boxmodel-margin.boxmodel-left {
  162. left: 0;
  163. }
  164. .boxmodel-rotate.boxmodel-left:not(.boxmodel-editing) {
  165. transform: rotate(-90deg);
  166. }
  167. .boxmodel-rotate.boxmodel-right:not(.boxmodel-editing) {
  168. transform: rotate(90deg);
  169. }
  170. /* Legend: displayed inside regions */
  171. .boxmodel-legend {
  172. position: absolute;
  173. margin: 2px 6px;
  174. z-index: 1;
  175. }
  176. .boxmodel-legend[data-box="margin"] {
  177. color: var(--theme-highlight-blue);
  178. }
  179. /* Editable fields */
  180. .boxmodel-editable {
  181. border: 1px dashed transparent;
  182. -moz-user-select: text;
  183. }
  184. .boxmodel-editable:hover {
  185. border-bottom-color: hsl(0, 0%, 50%);
  186. }
  187. .styleinspector-propertyeditor {
  188. border: 1px solid #ccc;
  189. padding: 0;
  190. }
  191. /* Make sure the content size doesn't appear as editable like the other sizes */
  192. .boxmodel-size > span {
  193. cursor: default;
  194. }
  195. /* Box Model Info: contains the position and size of the element */
  196. #boxmodel-element-size {
  197. flex: 1;
  198. }
  199. #boxmodel-position-group {
  200. display: flex;
  201. align-items: center;
  202. }