8
0

snippet-styles.css 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. /*
  2. * Copyright (c) 2003-2020, 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. /* warning notification */
  91. .main__notification.notice {
  92. position: fixed;
  93. max-width: 650px;
  94. border: 1px solid #e4e4e4;
  95. border-left-color: #f9c669;
  96. border-left-width: 3px;
  97. box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  98. /* override .notice class' margins and paddings */
  99. padding: 20px 40px 20px 20px;
  100. margin: 0;
  101. /* elevate the warning above the editor's toolbars */
  102. z-index: 99999999;
  103. animation: fadeIn .3s ease-in-out forwards;
  104. }
  105. /* class chaining for style overriding */
  106. .formatted .main__notification-title {
  107. font-weight: bold;
  108. font-size: 16px;
  109. padding: 0;
  110. margin: 0;
  111. }
  112. .main__notification-body {
  113. margin-top: 10px;
  114. }
  115. .main__notification-body p {
  116. margin-bottom: 0.3em;
  117. }
  118. .main__notification-body p:last-child {
  119. margin-bottom: 0;
  120. }
  121. .main__notification-close {
  122. position: absolute;
  123. top: 0;
  124. right: 0;
  125. padding: 20px;
  126. /* reset default button styling */
  127. background: none;
  128. border: none;
  129. box-shadow: none;
  130. line-height: 1;
  131. -webkit-appearance: none;
  132. -moz-appearance: none;
  133. appearance: none;
  134. cursor: pointer;
  135. }
  136. @keyframes fadeIn {
  137. from {
  138. opacity: 0;
  139. }
  140. to {
  141. opacity: 1;
  142. }
  143. }
  144. /* examples/builds/inline-editor.html */
  145. .live-snippet .image-style-left, .live-snippet .image-style-right {
  146. float: left;
  147. height: auto;
  148. width: 50%;
  149. margin-top: .5rem;
  150. margin-right: 2.5rem;
  151. }
  152. .live-snippet .image-style-right {
  153. float: right;
  154. margin-right: 0;
  155. margin-left: 2.5rem;
  156. }
  157. .live-snippet .image img {
  158. margin: 0 auto;
  159. }
  160. .live-snippet blockquote p:first-of-type {
  161. margin-bottom: 1.5rem;
  162. }
  163. /* https://github.com/ckeditor/ckeditor5/issues/896 */
  164. .live-snippet .ck.ck-content h2,
  165. .live-snippet .ck.ck-content h3,
  166. .live-snippet .ck.ck-content h4 {
  167. position: static;
  168. }
  169. /* https://github.com/ckeditor/ckeditor5/issues/899 */
  170. .live-snippet .ck-dropdown .ck.ck-list {
  171. margin: 0;
  172. padding: 0;
  173. }
  174. /* https://github.com/ckeditor/ckeditor5/pull/1060 */
  175. .live-snippet .ck.ck-content .table table {
  176. margin: 0;
  177. display: table;
  178. }
  179. /* https://github.com/ckeditor/ckeditor5/issues/1282 */
  180. .live-snippet .ck.ck-content .table p:first-child {
  181. padding-top: 0;
  182. }
  183. /* https://github.com/ckeditor/ckeditor5/issues/1282 */
  184. .live-snippet .ck.ck-content .table p:last-child,
  185. .live-snippet .ck.ck-content .table ul:last-child,
  186. .live-snippet .ck.ck-content .table ol:last-child {
  187. margin-bottom: 0;
  188. }
  189. #snippet-inline-editor .ck-content {
  190. margin-bottom: 1rem;
  191. padding: 2rem;
  192. }
  193. /* Visually separate inline editors from example description.
  194. https://github.com/ckeditor/ckeditor5/issues/1545 */
  195. #snippet-inline-editor .ck-content:not(.ck-focused),
  196. #snippet-balloon-editor.ck-content:not(.ck-focused),
  197. #snippet-balloon-block-editor.ck-content:not(.ck-focused) {
  198. border: 1px solid rgba(0, 0, 0, 0.15);
  199. }
  200. #snippet-inline-editor h2, #snippet-inline-editor h3 {
  201. margin-top: 0;
  202. padding-top: 0;
  203. border-bottom: 0;
  204. }
  205. #snippet-inline-editor header.ck-content {
  206. text-align: center;
  207. }
  208. #snippet-inline-editor header.ck-content h2 {
  209. margin-bottom: 0;
  210. font-size: 2.1rem;
  211. }
  212. #snippet-inline-editor header.ck-content h3 {
  213. color: rgba(5, 22, 42, 0.59);
  214. font-weight: 600;
  215. font-size: 1.6rem;
  216. }
  217. /* examples/builds/document-editor.html */
  218. .live-snippet .document-editor {
  219. margin: 1.5em 0;
  220. }