rules.css 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  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. /* CSS Variables specific to this panel that aren't defined by the themes */
  5. .theme-light {
  6. --rule-highlight-background-color: #ffee99;
  7. }
  8. .theme-dark {
  9. --rule-highlight-background-color: #594724;
  10. }
  11. .theme-firebug {
  12. --rule-highlight-background-color: #ffee99;
  13. --rule-property-name: darkgreen;
  14. --rule-property-value: darkblue;
  15. }
  16. /* Rule View Tabpanel */
  17. .theme-firebug .ruleview {
  18. font-family: monospace;
  19. font-size: 11px;
  20. }
  21. #sidebar-panel-ruleview {
  22. margin: 0;
  23. display: flex;
  24. flex-direction: column;
  25. width: 100%;
  26. height: 100%;
  27. /* Override the min-width from .inspector-tabpanel, as the rule panel can support small
  28. widths */
  29. min-width: 100px;
  30. }
  31. /* Rule View Toolbar */
  32. #ruleview-toolbar-container {
  33. display: flex;
  34. flex-direction: column;
  35. height: auto;
  36. }
  37. #ruleview-toolbar {
  38. display: flex;
  39. }
  40. #ruleview-toolbar > .devtools-searchbox:first-child {
  41. padding-inline-start: 0px;
  42. }
  43. #ruleview-command-toolbar {
  44. display: flex;
  45. }
  46. #pseudo-class-panel {
  47. display: flex;
  48. height: 24px;
  49. overflow: hidden;
  50. transition: height 150ms ease;
  51. }
  52. #pseudo-class-panel[hidden] {
  53. height: 0px;
  54. }
  55. #pseudo-class-panel > label {
  56. -moz-user-select: none;
  57. flex-grow: 1;
  58. display: flex;
  59. align-items: center;
  60. }
  61. /* Rule View Container */
  62. #ruleview-container {
  63. -moz-user-select: text;
  64. overflow: auto;
  65. flex: auto;
  66. height: 100%;
  67. }
  68. /* This extra wrapper only serves as a way to get the content of the view focusable.
  69. So that when the user reaches it either via keyboard or mouse, we know that the view
  70. is focused and therefore can handle shortcuts.
  71. However, for accessibility reasons, tabindex is set to -1 to avoid having to tab
  72. through it, and the outline is hidden. */
  73. #ruleview-container-focusable {
  74. height: 100%;
  75. outline: none;
  76. }
  77. #ruleview-container.non-interactive {
  78. pointer-events: none;
  79. visibility: collapse;
  80. transition: visibility 0.25s;
  81. }
  82. .ruleview-code {
  83. direction: ltr;
  84. }
  85. .ruleview-property:not(:hover) > .ruleview-enableproperty {
  86. pointer-events: none;
  87. }
  88. .ruleview-expandable-container[hidden] {
  89. display: none;
  90. }
  91. .ruleview-expandable-container {
  92. display: block;
  93. }
  94. .ruleview-namecontainer {
  95. cursor: text;
  96. }
  97. .ruleview-propertyvaluecontainer {
  98. cursor: text;
  99. padding-right: 5px;
  100. }
  101. .ruleview-propertyvaluecontainer a {
  102. cursor: pointer;
  103. }
  104. .ruleview-computedlist,
  105. .ruleview-overridden-rule-filter[hidden],
  106. .ruleview-warning[hidden] {
  107. display: none;
  108. }
  109. .ruleview-computedlist[user-open],
  110. .ruleview-computedlist[filter-open] {
  111. display: block;
  112. }
  113. .ruleview-rule-source {
  114. text-align: end;
  115. float: right;
  116. max-width: 100%;
  117. /* Force RTL direction to crop the source link at the beginning. */
  118. direction: rtl;
  119. overflow: hidden;
  120. text-overflow: ellipsis;
  121. -moz-user-select: none;
  122. margin-bottom: 2px;
  123. }
  124. .ruleview-rule-source-label {
  125. white-space: nowrap;
  126. margin: 0;
  127. cursor: pointer;
  128. /* Create an LTR embed to avoid special characters being shifted to the start due to the
  129. parent node direction: rtl; */
  130. direction: ltr;
  131. unicode-bidi: embed
  132. }
  133. .ruleview-rule-source[unselectable],
  134. .ruleview-rule-source[unselectable] > .ruleview-rule-source-label {
  135. cursor: default;
  136. }
  137. .theme-firebug .ruleview-rule-source-label {
  138. font-family: var(--proportional-font-family);
  139. font-weight: bold;
  140. color: #0000FF;
  141. }
  142. .ruleview-rule-source:not([unselectable]):hover {
  143. text-decoration: underline;
  144. }
  145. .ruleview-header {
  146. border-top-width: 1px;
  147. border-bottom-width: 1px;
  148. border-top-style: solid;
  149. border-bottom-style: solid;
  150. padding: 1px 4px;
  151. -moz-user-select: none;
  152. word-wrap: break-word;
  153. vertical-align: middle;
  154. min-height: 1.5em;
  155. line-height: 1.5em;
  156. margin-top: -1px;
  157. }
  158. .theme-firebug .theme-gutter.ruleview-header {
  159. font-family: var(--proportional-font-family);
  160. font-weight: bold;
  161. color: inherit;
  162. border: none;
  163. margin: 4px 0;
  164. padding: 3px 4px 2px 4px;
  165. line-height: inherit;
  166. min-height: 0;
  167. background: var(--theme-header-background);
  168. }
  169. :root[platform="win"] .ruleview-header,
  170. :root[platform="linux"] .ruleview-header {
  171. margin-top: 4px;
  172. }
  173. .ruleview-header.ruleview-expandable-header {
  174. cursor: pointer;
  175. }
  176. .ruleview-rule-pseudo-element {
  177. padding-left:20px;
  178. border-left: solid 10px;
  179. }
  180. .ruleview-rule {
  181. padding: 2px 4px;
  182. }
  183. /**
  184. * Display rules that don't match the current selected element and uneditable
  185. * user agent styles differently
  186. */
  187. .ruleview-rule[unmatched=true],
  188. .ruleview-rule[uneditable=true] {
  189. background: var(--theme-tab-toolbar-background);
  190. }
  191. .ruleview-rule[unmatched=true] {
  192. opacity: 0.5;
  193. }
  194. .ruleview-rule[uneditable=true] :focus {
  195. outline: none;
  196. }
  197. .ruleview-rule[uneditable=true] .theme-link {
  198. color: var(--theme-highlight-bluegrey);
  199. }
  200. .ruleview-rule[uneditable=true] .ruleview-enableproperty {
  201. visibility: hidden;
  202. }
  203. .ruleview-rule[uneditable=true] .ruleview-swatch {
  204. cursor: default;
  205. }
  206. .ruleview-rule[uneditable=true] .ruleview-namecontainer > .ruleview-propertyname,
  207. .ruleview-rule[uneditable=true] .ruleview-propertyvaluecontainer >
  208. .ruleview-propertyvalue {
  209. border-bottom-color: transparent;
  210. }
  211. .theme-firebug .ruleview-namecontainer > .ruleview-propertyname,
  212. .theme-firebug .ruleview-propertyvaluecontainer > .ruleview-propertyvalue {
  213. border-bottom: none;
  214. }
  215. .theme-firebug .ruleview-namecontainer > .ruleview-propertyname {
  216. color: var(--rule-property-name);
  217. }
  218. .theme-firebug .ruleview-propertyvaluecontainer > .ruleview-propertyvalue {
  219. color: var(--rule-property-value);
  220. }
  221. .theme-firebug .ruleview-overridden .ruleview-propertyname,
  222. .theme-firebug .ruleview-overridden .ruleview-propertyvalue {
  223. text-decoration: line-through;
  224. }
  225. .theme-firebug .ruleview-enableproperty:not([checked]) ~ .ruleview-namecontainer,
  226. .theme-firebug .ruleview-enableproperty:not([checked]) ~ .ruleview-namecontainer *,
  227. .theme-firebug .ruleview-enableproperty:not([checked]) ~ .ruleview-propertyvaluecontainer,
  228. .theme-firebug .ruleview-enableproperty:not([checked]) ~ .ruleview-propertyvaluecontainer *,
  229. .theme-firebug .ruleview-overridden > * > .ruleview-computed:not(.ruleview-overridden),
  230. .theme-firebug .ruleview-overridden > * > .ruleview-computed:not(.ruleview-overridden) * {
  231. color: #CCCCCC;
  232. }
  233. .ruleview-rule + .ruleview-rule {
  234. border-top-width: 1px;
  235. border-top-style: dotted;
  236. }
  237. .theme-firebug .ruleview-rule + .ruleview-rule {
  238. border-top: none;
  239. }
  240. .ruleview-warning {
  241. background-image: url(images/alerticon-warning.png);
  242. background-size: 13px 12px;
  243. margin-inline-start: 5px;
  244. display: inline-block;
  245. width: 13px;
  246. height: 12px;
  247. }
  248. @media (min-resolution: 1.1dppx) {
  249. .ruleview-warning {
  250. background-image: url(images/alerticon-warning@2x.png);
  251. }
  252. }
  253. .ruleview-overridden-rule-filter {
  254. background-image: url(chrome://devtools/skin/images/filter.svg#filterinput);
  255. background-size: 11px 11px;
  256. margin-inline-start: 5px;
  257. display: inline-block;
  258. width: 11px;
  259. height: 11px;
  260. }
  261. .ruleview-ruleopen {
  262. padding-inline-end: 5px;
  263. }
  264. .ruleview-ruleclose {
  265. cursor: text;
  266. padding-right: 20px;
  267. }
  268. .ruleview-propertylist {
  269. list-style: none;
  270. padding: 0;
  271. margin: 0;
  272. }
  273. .ruleview-rule:not(:hover) .ruleview-enableproperty {
  274. visibility: hidden;
  275. }
  276. .ruleview-expander {
  277. vertical-align: middle;
  278. display: inline-block;
  279. }
  280. .ruleview-rule .ruleview-expander.theme-twisty:dir(rtl) {
  281. /* for preventing .theme-twisty's wrong direction in rtl; Bug 1296648 */
  282. transform: none;
  283. }
  284. .ruleview-newproperty {
  285. /* (enable checkbox width: 12px) + (expander width: 15px) */
  286. margin-inline-start: 27px;
  287. }
  288. .ruleview-namecontainer,
  289. .ruleview-propertyvaluecontainer,
  290. .ruleview-propertyname,
  291. .ruleview-propertyvalue {
  292. text-decoration: inherit;
  293. }
  294. .ruleview-computedlist {
  295. list-style: none;
  296. padding: 0;
  297. }
  298. .ruleview-computed {
  299. margin-inline-start: 35px;
  300. }
  301. .ruleview-grid,
  302. .ruleview-swatch {
  303. cursor: pointer;
  304. border-radius: 50%;
  305. width: 0.9em;
  306. height: 0.9em;
  307. vertical-align: middle;
  308. /* align the swatch with its value */
  309. margin-top: -1px;
  310. margin-inline-end: 5px;
  311. display: inline-block;
  312. position: relative;
  313. }
  314. .ruleview-grid {
  315. background: url("chrome://devtools/skin/images/grid.svg");
  316. background-size: 1em;
  317. border-radius: 0;
  318. }
  319. .ruleview-colorswatch::before {
  320. content: '';
  321. background-color: #eee;
  322. background-image: linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc),
  323. linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc);
  324. background-size: 12px 12px;
  325. background-position: 0 0, 6px 6px;
  326. position: absolute;
  327. border-radius: 50%;
  328. top: 0;
  329. left: 0;
  330. right: 0;
  331. bottom: 0;
  332. z-index: -1;
  333. }
  334. .ruleview-bezierswatch {
  335. background: url("chrome://devtools/skin/images/cubic-bezier-swatch.png");
  336. background-size: 1em;
  337. }
  338. .ruleview-filterswatch {
  339. background: url("chrome://devtools/skin/images/filter-swatch.svg");
  340. background-size: 1em;
  341. }
  342. .ruleview-angleswatch {
  343. background: url("chrome://devtools/skin/images/angle-swatch.svg");
  344. background-size: 1em;
  345. }
  346. @media (min-resolution: 1.1dppx) {
  347. .ruleview-bezierswatch {
  348. background: url("chrome://devtools/skin/images/cubic-bezier-swatch@2x.png");
  349. background-size: 1em;
  350. }
  351. }
  352. .ruleview-overridden {
  353. text-decoration: line-through;
  354. }
  355. .theme-light .ruleview-overridden {
  356. text-decoration-color: var(--theme-content-color3);
  357. }
  358. .styleinspector-propertyeditor {
  359. border: 1px solid #CCC;
  360. padding: 0;
  361. margin: -1px -3px -1px -1px;
  362. }
  363. .theme-firebug .styleinspector-propertyeditor {
  364. border: 1px solid var(--theme-splitter-color);
  365. box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  366. }
  367. .ruleview-property {
  368. border-left: 3px solid transparent;
  369. clear: right;
  370. }
  371. .ruleview-propertycontainer > * {
  372. vertical-align: middle;
  373. }
  374. .ruleview-property[dirty] {
  375. border-left-color: var(--theme-highlight-green);
  376. }
  377. .ruleview-highlight {
  378. background-color: var(--rule-highlight-background-color);
  379. }
  380. .ruleview-namecontainer > .ruleview-propertyname,
  381. .ruleview-propertyvaluecontainer > .ruleview-propertyvalue {
  382. border-bottom: 1px dashed transparent;
  383. }
  384. .ruleview-namecontainer:hover > .ruleview-propertyname,
  385. .ruleview-propertyvaluecontainer:hover > .ruleview-propertyvalue {
  386. border-bottom-color: hsl(0,0%,50%);
  387. }
  388. .ruleview-selectorcontainer {
  389. word-wrap: break-word;
  390. cursor: text;
  391. }
  392. .ruleview-selector-separator,
  393. .ruleview-selector-unmatched {
  394. color: #888;
  395. }
  396. .ruleview-selector-matched > .ruleview-selector-attribute {
  397. /* TODO: Bug 1178535 Awaiting UX feedback on highlight colors */
  398. }
  399. .ruleview-selector-matched > .ruleview-selector-pseudo-class {
  400. /* TODO: Bug 1178535 Awaiting UX feedback on highlight colors */
  401. }
  402. .ruleview-selector-matched > .ruleview-selector-pseudo-class-lock {
  403. font-weight: bold;
  404. color: var(--theme-highlight-orange);
  405. }
  406. .theme-firebug .ruleview-selector > .ruleview-selector-matched,
  407. .theme-firebug .ruleview-selector > .ruleview-selector-separator,
  408. .theme-firebug .ruleview-selector > .ruleview-selector-unmatched {
  409. color: inherit;
  410. }
  411. .ruleview-selectorhighlighter {
  412. background: url("chrome://devtools/skin/images/vview-open-inspector.png") no-repeat 0 0;
  413. padding-left: 16px;
  414. margin-left: 5px;
  415. cursor: pointer;
  416. }
  417. .ruleview-selectorhighlighter:hover {
  418. filter: url(images/filters.svg#checked-icon-state);
  419. }
  420. .ruleview-grid.active,
  421. .ruleview-selectorhighlighter:active,
  422. .ruleview-selectorhighlighter.highlighted {
  423. filter: url(images/filters.svg#checked-icon-state) brightness(0.9);
  424. }
  425. #ruleview-add-rule-button::before {
  426. background-image: url("chrome://devtools/skin/images/add.svg");
  427. background-size: cover;
  428. }
  429. #pseudo-class-panel-toggle::before {
  430. background-image: url("chrome://devtools/skin/images/pseudo-class.svg");
  431. background-size: cover;
  432. }
  433. .ruleview-overridden-rule-filter {
  434. opacity: 0.8;
  435. }
  436. .ruleview-overridden-rule-filter:hover {
  437. opacity: 1;
  438. }
  439. .theme-firebug .ruleview-overridden {
  440. text-decoration: none;
  441. }
  442. /* Firebug theme disable/enable CSS rule. Firebug theme uses its own
  443. icons to indicate when CSS rules can be disabled or enabled. */
  444. .theme-firebug .ruleview-rule .theme-checkbox {
  445. background-repeat: no-repeat;
  446. background-size: 12px 12px;
  447. background-image: url(chrome://devtools/skin/images/firebug/disable.svg);
  448. background-position: 0 0;
  449. }
  450. .theme-firebug .ruleview-rule .theme-checkbox:not([checked]){
  451. filter: grayscale(1);
  452. }
  453. .theme-firebug .ruleview-rule .theme-checkbox[checked] {
  454. background-position: 0 0;
  455. }
  456. .theme-firebug .ruleview-property:not(:hover) .ruleview-enableproperty {
  457. visibility: hidden;
  458. }