index.less 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937
  1. @margin: 8px 0;
  2. @line-height: 22px;
  3. .markdown {
  4. overflow: hidden;
  5. position: relative;
  6. margin: 0;
  7. padding: 0;
  8. box-sizing: border-box;
  9. display: flex;
  10. justify-content: space-between;
  11. align-items: center;
  12. flex-direction: column;
  13. background: @background;
  14. &.border {
  15. border: 1px solid @border;
  16. }
  17. * {
  18. margin: 0;
  19. padding: 0;
  20. box-sizing: border-box;
  21. }
  22. &.fullscreen {
  23. position: fixed;
  24. z-index: 999999;
  25. top: 0;
  26. left: 0;
  27. right: 0;
  28. bottom: 0;
  29. height: 100% !important;
  30. width: 100%;
  31. border: none;
  32. .markdown-content {
  33. padding: 0;
  34. padding-top: 10px;
  35. }
  36. }
  37. .markdown-toolbars {
  38. width: 100%;
  39. display: flex;
  40. align-items: center;
  41. list-style: none;
  42. background: #fff;
  43. color: #6a6f7b;
  44. height: 40px;
  45. cursor: pointer;
  46. //box-shadow: 0 2px 3px #ddd;
  47. padding-left: 4px;
  48. border-bottom: 1px solid @border;
  49. > li {
  50. position: relative;
  51. cursor: pointer;
  52. margin: 0;
  53. line-height: normal;
  54. min-height: auto;
  55. &:after {
  56. display: block;
  57. content: attr(name);
  58. position: absolute;
  59. z-index: 999999999999;
  60. top: 32px;
  61. left: 20px;
  62. background: #000;
  63. color: #fff;
  64. white-space: nowrap;
  65. font-size: 12px;
  66. line-height: 28px;
  67. padding: 0 6px;
  68. transition: all 0.3s 0.1s;
  69. transform: scale(0);
  70. opacity: 0;
  71. transform-origin: top;
  72. border-radius: 2px;
  73. }
  74. &:hover {
  75. &:after {
  76. transform: scale(1);
  77. opacity: 1;
  78. }
  79. }
  80. &:last-child {
  81. &:after {
  82. right: 20%;
  83. left: auto;
  84. }
  85. }
  86. .title {
  87. font-size: 16px !important;
  88. }
  89. }
  90. .empty {
  91. flex: 1;
  92. width: 12px;
  93. }
  94. span {
  95. font-size: 18px;
  96. color: #999;
  97. cursor: pointer;
  98. display: block;
  99. width: 30px;
  100. height: 30px;
  101. border-radius: 3px;
  102. line-height: 30px;
  103. text-align: center;
  104. &:hover {
  105. background: @background;
  106. color: @info;
  107. }
  108. }
  109. .title {
  110. padding-left: 4px;
  111. padding-right: 10px;
  112. }
  113. li:last-child {
  114. span {
  115. font-size: 20px !important;
  116. margin-right: 4px;
  117. }
  118. }
  119. .shift-theme,
  120. .export-file {
  121. height: 46px;
  122. //width: 80px;
  123. position: relative;
  124. display: flex;
  125. justify-content: center;
  126. align-items: center;
  127. span {
  128. padding: 0 8px;
  129. transition: all 0.3s;
  130. font-size: 18px;
  131. display: inline-block;
  132. line-height: 32px;
  133. &:hover {
  134. color: #0084ff;
  135. background: @background;
  136. border-radius: 3px;
  137. }
  138. }
  139. ul {
  140. position: absolute;
  141. transform: scale(0);
  142. transition: all 0.3s;
  143. left: -50%;
  144. top: 40px;
  145. width: 160px;
  146. transform-origin: top center;
  147. list-style: none;
  148. margin: 0;
  149. padding: 6px 0;
  150. box-sizing: border-box;
  151. border: 1px solid @border;
  152. background: #fff;
  153. border-radius: 4px;
  154. position: absolute;
  155. z-index: 9999999;
  156. box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
  157. &.active {
  158. opacity: 1;
  159. transform: scaleY(1);
  160. }
  161. li {
  162. line-height: 30px;
  163. padding: 0 12px;
  164. padding-left: 12px;
  165. font-size: 13px;
  166. cursor: pointer;
  167. user-select: none;
  168. display: flex;
  169. align-items: center;
  170. color: @content;
  171. .iconfont {
  172. font-size: 14px;
  173. display: block;
  174. height: 30px;
  175. width: 30px;
  176. line-height: 30px;
  177. overflow: hidden;
  178. &:hover {
  179. color: @content;
  180. }
  181. }
  182. i {
  183. font-size: 13px;
  184. display: block;
  185. font-style: normal;
  186. flex: 1;
  187. white-space: normal;
  188. }
  189. &:last-child {
  190. border-bottom: 0;
  191. .iconfont {
  192. font-size: 14px !important;
  193. margin: 0 !important;
  194. }
  195. }
  196. &:hover {
  197. background: @background;
  198. }
  199. &.disabled {
  200. cursor: not-allowed;
  201. color: @disabled;
  202. &:hover {
  203. background: transparent;
  204. }
  205. }
  206. }
  207. }
  208. }
  209. .import-file {
  210. position: relative;
  211. input {
  212. position: absolute;
  213. z-index: 9999;
  214. left: 0;
  215. top: 0;
  216. display: block;
  217. width: 100%;
  218. height: 100%;
  219. opacity: 0;
  220. cursor: pointer;
  221. font-size: 0;
  222. }
  223. &:hover {
  224. span {
  225. background: @background;
  226. color: @info;
  227. }
  228. &:after {
  229. transform: scale(1);
  230. opacity: 1;
  231. }
  232. }
  233. }
  234. }
  235. .close-preview {
  236. position: absolute;
  237. z-index: 999;
  238. right: 0;
  239. top: 0;
  240. height: 40px;
  241. width: 40px;
  242. display: flex;
  243. justify-content: center;
  244. align-items: center;
  245. cursor: pointer;
  246. color: @content;
  247. span {
  248. font-size: 22px;
  249. &:hover {
  250. color: @title;
  251. }
  252. }
  253. }
  254. .markdown-content {
  255. flex: 1;
  256. width: 100%;
  257. display: flex;
  258. justify-content: space-between;
  259. position: relative;
  260. overflow: hidden;
  261. padding-bottom: 0;
  262. .markdown-editor { // simple版编辑器区域
  263. flex: 1;
  264. height: 100%;
  265. position: relative;
  266. margin: 0 !important;
  267. overflow: hidden;
  268. overflow-y: scroll;
  269. display: flex;
  270. justify-content: space-between;
  271. background: #2d2d2d;
  272. &::-webkit-scrollbar {
  273. display: none;
  274. }
  275. .index {
  276. background: #272727;
  277. min-height: 100%;
  278. width: 36px;
  279. line-height: @line-height;
  280. padding: 12px 0;
  281. li {
  282. background: #272727;
  283. color: #ccc;
  284. font-size: 14px;
  285. text-align: center;
  286. font-family: Consolas;
  287. }
  288. }
  289. textarea {
  290. width: 100%;
  291. min-height: 100%;
  292. outline: none;
  293. border: 0;
  294. background: #2d2d2d;
  295. line-height: @line-height;
  296. caret-color: #ccc;
  297. color: #669acc;
  298. font-size: 14px;
  299. font-family: Consolas;
  300. resize: none;
  301. padding: 12px 8px;
  302. overflow: hidden;
  303. white-space: nowrap;
  304. overflow-x: auto;
  305. &::selection {
  306. background: #999;
  307. color: #0084ff;
  308. }
  309. }
  310. }
  311. .codemirror {
  312. flex: 1;
  313. width: 0;
  314. height: 100%;
  315. overflow: auto;
  316. }
  317. .markdown-preview {
  318. flex: 1;
  319. width: 0;
  320. height: 100%;
  321. }
  322. }
  323. }
  324. .insert-img-model {
  325. position: fixed;
  326. left: 0;
  327. top: 0;
  328. right: 0;
  329. bottom: 0;
  330. z-index: 99999;
  331. background: @mask;
  332. padding-top: 12%;
  333. transition: all 0.3s;
  334. opacity: 0;
  335. display: none;
  336. .model-container {
  337. background: #fff;
  338. width: 480px;
  339. margin: 0 auto;
  340. border-radius: 4px;
  341. transition: all 0.3s;
  342. transform: scale(0);
  343. transform-origin: center;
  344. .model-head {
  345. line-height: 32px;
  346. padding: 0 12px;
  347. background: @background;
  348. border-radius: 4px 4px 0 0;
  349. box-shadow: 0 1px 2px @border;
  350. display: flex;
  351. justify-content: space-between;
  352. span:nth-of-type(2) {
  353. font-size: 14px;
  354. padding-left: 12px;
  355. cursor: pointer;
  356. &:hover {
  357. color: @error;
  358. }
  359. }
  360. }
  361. .model-content {
  362. padding: 20px 12px;
  363. padding-top: 0;
  364. min-height: 180px;
  365. .insert-url {
  366. padding: 42px 0;
  367. display: flex;
  368. justify-content: space-between;
  369. align-items: center;
  370. input {
  371. display: block;
  372. border: 1px solid #ccc;
  373. font-size: 14px;
  374. padding: 4px 8px;
  375. line-height: 24px;
  376. color: #333;
  377. background: #fff;
  378. border-radius: 4px;
  379. writing-mode: horizontal-tb;
  380. text-rendering: auto;
  381. transition: box-shadow 2s;
  382. flex: 1;
  383. &:focus {
  384. border-color: @info;
  385. }
  386. &::placeholder {
  387. color: @tip;
  388. }
  389. }
  390. a {
  391. display: block;
  392. background: @info;
  393. color: #fff;
  394. line-height: 32px;
  395. height: 32px;
  396. font-size: 13px;
  397. padding: 0 12px;
  398. border-radius: 3px;
  399. margin-left: 20px;
  400. border: 1px solid @border;
  401. transition: all 0.3s;
  402. &:hover {
  403. background: @dark-info;
  404. }
  405. }
  406. }
  407. .insert-local {
  408. height: 120px;
  409. border: 1px dashed @border;
  410. border-radius: 4px;
  411. transition: all 0.3s;
  412. position: relative;
  413. display: flex;
  414. justify-content: center;
  415. align-items: center;
  416. flex-direction: column;
  417. cursor: pointer;
  418. span {
  419. font-size: 40px;
  420. color: @border;
  421. line-height: 50px;
  422. transition: all 0.3s;
  423. }
  424. p {
  425. font-size: 14px;
  426. color: @content;
  427. transition: all 0.3s;
  428. }
  429. &:hover {
  430. border-color: @info;
  431. span,
  432. p {
  433. color: @info;
  434. }
  435. }
  436. input {
  437. display: block;
  438. position: absolute;
  439. width: 100%;
  440. height: 100%;
  441. opacity: 0;
  442. }
  443. }
  444. }
  445. .model-foot {
  446. display: flex;
  447. justify-content: flex-end;
  448. align-items: center;
  449. padding: 10px 12px;
  450. display: none;
  451. a {
  452. display: block;
  453. background: @background;
  454. color: @title;
  455. line-height: 26px;
  456. height: 26px;
  457. font-size: 13px;
  458. padding: 0 12px;
  459. border-radius: 3px;
  460. margin-left: 12px;
  461. border: 1px solid @border;
  462. transition: all 0.3s;
  463. &:hover {
  464. background: @divider;
  465. }
  466. &.ok {
  467. background: @info;
  468. color: #fff;
  469. border-color: @info;
  470. &:hover {
  471. background: @dark-info;
  472. }
  473. }
  474. }
  475. }
  476. }
  477. &.active {
  478. opacity: 1;
  479. display: block;
  480. .model-container {
  481. transform: scale(1);
  482. }
  483. }
  484. }
  485. ul.shift {
  486. padding: 6px 12px;
  487. display: flex;
  488. align-items: center;
  489. span {
  490. font-size: 12px;
  491. cursor: pointer;
  492. user-select: none;
  493. &.iconfont {
  494. font-size: 14px;
  495. }
  496. }
  497. label {
  498. font-size: 12px;
  499. padding-right: 10px;
  500. position: relative;
  501. cursor: pointer;
  502. user-select: none;
  503. }
  504. input[type='radio'],
  505. label {
  506. transition: all 0.6s ease;
  507. box-sizing: border-box;
  508. }
  509. input[type="radio"] + label::before {
  510. content: "\a0";
  511. display: inline-block;
  512. vertical-align: middle;
  513. margin-right: 4px;
  514. width: 8px;
  515. height: 8px;
  516. border-radius: 50%;
  517. border: 1px solid @primary;
  518. padding: 2px;
  519. }
  520. input[type="radio"]:checked + label::before {
  521. background-color: @primary;
  522. background-clip: content-box;
  523. padding: 2px;
  524. }
  525. input[type="radio"] {
  526. position: absolute;
  527. clip: rect(0, 0, 0, 0);
  528. }
  529. input[type="radio"]:checked + label {
  530. color: @primary;
  531. }
  532. }
  533. /deep/ .markdown-preview {
  534. flex: 1;
  535. overflow: hidden;
  536. overflow-y: scroll;
  537. background: #fff;
  538. padding: 20px 12px !important;
  539. font-family: 'Tahoma For Number', 'Chinese Quote', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  540. * {
  541. margin: 0;
  542. padding: 0;
  543. box-sizing: border-box;
  544. }
  545. > div {
  546. padding: 10px 12px !important;
  547. background: #fff;
  548. &::-webkit-scrollbar {
  549. display: none;
  550. }
  551. }
  552. &::-webkit-scrollbar {
  553. display: none;
  554. }
  555. ul {
  556. list-style: none;
  557. padding: 0 20px;
  558. li {
  559. position: relative;
  560. &:after {
  561. display: block;
  562. content: "";
  563. width: 8px;
  564. height: 8px;
  565. border-radius: 50%;
  566. position: absolute;
  567. z-index: 99;
  568. top: 12px;
  569. left: -8px;
  570. background: @content;
  571. }
  572. }
  573. }
  574. ol,
  575. ul {
  576. margin: 10px 0;
  577. li {
  578. font-size: 14px !important;
  579. color: @content;
  580. line-height: 22px !important;
  581. padding: 4px 0;
  582. padding-left: 6px;
  583. min-height: 28px;
  584. input[type="checkbox"] {
  585. position: relative;
  586. cursor: pointer;
  587. overflow: visible;
  588. position: absolute;
  589. left: -14px;
  590. top: 5px;
  591. &:before {
  592. font-family: "iconfont" !important;
  593. color: #999;
  594. display: block;
  595. width: 18px;
  596. height: 18px;
  597. position: absolute;
  598. content: "\E684";
  599. top: 0px;
  600. left: -4px;
  601. z-index: 999999;
  602. background-position: center;
  603. background: #fff;
  604. font-size: 18px;
  605. text-align: center;
  606. line-height: 18px;
  607. }
  608. }
  609. input[type="checkbox"]:checked {
  610. &:before {
  611. content: "\E683";
  612. }
  613. }
  614. }
  615. }
  616. ol {
  617. list-style-type: decimal;
  618. padding-left: 20px;
  619. }
  620. hr {
  621. color: @border;
  622. height: 1px;
  623. border: 0;
  624. border-top: 1px solid @border;
  625. margin: 20px 0;
  626. padding: 0;
  627. }
  628. del,
  629. em,
  630. strong {
  631. display: inline-block;
  632. }
  633. blockquote {
  634. position: relative;
  635. background: @background;
  636. padding: 6px 12px;
  637. border-left: 5px solid @divider;
  638. border-radius: 2px;
  639. margin: @margin;
  640. }
  641. /*基本样式*/
  642. h1,
  643. h2,
  644. h3,
  645. h4,
  646. h5,
  647. h6 {
  648. color: @title;
  649. }
  650. h1 {
  651. font-size: 28px;
  652. border-bottom: 1px solid @border;
  653. }
  654. h2 {
  655. font-size: 24px;
  656. }
  657. h3 {
  658. font-size: 18px;
  659. }
  660. h4 {
  661. font-size: 16px;
  662. }
  663. h5 {
  664. font-size: 14px;
  665. }
  666. h6 {
  667. font-size: 12px;
  668. }
  669. h1,
  670. h2,
  671. h3,
  672. h4,
  673. h5,
  674. h6 {
  675. padding: 8px 0;
  676. font-weight: 600;
  677. }
  678. p {
  679. font-size: 14px !important;
  680. color: @content;
  681. margin-bottom: 8px;
  682. line-height: @line-height;
  683. }
  684. // 图片
  685. img {
  686. display: block;
  687. max-width: 100%;
  688. margin: 20px 0;
  689. cursor: pointer;
  690. }
  691. // 表格样式
  692. table {
  693. width: 100%;
  694. border: 1px solid @border;
  695. border-bottom: 0;
  696. background: #fff;
  697. border-spacing: 0;
  698. border-collapse: collapse;
  699. margin: 20px 0;
  700. tr {
  701. -webkit-transition: background 0.1s;
  702. transition: background 0.1s;
  703. }
  704. tr td,
  705. tr th {
  706. padding: 4px 8px;
  707. font-size: 14px;
  708. line-height: 24px;
  709. color: #333;
  710. border-bottom: 1px solid @border;
  711. cursor: pointer;
  712. }
  713. th {
  714. background: #f8f8f9;
  715. text-align: left;
  716. font-weight: bold;
  717. }
  718. tr:nth-of-type(even) {
  719. td {
  720. background: #fafafa;
  721. }
  722. }
  723. tr {
  724. &:hover {
  725. td {
  726. background: #f5f5f5;
  727. }
  728. }
  729. }
  730. td,
  731. th {
  732. border: 1px solid @border;
  733. word-break: break-all;
  734. }
  735. }
  736. input[type="checkbox"] {
  737. display: inline-block;
  738. border-radius: 0;
  739. margin-right: 8px;
  740. }
  741. a {
  742. text-decoration: none;
  743. color: @info;
  744. font-size: 14px;
  745. line-height: @line-height;
  746. }
  747. .code-block {
  748. position: relative;
  749. padding: 0 !important;
  750. .copy-code {// 复制代码
  751. position: absolute;
  752. z-index: 999;
  753. top: 5px;
  754. right: 10px;
  755. font-size: 12px;
  756. color: @border;
  757. line-height: 20px;
  758. cursor: pointer;
  759. user-select: none;
  760. transition: all .3s;
  761. opacity: 0;
  762. &:hover {
  763. color: @info;
  764. }
  765. }
  766. &:hover {
  767. .copy-code {
  768. opacity: 1;
  769. }
  770. }
  771. }
  772. }
  773. .preview-img {
  774. position: fixed;
  775. width: 100vw;
  776. height: 100vh;
  777. z-index: 99999999;
  778. left: 0;
  779. top: 0;
  780. background: rgba(0, 0, 0, .5);
  781. display: none;
  782. opacity: 0;
  783. transition: opacity .3s .1s;
  784. justify-content: center;
  785. align-items: center;
  786. .close {
  787. position: absolute;
  788. right: 0;
  789. top: 0;
  790. color: #fff;
  791. padding: 10px;
  792. font-size: 20px;
  793. cursor: pointer;
  794. }
  795. img {
  796. display: block;
  797. &.vertical {
  798. height: 80%;
  799. width: auto;
  800. }
  801. &.horizontal {
  802. width: 80%;
  803. height: auto;
  804. }
  805. }
  806. &.active {
  807. display: flex;
  808. opacity: 1;
  809. }
  810. }