edit.css 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  1. :root {
  2. --header-narrow-min-height: 12em;
  3. }
  4. body {
  5. margin: 0;
  6. font: 12px arial,sans-serif;
  7. }
  8. #global-progress {
  9. position: fixed;
  10. height: 4px;
  11. top: 0;
  12. left: 0;
  13. right: 0;
  14. background-color: hsla(180, 66%, 36%, .25);
  15. border-left: 0 solid darkcyan;
  16. z-index: 2147483647;
  17. opacity: 0;
  18. transition: opacity 2s;
  19. }
  20. #global-progress[title] {
  21. opacity: 1;
  22. }
  23. .hidden {
  24. display: none !important;
  25. }
  26. /************ header ************/
  27. #header {
  28. width: 280px;
  29. height: 100vh;
  30. overflow: auto;
  31. position: fixed;
  32. top: 0;
  33. padding: 15px;
  34. border-right: 1px dashed #AAA;
  35. -webkit-box-shadow: 0 0 3rem -1.2rem black;
  36. box-shadow: 0 0 3rem -1.2rem black;
  37. box-sizing: border-box;
  38. z-index: 10;
  39. }
  40. #header h1 {
  41. margin-top: 0;
  42. }
  43. #sections {
  44. padding-left: 280px;
  45. }
  46. #sections h2 {
  47. margin-top: 1rem;
  48. margin-left: 1.7rem;
  49. }
  50. .aligned {
  51. display: table-row;
  52. }
  53. .aligned > *:not(.svg-inline-wrapper) {
  54. display: table-cell;
  55. margin-top: 0.1rem;
  56. min-height: 1.4rem;
  57. }
  58. input[type="checkbox"] {
  59. margin-left: 0.1rem;
  60. }
  61. /* basic info */
  62. #basic-info {
  63. margin-bottom: 1rem;
  64. }
  65. #name {
  66. width: 100%;
  67. }
  68. #basic-info-name {
  69. display: flex;
  70. align-items: center;
  71. }
  72. #url {
  73. margin-left: 0.25rem;
  74. }
  75. #url:not([href^="http"]) {
  76. display: none;
  77. }
  78. #save-button {
  79. opacity: .5;
  80. pointer-events: none;
  81. }
  82. .dirty #save-button {
  83. opacity: 1;
  84. pointer-events: all;
  85. }
  86. .svg-icon {
  87. cursor: pointer;
  88. vertical-align: middle;
  89. transition: fill .5s;
  90. width: 16px;
  91. height: 16px;
  92. margin-left: 0.2rem;
  93. }
  94. h2 .svg-icon, label .svg-icon {
  95. margin-top: -1px;
  96. }
  97. .svg-icon.info,
  98. .svg-icon.settings {
  99. width: 14px;
  100. height: 16px;
  101. }
  102. .svg-icon:hover,
  103. .svg-icon.info,
  104. .svg-icon.settings {
  105. fill: #666;
  106. }
  107. .svg-icon,
  108. .svg-icon.info:hover,
  109. .svg-icon.settings:hover {
  110. fill: #000;
  111. }
  112. input:invalid {
  113. background-color: rgba(255, 0, 0, 0.1);
  114. color: darkred;
  115. }
  116. #enabled {
  117. margin-left: 0;
  118. vertical-align: middle;
  119. }
  120. #enabled-label {
  121. vertical-align: middle;
  122. }
  123. /* actions */
  124. #actions > * {
  125. margin-right: 0.5rem;
  126. margin-bottom: 0.5rem;
  127. }
  128. /* collapsibles */
  129. #header summary {
  130. align-items: center;
  131. margin-left: -13px;
  132. cursor: pointer;
  133. outline: none;
  134. }
  135. #header summary h2 {
  136. display: inline-block;
  137. border-bottom: 2px dotted transparent;
  138. }
  139. #header summary h2:hover {
  140. border-color: #bbb;
  141. }
  142. #header summary svg {
  143. margin-top: -3px;
  144. }
  145. #options:not([open]) + #lint h2 {
  146. margin-top: 0;
  147. }
  148. #lint:not([open]) h2 {
  149. margin-bottom: 0;
  150. }
  151. /* options */
  152. #options [type="number"] {
  153. width: 3.5em;
  154. text-align: left;
  155. padding-left: .25em;
  156. }
  157. #options .option.aligned > * {
  158. padding-right: 0.25rem;
  159. }
  160. .set-option-progress {
  161. position: absolute;
  162. background-color: currentColor;
  163. content: "";
  164. opacity: .15;
  165. }
  166. /* footer */
  167. #footer {
  168. margin-top: 1em;
  169. margin-bottom: .5em;
  170. }
  171. /************ content ***********/
  172. #sections > div {
  173. margin: 0.7rem;
  174. padding: 1rem;
  175. }
  176. #sections > div:not(:first-of-type) {
  177. border-top: 2px solid black;
  178. }
  179. #sections > div:only-of-type .remove-section {
  180. display: none;
  181. }
  182. #sections > div > button:not(:first-of-type) {
  183. margin-left: 0.2rem;
  184. }
  185. .dirty > label::before {
  186. content: "*";
  187. font-weight: bold;
  188. }
  189. #sections {
  190. counter-reset: codebox;
  191. }
  192. #sections > div > label {
  193. animation: 2s highlight;
  194. animation-play-state: paused;
  195. animation-direction: reverse;
  196. animation-fill-mode: both;
  197. }
  198. #sections > div > label::after {
  199. counter-increment: codebox;
  200. content: counter(codebox);
  201. margin-left: 0.25rem;
  202. }
  203. /* code */
  204. .code {
  205. height: 10rem;
  206. width: 40rem;
  207. }
  208. .resize-grip-enabled .CodeMirror-scroll {
  209. height: auto !important;;
  210. position: absolute !important;
  211. top: 0;
  212. left: 0;
  213. right: 0;
  214. bottom: 6px; /* resize-grip height */
  215. }
  216. .resize-grip-enabled .CodeMirror-vscrollbar {
  217. margin-bottom: 7px; /* make space for resize-grip */
  218. }
  219. .resize-grip-enabled .CodeMirror-hscrollbar {
  220. bottom: 7px; /* make space for resize-grip */
  221. }
  222. .resize-grip-enabled .CodeMirror-scrollbar-filler {
  223. bottom: 7px; /* make space for resize-grip */
  224. }
  225. body[data-match-highlight="token"] .cm-matchhighlight-approved .cm-matchhighlight,
  226. body[data-match-highlight="token"] .CodeMirror-selection-highlight-scrollbar {
  227. animation: fadein-match-highlighter 1s cubic-bezier(.97,.01,.42,.98);
  228. animation-fill-mode: both;
  229. }
  230. body[data-match-highlight="selection"] .cm-matchhighlight-approved .cm-matchhighlight,
  231. body[data-match-highlight="selection"] .CodeMirror-selection-highlight-scrollbar {
  232. background-color: rgba(1, 151, 193, 0.1);
  233. }
  234. @-webkit-keyframes highlight {
  235. from {
  236. background-color: #ff9;
  237. }
  238. to {
  239. background-color: none;
  240. }
  241. }
  242. @keyframes fadein {
  243. from {
  244. opacity: 0;
  245. }
  246. to {
  247. opacity: 1;
  248. }
  249. }
  250. @keyframes fadein-match-highlighter {
  251. from { background-color: transparent; }
  252. to { background-color: rgba(1, 151, 193, 0.1); }
  253. }
  254. .resize-grip {
  255. position: absolute;
  256. display: block;
  257. height: 6px;
  258. content: "";
  259. left: 0;
  260. right: 0;
  261. bottom: 0;
  262. z-index: 9;
  263. cursor: n-resize;
  264. background-color: inherit;
  265. border-top-width: 1px;
  266. border-top-style: solid;
  267. border-top-color: inherit;
  268. }
  269. .resize-grip:after {
  270. content: "";
  271. bottom: 2px;
  272. left: 0;
  273. right: 0;
  274. margin: 0 8px;
  275. display: block;
  276. position: absolute;
  277. border-top-width: 2px;
  278. border-top-style: dotted;
  279. border-top-color: inherit;
  280. }
  281. /* applies-to */
  282. .applies-to {
  283. display: flex;
  284. }
  285. .applies-to label {
  286. flex: auto;
  287. margin-top: 0.2rem;
  288. }
  289. .applies-to ul {
  290. flex: auto;
  291. flex-grow: 99;
  292. margin: 0;
  293. padding: 0;
  294. }
  295. .applies-to li {
  296. display: flex;
  297. list-style-type: none;
  298. align-items: center;
  299. margin-bottom: 0.35rem;
  300. }
  301. .applies-to li > *:not(button) {
  302. flex: auto;
  303. min-height: 1.4rem;
  304. margin-left: 0.35rem;
  305. }
  306. .applies-to li .add-applies-to {
  307. visibility: hidden;
  308. text-align: left;
  309. }
  310. .applies-to li:last-child .add-applies-to {
  311. visibility: visible
  312. }
  313. .applies-to li .add-applies-to:first-child {
  314. margin-left: 1rem;
  315. }
  316. .applies-to li .applies-value {
  317. flex-grow: 99;
  318. padding-left: 0.2rem;
  319. }
  320. .applies-to img {
  321. vertical-align: bottom;
  322. }
  323. .test-regexp {
  324. display: none;
  325. }
  326. .has-regexp .test-regexp {
  327. display: inline-block;
  328. }
  329. .regexp-report summary, .regexp-report div {
  330. cursor: pointer;
  331. outline: none;
  332. }
  333. .regexp-report mark {
  334. background-color: rgba(255, 255, 0, .5);
  335. }
  336. .regexp-report details {
  337. margin-left: 1rem;
  338. word-break: break-all;
  339. }
  340. .regexp-report details:not(:last-child) {
  341. margin-bottom: 1rem;
  342. }
  343. .regexp-report summary {
  344. font-weight: bold;
  345. margin-left: -1rem;
  346. margin-bottom: .5rem;
  347. outline: none;
  348. cursor: default;
  349. overflow-wrap: break-word;
  350. }
  351. .regexp-report details[data-type="full"] {
  352. color: darkgreen;
  353. }
  354. .regexp-report details[data-type="partial"] {
  355. color: darkgray;
  356. }
  357. .regexp-report details[data-type="invalid"] {
  358. color: maroon;
  359. }
  360. .regexp-report details details {
  361. margin-left: 2rem;
  362. margin-top: .5rem;
  363. }
  364. .regexp-report .svg-icon {
  365. position: absolute;
  366. margin-top: -1px;
  367. }
  368. .regexp-report details div:hover {
  369. text-decoration: underline;
  370. text-decoration-skip: ink;
  371. }
  372. .regexp-report details div img {
  373. width: 16px;
  374. max-height: 16px;
  375. position: absolute;
  376. margin-left: -20px;
  377. margin-top: -1px;
  378. }
  379. /************ help popup ************/
  380. #help-popup {
  381. top: 3rem;
  382. right: 3rem;
  383. max-width: 50vw;
  384. position: fixed;
  385. display: none;
  386. background-color: white;
  387. box-shadow: 3px 3px 30px rgba(0, 0, 0, 0.5);
  388. padding: 0.5rem;
  389. z-index: 99;
  390. }
  391. #help-popup.big {
  392. box-shadow: rgba(0, 0, 0, 0.45) 0px 0px 0px 100000px !important;
  393. max-width: 100%;
  394. left: 3rem;
  395. }
  396. #help-popup.big .CodeMirror {
  397. min-height: 2rem;
  398. height: 70vh;
  399. }
  400. #help-popup .title {
  401. font-weight: bold;
  402. background-color: rgba(0,0,0,0.05);
  403. margin: -0.5rem -0.5rem 0.5rem;
  404. padding: .5rem 32px .5rem .5rem;
  405. }
  406. #help-popup .contents {
  407. max-height: calc(100vh - 8rem);
  408. overflow-y: auto;
  409. }
  410. #help-popup .settings {
  411. min-width: 500px;
  412. min-height: 200px;
  413. max-width: 48vw;
  414. }
  415. #help-popup .dismiss {
  416. position: absolute;
  417. right: 4px;
  418. top: .5em;
  419. }
  420. #help-popup .saved-message {
  421. display: none;
  422. color: #090;
  423. margin-left: 10px;
  424. font-weight: bold;
  425. }
  426. #help-popup .saved-message.show {
  427. display: inline-block;
  428. }
  429. .keymap-list {
  430. font-size: 85%;
  431. line-height: 1.0;
  432. border-spacing: 0;
  433. word-break: break-all;
  434. }
  435. .keymap-list input {
  436. width: 100%;
  437. }
  438. .keymap-list tr:nth-child(odd) {
  439. background-color: rgba(0, 0, 0, 0.07);
  440. }
  441. .keymap-list td:first-child {
  442. white-space: nowrap;
  443. font-family: monospace;
  444. padding-right: 0.5rem;
  445. }
  446. #help-popup button[name^="import"] {
  447. line-height: 1.5rem;
  448. padding: 0 0.5rem;
  449. margin: 0.5rem 0 0 0.5rem;
  450. pointer-events: none;
  451. opacity: 0.5;
  452. float: right;
  453. }
  454. #help-popup.ready button[name^="import"] {
  455. pointer-events: all;
  456. opacity: 1.0;
  457. }
  458. #help-popup .rules {
  459. padding: 0 15px;
  460. }
  461. #help-popup button {
  462. margin-right: 3px;
  463. }
  464. /************ lint ************/
  465. #lint > div {
  466. overflow-y: auto;
  467. }
  468. #lint table {
  469. font-size: 100%;
  470. border-spacing: 0;
  471. margin-bottom: 1rem;
  472. line-height: 1.0;
  473. }
  474. #lint table:last-child {
  475. margin-bottom: 0;
  476. }
  477. #lint caption {
  478. text-align: left;
  479. font-weight: bold;
  480. }
  481. #lint tbody {
  482. font-size: 85%;
  483. cursor: pointer;
  484. }
  485. #lint tr:hover {
  486. background-color: rgba(0, 0, 0, 0.1);
  487. }
  488. #lint td[role="severity"] {
  489. font-size: 0;
  490. width: 16px;
  491. }
  492. #lint td[role="line"], #lint td[role="sep"] {
  493. text-align: right;
  494. padding-right: 0;
  495. }
  496. #lint td[role="col"] {
  497. text-align: left;
  498. padding-right: 0.25rem;
  499. }
  500. #lint td[role="message"] {
  501. text-align: left;
  502. }
  503. #message-box.center.lint-config #message-box-contents {
  504. text-align: left;
  505. }
  506. /************ CSS beautifier ************/
  507. .beautify-options {
  508. white-space: nowrap;
  509. font-family: monospace;
  510. }
  511. .beautify-options div {
  512. float: left;
  513. }
  514. .beautify-options div[newline="true"] + div {
  515. clear: left;
  516. }
  517. .beautify-options div[newline="true"] + div span[indent] {
  518. padding-left: 2rem;
  519. }
  520. .beautify-options:after {
  521. clear: both;
  522. display: block;
  523. content: " ";
  524. height: 1rem;
  525. }
  526. .beautify-options span {
  527. font-weight: bold;
  528. }
  529. .beautify-options select {
  530. border: none;
  531. background-color: rgba(0, 0, 0, 0.05);
  532. }
  533. /************ single editor **************/
  534. .usercss body {
  535. display: flex;
  536. height: 100vh;
  537. flex-direction: column;
  538. justify-items: normal;
  539. }
  540. #sections .single-editor {
  541. margin: 0;
  542. padding: 0;
  543. display: flex;
  544. box-sizing: border-box;
  545. }
  546. .single-editor .CodeMirror {
  547. width: 100%;
  548. height: auto;
  549. border: none;
  550. outline: none;
  551. }
  552. #footer a {
  553. color: #333;
  554. transition: color .5s;
  555. text-decoration-skip: ink;
  556. animation: fadein 10s;
  557. }
  558. #footer a:hover {
  559. color: #666;
  560. }
  561. .usercss.firefox #sections,
  562. .usercss.firefox .single-editor,
  563. .usercss.firefox .CodeMirror {
  564. height: 100%;
  565. }
  566. /************ line widget *************/
  567. .CodeMirror-linewidget .applies-to {
  568. margin: 1em 0;
  569. padding: 1em;
  570. padding-right: calc(1em + 20px);
  571. }
  572. .CodeMirror-linewidget .applies-to li {
  573. margin: 0;
  574. }
  575. .CodeMirror-linewidget .applies-to li + li {
  576. margin-top: 0.35rem;
  577. }
  578. .CodeMirror-linewidget .applies-to li:not([data-type="regexp"]) .applies-to-regexp-test {
  579. display: none;
  580. }
  581. .CodeMirror-linewidget li.applies-to-everything {
  582. margin-top: 0.2rem;
  583. }
  584. /************ reponsive layouts ************/
  585. @media(max-width:737px) {
  586. #header {
  587. width: auto;
  588. height: auto;
  589. position: inherit;
  590. border-right: none;
  591. border-bottom: 1px dashed #AAA;
  592. min-height: var(--header-narrow-min-height);
  593. max-height: 50vh;
  594. }
  595. #header section:not(:last-child) {
  596. margin-bottom: 0.4rem;
  597. }
  598. #header input[type="checkbox"] {
  599. vertical-align: middle;
  600. }
  601. #heading,
  602. h2 {
  603. display: none;
  604. }
  605. #basic-info {
  606. display: flex;
  607. align-items: baseline;
  608. }
  609. #basic-info > * {
  610. flex: auto;
  611. }
  612. #basic-info > *:first-child {
  613. flex-grow: 99;
  614. display: flex;
  615. }
  616. #basic-info > *:not(:last-child) {
  617. margin-right: 0.8rem;
  618. }
  619. #basic-info #name {
  620. width: auto;
  621. flex-grow: 99;
  622. }
  623. #actions {
  624. margin-top: 1rem;
  625. }
  626. #actions > * {
  627. display: inline-block;
  628. }
  629. #options {
  630. -webkit-column-count: 2;
  631. -moz-column-count: 2;
  632. column-count: 2;
  633. }
  634. #options h2 {
  635. margin: 0 0 .5em;
  636. }
  637. #options .aligned > *:not(.svg-inline-wrapper) {
  638. margin: 1px 0 0 0; /* workaround the flowing-padding column bug in webkit */
  639. padding-right: 0.4rem;
  640. vertical-align: baseline;
  641. min-height: 1.4rem;
  642. }
  643. .option label {
  644. line-height: 1.25rem;
  645. margin: 0;
  646. }
  647. #options [type="number"] {
  648. text-align: left; /* workaround the column flow bug in webkit */
  649. padding-left: 0.2rem;
  650. }
  651. #options #tabSize-label {
  652. position: relative;
  653. top: 0.2rem;
  654. }
  655. #options:not([open]) ~ #lint {
  656. margin-top: -1ex;
  657. }
  658. #lint > div {
  659. max-height: 20vh;
  660. }
  661. #lint table {
  662. width: 100%;
  663. }
  664. #lint td[role="message"] {
  665. max-width: none;
  666. }
  667. #sections {
  668. padding-left: 0;
  669. }
  670. #sections > div {
  671. padding: 0;
  672. }
  673. #sections > *:not(h2) {
  674. padding-left: 0.4rem;
  675. }
  676. .applies-type {
  677. width: 30%;
  678. }
  679. .usercss .CodeMirror-scroll {
  680. max-height: calc(100vh - var(--header-narrow-min-height));
  681. }
  682. .usercss #options:not([open]) ~ #lint.hidden ~ #footer,
  683. .usercss #lint:not([open]) + #footer {
  684. margin-top: -.25em;
  685. }
  686. }
  687. @media(max-width:500px) {
  688. #options {
  689. -webkit-column-count: 1;
  690. -moz-column-count: 1;
  691. column-count: 1;
  692. }
  693. #options #tabSize-label {
  694. position: static;
  695. }
  696. }