editor.scss 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696
  1. @charset "UTF-8";
  2. $simditor-button-height: 40px;
  3. $simditor-button-width: 46px;
  4. .simditor {
  5. position: relative;
  6. border: 1px solid #c9d8db;
  7. .simditor-wrapper {
  8. position: relative;
  9. background: #ffffff;
  10. & > textarea {
  11. display: none !important;
  12. width: 100%;
  13. box-sizing: border-box;
  14. font-family: monaco;
  15. font-size: 16px;
  16. line-height: 1.6;
  17. border: none;
  18. padding: 22px 15px 40px;
  19. min-height: 300px;
  20. outline: none;
  21. background: transparent;
  22. resize: none;
  23. }
  24. .simditor-placeholder {
  25. display: none;
  26. position: absolute;
  27. left: 0;
  28. z-index: 0;
  29. padding: 22px 15px;
  30. font-size: 16px;
  31. font-family: arial, sans-serif;
  32. line-height: 1.5;
  33. color: #999999;
  34. background: transparent;
  35. }
  36. &.toolbar-floating {
  37. .simditor-toolbar {
  38. position: fixed;
  39. top: 0;
  40. z-index: 10;
  41. box-shadow: 0 0 6px rgba(0,0,0,0.1);
  42. }
  43. }
  44. .simditor-image-loading {
  45. width: 100%;
  46. height: 100%;
  47. position: absolute;
  48. top: 0;
  49. left: 0;
  50. z-index: 2;
  51. .progress {
  52. width: 100%;
  53. height: 100%;
  54. background: rgba(0,0,0,0.4);
  55. position: absolute;
  56. bottom: 0;
  57. left: 0;
  58. }
  59. }
  60. }
  61. .simditor-body {
  62. padding: 22px 15px 40px;
  63. min-height: 300px;
  64. outline: none;
  65. cursor: text;
  66. position: relative;
  67. z-index: 1;
  68. background: transparent;
  69. a.selected {
  70. background: #b3d4fd;
  71. }
  72. a.simditor-mention {
  73. cursor: pointer;
  74. }
  75. .simditor-table {
  76. position: relative;
  77. &.resizing {
  78. cursor: col-resize;
  79. }
  80. .simditor-resize-handle {
  81. position: absolute;
  82. left: 0;
  83. top: 0;
  84. width: 10px;
  85. height: 100%;
  86. cursor: col-resize;
  87. }
  88. }
  89. pre {
  90. /*min-height: 28px;*/
  91. box-sizing: border-box;
  92. -moz-box-sizing: border-box;
  93. word-wrap: break-word!important;
  94. white-space: pre-wrap!important;
  95. }
  96. img {
  97. cursor: pointer;
  98. &.selected {
  99. box-shadow: 0 0 0 4px #cccccc;
  100. }
  101. }
  102. }
  103. .simditor-paste-bin {
  104. position: fixed;
  105. bottom: 10px;
  106. right: 10px;
  107. width: 1px;
  108. height: 20px;
  109. font-size: 1px;
  110. line-height: 1px;
  111. overflow: hidden;
  112. padding: 0;
  113. margin: 0;
  114. opacity: 0;
  115. -webkit-user-select: text;
  116. }
  117. .simditor-toolbar {
  118. border-bottom: 1px solid #eeeeee;
  119. background: #ffffff;
  120. width: 100%;
  121. & > ul {
  122. margin: 0;
  123. padding: 0 0 0 6px;
  124. list-style: none;
  125. & > li {
  126. position: relative;
  127. display: inline-block;
  128. font-size: 0;
  129. & > span.separator {
  130. display: inline-block;
  131. background: #cfcfcf;
  132. width: 1px;
  133. height: 18px;
  134. margin: ($simditor-button-height - 18px) / 2 15px;
  135. vertical-align: middle;
  136. }
  137. & > .toolbar-item {
  138. display: inline-block;
  139. width: $simditor-button-width;
  140. height: $simditor-button-height;
  141. outline: none;
  142. color: #333333;
  143. font-size: 15px;
  144. line-height: $simditor-button-height;
  145. vertical-align: middle;
  146. text-align: center;
  147. text-decoration: none;
  148. span {
  149. opacity: 0.6;
  150. &.simditor-icon {
  151. display: inline;
  152. line-height: normal;
  153. }
  154. }
  155. &:hover span {
  156. opacity: 1;
  157. }
  158. &.active {
  159. background: #eeeeee;
  160. span {
  161. opacity: 1;
  162. }
  163. }
  164. &.disabled {
  165. cursor: default;
  166. span {
  167. opacity: 0.3;
  168. }
  169. }
  170. &.toolbar-item-title {
  171. span:before {
  172. content: "H";
  173. font-size: 19px;
  174. font-weight: bold;
  175. font-family: 'Times New Roman';
  176. }
  177. &.active-h1 span:before {
  178. content: 'H1';
  179. font-size: 18px;
  180. }
  181. &.active-h2 span:before {
  182. content: 'H2';
  183. font-size: 18px;
  184. }
  185. &.active-h3 span:before {
  186. content: 'H3';
  187. font-size: 18px;
  188. }
  189. }
  190. &.toolbar-item-image {
  191. position: relative;
  192. overflow: hidden;
  193. & > input[type=file] {
  194. position: absolute;
  195. right: 0px;
  196. top: 0px;
  197. opacity: 0;
  198. font-size: 100px;
  199. cursor: pointer;
  200. }
  201. }
  202. }
  203. &.menu-on {
  204. .toolbar-item {
  205. position: relative;
  206. z-index: 20;
  207. background: #ffffff;
  208. box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  209. span {
  210. opacity: 1;
  211. }
  212. }
  213. .toolbar-menu {
  214. display: block;
  215. }
  216. }
  217. }
  218. }
  219. .toolbar-menu {
  220. display: none;
  221. position: absolute;
  222. top: $simditor-button-height;
  223. left: 0;
  224. z-index: 21;
  225. background: #ffffff;
  226. text-align: left;
  227. box-shadow: 0 0 4px rgba(0,0,0,0.3);
  228. &:before {
  229. content: '';
  230. display: block;
  231. width: $simditor-button-width;
  232. height: 4px;
  233. background: #ffffff;
  234. position: absolute;
  235. top: -3px;
  236. left: 0;
  237. }
  238. ul {
  239. min-width: 160px;
  240. list-style: none;
  241. margin: 0;
  242. padding: 10px 1px;
  243. & > li {
  244. .menu-item {
  245. display: block;
  246. font-size:16px;
  247. line-height: 2em;
  248. padding: 0 10px;
  249. text-decoration: none;
  250. color: #666666;
  251. &:hover {
  252. background: #f6f6f6;
  253. }
  254. &.menu-item-h1 {
  255. font-size: 24px;
  256. color: #333333;
  257. }
  258. &.menu-item-h2 {
  259. font-size: 22px;
  260. color: #333333;
  261. }
  262. &.menu-item-h3 {
  263. font-size: 20px;
  264. color: #333333;
  265. }
  266. &.menu-item-h4 {
  267. font-size: 18px;
  268. color: #333333;
  269. }
  270. &.menu-item-h5 {
  271. font-size: 16px;
  272. color: #333333;
  273. }
  274. }
  275. .separator {
  276. display: block;
  277. border-top: 1px solid #cccccc;
  278. height: 0;
  279. line-height: 0;
  280. font-size: 0;
  281. margin: 6px 0;
  282. }
  283. }
  284. }
  285. &.toolbar-menu-color {
  286. width: 96px;
  287. .color-list {
  288. height: 40px;
  289. margin: 10px 6px 6px 10px;
  290. padding: 0;
  291. min-width: 0;
  292. li {
  293. float: left;
  294. margin: 0 4px 4px 0;
  295. .font-color {
  296. display: block;
  297. width: 16px;
  298. height: 16px;
  299. background: #dfdfdf;
  300. border-radius: 2px;
  301. &:hover {
  302. opacity: 0.8;
  303. }
  304. &.font-color-default {
  305. background: #333333;
  306. }
  307. }
  308. $font-colors: #E33737 #e28b41 #c8a732 #209361 #418caf #aa8773 #999999;
  309. $i: 1;
  310. @each $color in $font-colors {
  311. .font-color-#{$i} {
  312. background: $color;
  313. }
  314. $i: $i + 1;
  315. }
  316. }
  317. }
  318. }
  319. &.toolbar-menu-table {
  320. .menu-create-table {
  321. background: #ffffff;
  322. padding: 1px;
  323. table {
  324. border: none;
  325. border-collapse: collapse;
  326. border-spacing: 0;
  327. table-layout: fixed;
  328. td {
  329. padding: 0;
  330. cursor: pointer;
  331. &:before {
  332. width: 16px;
  333. height: 16px;
  334. border: 1px solid #ffffff;
  335. background: #f3f3f3;
  336. display: block;
  337. content: ''
  338. }
  339. &.selected:before {
  340. background: #cfcfcf;
  341. }
  342. }
  343. }
  344. }
  345. .menu-edit-table {
  346. display: none;
  347. ul {
  348. li {
  349. white-space: nowrap;
  350. }
  351. }
  352. }
  353. }
  354. &.toolbar-menu-image {
  355. .menu-item-upload-image {
  356. position: relative;
  357. overflow: hidden;
  358. input[type=file] {
  359. position: absolute;
  360. right: 0px;
  361. top: 0px;
  362. opacity: 0;
  363. font-size: 100px;
  364. cursor: pointer;
  365. }
  366. }
  367. }
  368. &.toolbar-menu-alignment {
  369. width: 100%;
  370. ul {
  371. min-width: 100%;
  372. }
  373. .menu-item {
  374. text-align: center;
  375. }
  376. }
  377. }
  378. }
  379. .simditor-popover {
  380. display: none;
  381. padding: 5px 8px 0;
  382. background: #ffffff;
  383. box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  384. border-radius: 2px;
  385. position: absolute;
  386. z-index: 2;
  387. .settings-field {
  388. margin: 0 0 5px 0;
  389. font-size: 12px;
  390. height: 25px;
  391. line-height: 25px;
  392. label {
  393. display: inline-block;
  394. margin: 0 5px 0 0;
  395. }
  396. input[type=text] {
  397. display: inline-block;
  398. width: 200px;
  399. box-sizing: border-box;
  400. font-size: 12px;
  401. &.image-size {
  402. width: 83px;
  403. }
  404. }
  405. .times {
  406. display: inline-block;
  407. width: 26px;
  408. font-size: 12px;
  409. text-align: center;
  410. }
  411. }
  412. &.link-popover .btn-unlink,
  413. &.image-popover .btn-upload,
  414. &.image-popover .btn-restore {
  415. display: inline-block;
  416. margin: 0 0 0 5px;
  417. color: #333333;
  418. font-size: 14px;
  419. outline: 0;
  420. span {
  421. opacity: 0.6;
  422. }
  423. &:hover span {
  424. opacity: 1;
  425. }
  426. }
  427. &.image-popover .btn-upload {
  428. position: relative;
  429. display: inline-block;
  430. overflow: hidden;
  431. vertical-align: middle;
  432. input[type=file] {
  433. position: absolute;
  434. right: 0px;
  435. top: 0px;
  436. opacity: 0;
  437. height: 100%;
  438. width: 28px;
  439. }
  440. }
  441. }
  442. &.simditor-mobile {
  443. .simditor-wrapper.toolbar-floating .simditor-toolbar {
  444. position: absolute;
  445. top: 0;
  446. z-index: 10;
  447. box-shadow: 0 0 6px rgba(0,0,0,0.1);
  448. }
  449. }
  450. }
  451. .simditor .simditor-body, .editor-style {
  452. font-size: 16px;
  453. font-family: arial, sans-serif;
  454. line-height: 1.6;
  455. color: #333;
  456. outline: none;
  457. word-wrap: break-word;
  458. & > :first-child {
  459. margin-top: 0!important;
  460. }
  461. a{ color: #4298BA; text-decoration: none; word-break: break-all;}
  462. a:visited{ color: #4298BA; }
  463. a:hover{ color: #0F769F; }
  464. a:active{ color:#9E792E; }
  465. a:hover, a:active{ outline: 0; }
  466. h1,h2,h3,h4,h5,h6 {
  467. font-weight: normal;
  468. margin: 40px 0 20px;
  469. color: #000000;
  470. }
  471. h1 { font-size: 24px; }
  472. h2 { font-size: 22px; }
  473. h3 { font-size: 20px; }
  474. h4 { font-size: 18px; }
  475. h5 { font-size: 16px; }
  476. h6 { font-size: 16px; }
  477. p, div {
  478. word-wrap: break-word;
  479. margin: 0 0 15px 0;
  480. color: #333;
  481. word-wrap: break-word;
  482. }
  483. b, strong {
  484. font-weight: bold;
  485. }
  486. i, em {
  487. font-style: italic;
  488. }
  489. u {
  490. text-decoration: underline;
  491. }
  492. strike, del {
  493. text-decoration: line-through;
  494. }
  495. ul, ol {
  496. list-style:disc outside none;
  497. margin: 15px 0;
  498. padding: 0 0 0 40px;
  499. line-height: 1.6;
  500. ul, ol {
  501. padding-left: 30px;
  502. }
  503. ul {
  504. list-style: circle outside none;
  505. ul {
  506. list-style: square outside none;
  507. }
  508. }
  509. }
  510. ol {
  511. list-style:decimal;
  512. }
  513. blockquote {
  514. border-left: 6px solid #ddd;
  515. padding: 5px 0 5px 10px;
  516. margin: 15px 0 15px 15px;
  517. & > :first-child {
  518. margin-top: 0;
  519. }
  520. }
  521. code {
  522. display: inline-block;
  523. padding: 0 4px;
  524. margin: 0 5px;
  525. background: #eeeeee;
  526. border-radius: 3px;
  527. font-size: 13px;
  528. font-family: 'monaco', 'Consolas', "Liberation Mono", Courier, monospace;
  529. }
  530. pre {
  531. padding: 10px 5px 10px 10px;
  532. margin: 15px 0;
  533. display: block;
  534. line-height: 18px;
  535. background: #F0F0F0;
  536. border-radius: 3px;
  537. font-size:13px;
  538. font-family: 'monaco', 'Consolas', "Liberation Mono", Courier, monospace;
  539. white-space: pre;
  540. word-wrap: normal;
  541. overflow-x: auto;
  542. code {
  543. display: block;
  544. padding: 0;
  545. margin: 0;
  546. background: none;
  547. border-radius: 0;
  548. }
  549. }
  550. hr {
  551. display: block;
  552. height: 0px;
  553. border: 0;
  554. border-top: 1px solid #ccc;
  555. margin: 15px 0;
  556. padding: 0;
  557. }
  558. table {
  559. width: 100%;
  560. table-layout: fixed;
  561. border-collapse: collapse;
  562. border-spacing: 0;
  563. margin: 15px 0;
  564. thead {
  565. background-color: #f9f9f9;
  566. }
  567. td, th {
  568. min-width: 40px;
  569. height: 30px;
  570. border: 1px solid #ccc;
  571. vertical-align: top;
  572. padding: 2px 4px;
  573. text-align: left;
  574. box-sizing: border-box;
  575. &.active {
  576. background-color: #ffffee;
  577. }
  578. }
  579. }
  580. img {
  581. margin: 0 5px;
  582. vertical-align: middle;
  583. }
  584. }