1
0

trumbowyg.scss 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824
  1. /**
  2. * Trumbowyg v2.22.0 - A lightweight WYSIWYG editor
  3. * Default stylesheet for Trumbowyg editor
  4. * ------------------------
  5. * @link http://alex-d.github.io/Trumbowyg
  6. * @license MIT
  7. * @author Alexandre Demode (Alex-D)
  8. * Twitter : @AlexandreDemode
  9. * Website : alex-d.fr
  10. */
  11. $light-color: #ecf0f1 !default;
  12. $dark-color: #222 !default;
  13. $modal-submit-color: #2ecc71 !default;
  14. $modal-reset-color: #EEE !default;
  15. $transition-duration: 150ms !default;
  16. $slow-transition-duration: 300ms !default;
  17. #trumbowyg-icons {
  18. overflow: hidden;
  19. visibility: hidden;
  20. height: 0;
  21. width: 0;
  22. svg {
  23. height: 0;
  24. width: 0;
  25. }
  26. }
  27. .trumbowyg-box,
  28. .trumbowyg-modal {
  29. *,
  30. *::before,
  31. *::after {
  32. box-sizing: border-box;
  33. }
  34. svg {
  35. width: 17px;
  36. height: 100%;
  37. fill: $dark-color;
  38. }
  39. }
  40. .trumbowyg-box,
  41. .trumbowyg-editor {
  42. display: block;
  43. position: relative;
  44. border: 1px solid #DDD;
  45. width: 100%;
  46. min-height: 300px;
  47. }
  48. .trumbowyg-box .trumbowyg-editor {
  49. margin: 0 auto;
  50. }
  51. .trumbowyg-box.trumbowyg-fullscreen {
  52. background: #FEFEFE;
  53. border: none !important;
  54. }
  55. .trumbowyg-editor,
  56. .trumbowyg-textarea {
  57. position: relative;
  58. box-sizing: border-box;
  59. padding: 20px;
  60. min-height: 300px;
  61. width: 100%;
  62. border-style: none;
  63. resize: none;
  64. outline: none;
  65. overflow: auto;
  66. user-select: text; // Avoid issues on iOS
  67. &.trumbowyg-autogrow-on-enter {
  68. transition: height $slow-transition-duration ease-out;
  69. }
  70. }
  71. .trumbowyg-box-blur .trumbowyg-editor {
  72. *,
  73. &::before {
  74. color: transparent !important;
  75. text-shadow: 0 0 7px #333;
  76. @media screen and (min-width: 0 \0) {
  77. color: rgba(200, 200, 200, 0.6) !important;
  78. }
  79. @supports (-ms-accelerator:true) {
  80. color: rgba(200, 200, 200, 0.6) !important;
  81. }
  82. }
  83. img,
  84. hr {
  85. opacity: 0.2;
  86. }
  87. }
  88. .trumbowyg-textarea {
  89. position: relative;
  90. display: block;
  91. overflow: auto;
  92. border: none;
  93. font-size: 14px;
  94. font-family: "Inconsolata", "Consolas", "Courier", "Courier New", sans-serif;
  95. line-height: 18px;
  96. }
  97. .trumbowyg-box.trumbowyg-editor-visible {
  98. .trumbowyg-textarea {
  99. height: 1px !important;
  100. width: 25%;
  101. min-height: 0 !important;
  102. padding: 0 !important;
  103. background: none;
  104. opacity: 0 !important;
  105. }
  106. }
  107. .trumbowyg-box.trumbowyg-editor-hidden {
  108. .trumbowyg-textarea {
  109. display: block;
  110. margin-bottom: 1px;
  111. }
  112. .trumbowyg-editor {
  113. display: none;
  114. }
  115. }
  116. .trumbowyg-box.trumbowyg-disabled {
  117. .trumbowyg-textarea {
  118. opacity: 0.8;
  119. background: none;
  120. }
  121. }
  122. .trumbowyg-editor[contenteditable=true]:empty:not(:focus)::before {
  123. content: attr(placeholder);
  124. color: #999;
  125. pointer-events: none;
  126. white-space: break-spaces;
  127. }
  128. .trumbowyg-button-pane {
  129. width: 100%;
  130. min-height: 36px;
  131. background: $light-color;
  132. border-bottom: 1px solid darken($light-color, 7%);
  133. margin: 0;
  134. padding: 0 5px;
  135. position: relative;
  136. list-style-type: none;
  137. line-height: 10px;
  138. backface-visibility: hidden;
  139. z-index: 11;
  140. &::after {
  141. content: " ";
  142. display: block;
  143. position: absolute;
  144. top: 36px;
  145. left: 0;
  146. right: 0;
  147. width: 100%;
  148. height: 1px;
  149. background: darken($light-color, 7%);
  150. }
  151. .trumbowyg-button-group {
  152. display: inline-block;
  153. .trumbowyg-fullscreen-button svg {
  154. color: transparent;
  155. }
  156. &::after {
  157. content: " ";
  158. display: inline-block;
  159. width: 1px;
  160. background: darken($light-color, 7%);
  161. margin: 0 5px;
  162. height: 35px;
  163. vertical-align: top;
  164. }
  165. &:last-child::after {
  166. content: none;
  167. }
  168. }
  169. button {
  170. display: inline-block;
  171. position: relative;
  172. width: 35px;
  173. height: 35px;
  174. padding: 1px 6px !important;
  175. margin-bottom: 1px;
  176. overflow: hidden;
  177. border: none;
  178. cursor: pointer;
  179. background: none;
  180. vertical-align: middle;
  181. transition: background-color $transition-duration, opacity $transition-duration;
  182. &.trumbowyg-textual-button {
  183. width: auto;
  184. line-height: 35px;
  185. user-select: none;
  186. }
  187. }
  188. &.trumbowyg-disable button:not(.trumbowyg-not-disable):not(.trumbowyg-active),
  189. button.trumbowyg-disable,
  190. .trumbowyg-disabled & button:not(.trumbowyg-not-disable):not(.trumbowyg-viewHTML-button) {
  191. opacity: 0.2;
  192. cursor: default;
  193. }
  194. &.trumbowyg-disable,
  195. .trumbowyg-disabled & {
  196. .trumbowyg-button-group::before {
  197. background: darken($light-color, 3%);
  198. }
  199. }
  200. button:not(.trumbowyg-disable):hover,
  201. button:not(.trumbowyg-disable):focus,
  202. button.trumbowyg-active {
  203. background-color: #FFF;
  204. outline: none;
  205. }
  206. .trumbowyg-open-dropdown {
  207. &::after {
  208. display: block;
  209. content: " ";
  210. position: absolute;
  211. top: 25px;
  212. right: 3px;
  213. height: 0;
  214. width: 0;
  215. border: 3px solid transparent;
  216. border-top-color: #555;
  217. }
  218. &.trumbowyg-textual-button {
  219. padding-left: 10px !important;
  220. padding-right: 18px !important;
  221. &::after {
  222. top: 17px;
  223. right: 7px;
  224. }
  225. }
  226. }
  227. .trumbowyg-right {
  228. float: right;
  229. }
  230. }
  231. .trumbowyg-dropdown {
  232. max-width: 300px;
  233. max-height: 250px;
  234. overflow-y: auto;
  235. overflow-x: hidden;
  236. white-space: nowrap;
  237. border: 1px solid $light-color;
  238. padding: 5px 0;
  239. border-top: none;
  240. background: #FFF;
  241. margin-left: -1px;
  242. box-shadow: rgba(0, 0, 0, .1) 0 2px 3px;
  243. z-index: 12;
  244. button {
  245. display: block;
  246. width: 100%;
  247. height: 35px;
  248. line-height: 35px;
  249. text-decoration: none;
  250. background: #FFF;
  251. padding: 0 20px 0 10px;
  252. color: #333 !important;
  253. border: none;
  254. cursor: pointer;
  255. text-align: left;
  256. font-size: 15px;
  257. transition: all $transition-duration;
  258. &:hover,
  259. &:focus {
  260. background: $light-color;
  261. }
  262. svg {
  263. float: left;
  264. margin-right: 14px;
  265. }
  266. }
  267. }
  268. /* Modal box */
  269. .trumbowyg-modal {
  270. position: absolute;
  271. top: 0;
  272. left: 50%;
  273. transform: translateX(-50%);
  274. max-width: 520px;
  275. width: 100%;
  276. height: 350px;
  277. z-index: 12;
  278. overflow: hidden;
  279. backface-visibility: hidden;
  280. }
  281. .trumbowyg-modal-box {
  282. position: absolute;
  283. top: 0;
  284. left: 50%;
  285. transform: translateX(-50%);
  286. max-width: 500px;
  287. width: calc(100% - 20px);
  288. padding-bottom: 45px;
  289. z-index: 1;
  290. background-color: #FFF;
  291. text-align: center;
  292. font-size: 14px;
  293. box-shadow: rgba(0, 0, 0, .2) 0 2px 3px;
  294. backface-visibility: hidden;
  295. .trumbowyg-modal-title {
  296. font-size: 24px;
  297. font-weight: bold;
  298. margin: 0 0 20px;
  299. padding: 15px 0 13px;
  300. display: block;
  301. border-bottom: 1px solid #EEE;
  302. color: #333;
  303. background: lighten($light-color, 5%);
  304. }
  305. .trumbowyg-progress {
  306. width: 100%;
  307. height: 3px;
  308. position: absolute;
  309. top: 58px;
  310. .trumbowyg-progress-bar {
  311. background: #2BC06A;
  312. width: 0;
  313. height: 100%;
  314. transition: width $transition-duration linear;
  315. }
  316. }
  317. label {
  318. display: block;
  319. position: relative;
  320. margin: 15px 12px;
  321. height: 29px;
  322. line-height: 29px;
  323. overflow: hidden;
  324. .trumbowyg-input-infos {
  325. display: block;
  326. text-align: left;
  327. height: 25px;
  328. line-height: 25px;
  329. transition: all 150ms;
  330. span {
  331. display: block;
  332. color: darken($light-color, 45%);
  333. background-color: lighten($light-color, 5%);
  334. border: 1px solid #DEDEDE;
  335. padding: 0 7px;
  336. width: 150px;
  337. }
  338. span.trumbowyg-msg-error {
  339. color: #e74c3c;
  340. }
  341. }
  342. &.trumbowyg-input-error {
  343. input,
  344. textarea {
  345. border: 1px solid #e74c3c;
  346. }
  347. .trumbowyg-input-infos {
  348. margin-top: -27px;
  349. }
  350. }
  351. input {
  352. position: absolute;
  353. top: 0;
  354. right: 0;
  355. height: 27px;
  356. line-height: 27px;
  357. border: 1px solid #DEDEDE;
  358. background: #fff;
  359. font-size: 14px;
  360. max-width: 330px;
  361. width: 70%;
  362. padding: 0 7px;
  363. transition: all $transition-duration;
  364. &:hover,
  365. &:focus {
  366. outline: none;
  367. border: 1px solid #95a5a6;
  368. }
  369. &:focus {
  370. background: lighten($light-color, 5%);
  371. }
  372. }
  373. input[type="checkbox"]{
  374. left: 6px;
  375. top: 6px;
  376. right: auto;
  377. height: 16px;
  378. width: 16px;
  379. + .trumbowyg-input-infos span{
  380. width: auto;
  381. padding-left: 25px;
  382. }
  383. }
  384. }
  385. .error {
  386. margin-top: 25px;
  387. display: block;
  388. color: red;
  389. }
  390. .trumbowyg-modal-button {
  391. position: absolute;
  392. bottom: 10px;
  393. right: 0;
  394. text-decoration: none;
  395. color: #FFF;
  396. display: block;
  397. width: 100px;
  398. height: 35px;
  399. line-height: 33px;
  400. margin: 0 10px;
  401. background-color: #333;
  402. border: none;
  403. cursor: pointer;
  404. font-family: "Trebuchet MS", Helvetica, Verdana, sans-serif;
  405. font-size: 16px;
  406. transition: all $transition-duration;
  407. &.trumbowyg-modal-submit {
  408. right: 110px;
  409. background: darken($modal-submit-color, 3%);
  410. &:hover,
  411. &:focus {
  412. background: lighten($modal-submit-color, 5%);
  413. outline: none;
  414. }
  415. &:active {
  416. background: darken($modal-submit-color, 10%);
  417. }
  418. }
  419. &.trumbowyg-modal-reset {
  420. color: #555;
  421. background: darken($modal-reset-color, 3%);
  422. &:hover,
  423. &:focus {
  424. background: lighten($modal-reset-color, 5%);
  425. outline: none;
  426. }
  427. &:active {
  428. background: darken($modal-reset-color, 10%);
  429. }
  430. }
  431. }
  432. }
  433. .trumbowyg-overlay {
  434. position: absolute;
  435. background-color: rgba(255, 255, 255, 0.5);
  436. height: 100%;
  437. width: 100%;
  438. left: 0;
  439. display: none;
  440. top: 0;
  441. z-index: 10;
  442. }
  443. /**
  444. * Fullscreen
  445. */
  446. body.trumbowyg-body-fullscreen {
  447. overflow: hidden;
  448. }
  449. .trumbowyg-fullscreen {
  450. position: fixed;
  451. top: 0;
  452. left: 0;
  453. width: 100%;
  454. height: 100%;
  455. margin: 0;
  456. padding: 0;
  457. z-index: 99999;
  458. &.trumbowyg-box,
  459. .trumbowyg-editor {
  460. border: none;
  461. }
  462. .trumbowyg-editor,
  463. .trumbowyg-textarea {
  464. height: calc(100% - 37px) !important;
  465. overflow: auto;
  466. }
  467. .trumbowyg-overlay {
  468. height: 100% !important;
  469. }
  470. .trumbowyg-button-group .trumbowyg-fullscreen-button svg {
  471. color: $dark-color;
  472. fill: transparent;
  473. }
  474. }
  475. .trumbowyg-editor {
  476. object,
  477. embed,
  478. video,
  479. img {
  480. max-width: 100%;
  481. }
  482. video,
  483. img {
  484. height: auto;
  485. }
  486. img {
  487. cursor: move;
  488. }
  489. canvas:focus {
  490. outline: none;
  491. }
  492. /*
  493. * lset for resetCss option
  494. */
  495. &.trumbowyg-reset-css {
  496. background: #FEFEFE !important;
  497. font-family: "Trebuchet MS", Helvetica, Verdana, sans-serif !important;
  498. font-size: 14px !important;
  499. line-height: 1.45em !important;
  500. color: #333;
  501. a {
  502. color: #15c !important;
  503. text-decoration: underline !important;
  504. }
  505. div,
  506. p,
  507. ul,
  508. ol,
  509. blockquote {
  510. box-shadow: none !important;
  511. background: none !important;
  512. margin: 0 !important;
  513. margin-bottom: 15px !important;
  514. line-height: 1.4em !important;
  515. font-family: "Trebuchet MS", Helvetica, Verdana, sans-serif !important;
  516. font-size: 14px !important;
  517. border: none;
  518. }
  519. iframe,
  520. object,
  521. hr {
  522. margin-bottom: 15px !important;
  523. }
  524. blockquote {
  525. margin-left: 32px !important;
  526. font-style: italic !important;
  527. color: #555;
  528. }
  529. ul {
  530. list-style: disc;
  531. }
  532. ol {
  533. list-style: decimal;
  534. }
  535. ul,
  536. ol {
  537. padding-left: 20px !important;
  538. }
  539. ul ul,
  540. ol ol,
  541. ul ol,
  542. ol ul {
  543. border: none;
  544. margin: 2px !important;
  545. padding: 0 !important;
  546. padding-left: 24px !important;
  547. }
  548. hr {
  549. display: block;
  550. height: 1px;
  551. border: none;
  552. border-top: 1px solid #CCC;
  553. }
  554. h1,
  555. h2,
  556. h3,
  557. h4 {
  558. color: #111;
  559. background: none;
  560. margin: 0 !important;
  561. padding: 0 !important;
  562. font-weight: bold;
  563. }
  564. h1 {
  565. font-size: 32px !important;
  566. line-height: 38px !important;
  567. margin-bottom: 20px !important;
  568. }
  569. h2 {
  570. font-size: 26px !important;
  571. line-height: 34px !important;
  572. margin-bottom: 15px !important;
  573. }
  574. h3 {
  575. font-size: 22px !important;
  576. line-height: 28px !important;
  577. margin-bottom: 7px !important;
  578. }
  579. h4 {
  580. font-size: 16px !important;
  581. line-height: 22px !important;
  582. margin-bottom: 7px !important;
  583. }
  584. }
  585. }
  586. /*
  587. * Dark theme
  588. */
  589. .trumbowyg-dark {
  590. .trumbowyg-textarea {
  591. background: #111;
  592. color: #ddd;
  593. }
  594. .trumbowyg-box {
  595. border: 1px solid lighten($dark-color, 7%);
  596. &.trumbowyg-fullscreen {
  597. background: #111;
  598. }
  599. &.trumbowyg-box-blur .trumbowyg-editor {
  600. *,
  601. &::before {
  602. text-shadow: 0 0 7px #ccc;
  603. @media screen and (min-width: 0 \0
  604. ) {
  605. color: rgba(20, 20, 20, 0.6) !important;
  606. }
  607. @supports (-ms-accelerator:true) {
  608. color: rgba(20, 20, 20, 0.6) !important;
  609. }
  610. }
  611. }
  612. svg {
  613. fill: $light-color;
  614. color: $light-color;
  615. }
  616. }
  617. .trumbowyg-button-pane {
  618. background-color: $dark-color;
  619. border-bottom-color: lighten($dark-color, 7%);
  620. &::after {
  621. background: lighten($dark-color, 7%);
  622. }
  623. .trumbowyg-button-group:not(:empty) {
  624. &::after {
  625. background-color: lighten($dark-color, 7%);
  626. }
  627. .trumbowyg-fullscreen-button svg {
  628. color: transparent;
  629. }
  630. }
  631. &.trumbowyg-disable {
  632. .trumbowyg-button-group::after {
  633. background-color: lighten($dark-color, 3%);
  634. }
  635. }
  636. button:not(.trumbowyg-disable):hover,
  637. button:not(.trumbowyg-disable):focus,
  638. button.trumbowyg-active {
  639. background-color: #333;
  640. }
  641. .trumbowyg-open-dropdown::after {
  642. border-top-color: #fff;
  643. }
  644. }
  645. .trumbowyg-fullscreen {
  646. .trumbowyg-button-pane .trumbowyg-button-group:not(:empty) .trumbowyg-fullscreen-button svg {
  647. color: $light-color;
  648. fill: transparent;
  649. }
  650. }
  651. .trumbowyg-dropdown {
  652. border-color: $dark-color;
  653. background: #333;
  654. box-shadow: rgba(0, 0, 0, .3) 0 2px 3px;
  655. button {
  656. background: #333;
  657. color: #fff !important;
  658. &:hover,
  659. &:focus {
  660. background: $dark-color;
  661. }
  662. }
  663. }
  664. // Modal box
  665. .trumbowyg-modal-box {
  666. background-color: $dark-color;
  667. .trumbowyg-modal-title {
  668. border-bottom: 1px solid #555;
  669. color: #fff;
  670. background: lighten($dark-color, 10%);
  671. }
  672. label {
  673. display: block;
  674. position: relative;
  675. margin: 15px 12px;
  676. height: 27px;
  677. line-height: 27px;
  678. overflow: hidden;
  679. .trumbowyg-input-infos {
  680. span {
  681. color: #eee;
  682. background-color: lighten($dark-color, 5%);
  683. border-color: $dark-color;
  684. }
  685. span.trumbowyg-msg-error {
  686. color: #e74c3c;
  687. }
  688. }
  689. &.trumbowyg-input-error {
  690. input,
  691. textarea {
  692. border-color: #e74c3c;
  693. }
  694. }
  695. input {
  696. border-color: $dark-color;
  697. color: #eee;
  698. background: #333;
  699. &:hover,
  700. &:focus {
  701. border-color: lighten($dark-color, 25%);
  702. }
  703. &:focus {
  704. background-color: lighten($dark-color, 5%);
  705. }
  706. }
  707. }
  708. .trumbowyg-modal-button {
  709. &.trumbowyg-modal-submit {
  710. background: darken($modal-submit-color, 20%);
  711. &:hover,
  712. &:focus {
  713. background: darken($modal-submit-color, 10%);
  714. }
  715. &:active {
  716. background: darken($modal-submit-color, 25%);
  717. }
  718. }
  719. &.trumbowyg-modal-reset {
  720. background: #333;
  721. color: #ccc;
  722. &:hover,
  723. &:focus {
  724. background: #444;
  725. }
  726. &:active {
  727. background: #111;
  728. }
  729. }
  730. }
  731. }
  732. .trumbowyg-overlay {
  733. background-color: rgba(15, 15, 15, 0.6);
  734. }
  735. }