8
0

snippet-styles.css 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. /*
  2. * Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
  3. */
  4. :root {
  5. /* This custom property is read by the JS and passed to editor configurations
  6. as config.toolbar.viewportTopOffset. */
  7. --ck-snippet-viewport-top-offset: 100
  8. }
  9. @media (max-width: 960px) {
  10. :root {
  11. /* The mobile layout of Umberto is different and the toolbar offset must be
  12. smaller (https://github.com/ckeditor/ckeditor5/issues/1348). */
  13. --ck-snippet-viewport-top-offset: 55;
  14. }
  15. }
  16. .ck.ck-editor {
  17. margin: 1.5em 0;
  18. }
  19. .ck.ck-content {
  20. padding: 1em;
  21. }
  22. .ck.ck-content > :first-child {
  23. margin-top: 0;
  24. }
  25. .ck.ck-content > :last-child {
  26. margin-bottom: 0;
  27. }
  28. /* Override default Umberto's styles because they apply margins to media embed widgets with iframe
  29. previews breaking their structure. */
  30. .ck.ck-content iframe {
  31. margin: initial;
  32. }
  33. /* Reset h1's styling – https://github.com/ckeditor/ckeditor5-heading/issues/86 */
  34. .ck.ck-content h1 {
  35. display: block;
  36. margin-bottom: .5em;
  37. }
  38. /* By default Umberto uses a trick with non breaking spaces around <code> to fix space rendering.
  39. It breaks CKEditor 5 (see how <p><code>[]</code></p> looks). */
  40. .ck.ck-content code:before,
  41. .ck.ck-content code:after {
  42. content: '' !important;
  43. letter-spacing: 0 !important;
  44. display: none !important; /* Firefox is very stubborn. */
  45. }
  46. /* Restore default browser styles for <sub> and <sup>. */
  47. .ck.ck-content sub {
  48. vertical-align: sub;
  49. font-size: smaller;
  50. }
  51. .ck.ck-content sup {
  52. vertical-align: super;
  53. font-size: smaller;
  54. }
  55. .ck.ck-list {
  56. /* See https://github.com/ckeditor/ckeditor5/issues/494 */
  57. margin-left: 0;
  58. }
  59. .demo-row {
  60. width: 100%;
  61. display: -ms-flexbox;
  62. display: flex;
  63. }
  64. .demo-row__half {
  65. width: 50%;
  66. }
  67. .demo-row__half:first-of-type {
  68. padding-right: .5rem;
  69. }
  70. .demo-row__half:last-of-type {
  71. padding-left: .5rem;
  72. }
  73. .demo-row__third {
  74. width: 33.3333%;
  75. }
  76. .demo-row__third > div {
  77. padding: 2.5rem;
  78. border: 1px solid rgba(0, 0, 0, 0.15);
  79. }
  80. .demo-row__third:nth-of-type(2) {
  81. padding-left: 1rem;
  82. padding-right: 1rem;
  83. }
  84. .demo-row h3 {
  85. margin: 0;
  86. }
  87. .demo-row p {
  88. margin-bottom: 0;
  89. }
  90. /* examples/builds/inline-editor.html */
  91. .live-snippet .image-style-left, .live-snippet .image-style-right {
  92. float: left;
  93. height: auto;
  94. width: 50%;
  95. margin-top: .5rem;
  96. margin-right: 2.5rem;
  97. }
  98. .live-snippet .image-style-right {
  99. float: right;
  100. margin-right: 0;
  101. margin-left: 2.5rem;
  102. }
  103. .live-snippet .image img {
  104. margin: 0 auto;
  105. }
  106. .live-snippet blockquote p:first-of-type {
  107. margin-bottom: 1.5rem;
  108. }
  109. /* https://github.com/ckeditor/ckeditor5/issues/896 */
  110. .live-snippet .ck.ck-content h2,
  111. .live-snippet .ck.ck-content h3,
  112. .live-snippet .ck.ck-content h4 {
  113. position: static;
  114. }
  115. /* https://github.com/ckeditor/ckeditor5/issues/899 */
  116. .live-snippet .ck-dropdown .ck.ck-list {
  117. margin: 0;
  118. padding: 0;
  119. }
  120. /* https://github.com/ckeditor/ckeditor5/pull/1060 */
  121. .live-snippet .ck.ck-content .table table {
  122. margin: 0;
  123. display: table;
  124. }
  125. /* https://github.com/ckeditor/ckeditor5/issues/1282 */
  126. .live-snippet .ck.ck-content .table p:first-child {
  127. padding-top: 0;
  128. }
  129. /* https://github.com/ckeditor/ckeditor5/issues/1282 */
  130. .live-snippet .ck.ck-content .table p:last-child,
  131. .live-snippet .ck.ck-content .table ul:last-child,
  132. .live-snippet .ck.ck-content .table ol:last-child {
  133. margin-bottom: 0;
  134. }
  135. #snippet-inline-editor .ck-content {
  136. margin-bottom: 1rem;
  137. padding: 2rem;
  138. }
  139. /* Visually separate inline editors from example description.
  140. https://github.com/ckeditor/ckeditor5/issues/1545 */
  141. #snippet-inline-editor .ck-content:not(.ck-focused),
  142. #snippet-balloon-editor.ck-content:not(.ck-focused),
  143. #snippet-balloon-block-editor.ck-content:not(.ck-focused) {
  144. border: 1px solid rgba(0, 0, 0, 0.15);
  145. }
  146. #snippet-inline-editor h2, #snippet-inline-editor h3 {
  147. margin-top: 0;
  148. padding-top: 0;
  149. border-bottom: 0;
  150. }
  151. #snippet-inline-editor header.ck-content {
  152. text-align: center;
  153. }
  154. #snippet-inline-editor header.ck-content h2 {
  155. margin-bottom: 0;
  156. font-size: 2.1rem;
  157. }
  158. #snippet-inline-editor header.ck-content h3 {
  159. color: rgba(5, 22, 42, 0.59);
  160. font-weight: 600;
  161. font-size: 1.6rem;
  162. }
  163. /* examples/builds/document-editor.html */
  164. .live-snippet .document-editor {
  165. margin: 1.5em 0;
  166. }