8
0

snippet-styles.css 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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: 10px;
  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. .main__notification-close:active:focus {
  137. outline: none;
  138. }
  139. @keyframes fadeIn {
  140. from {
  141. opacity: 0;
  142. }
  143. to {
  144. opacity: 1;
  145. }
  146. }
  147. /* examples/builds/inline-editor.html */
  148. .live-snippet .image-style-left, .live-snippet .image-style-right {
  149. float: left;
  150. height: auto;
  151. width: 50%;
  152. margin-top: .5rem;
  153. margin-right: 2.5rem;
  154. }
  155. .live-snippet .image-style-right {
  156. float: right;
  157. margin-right: 0;
  158. margin-left: 2.5rem;
  159. }
  160. .live-snippet .image img {
  161. margin: 0 auto;
  162. }
  163. .live-snippet blockquote p:first-of-type {
  164. margin-bottom: 1.5rem;
  165. }
  166. /* https://github.com/ckeditor/ckeditor5/issues/896 */
  167. .live-snippet .ck.ck-content h2,
  168. .live-snippet .ck.ck-content h3,
  169. .live-snippet .ck.ck-content h4 {
  170. position: static;
  171. }
  172. /* https://github.com/ckeditor/ckeditor5/issues/899 */
  173. .live-snippet .ck-dropdown .ck.ck-list {
  174. margin: 0;
  175. padding: 0;
  176. }
  177. /* https://github.com/ckeditor/ckeditor5/pull/1060 */
  178. .live-snippet .ck.ck-content .table table {
  179. margin: 0;
  180. display: table;
  181. }
  182. /* https://github.com/ckeditor/ckeditor5/issues/1282 */
  183. .live-snippet .ck.ck-content .table p:first-child {
  184. padding-top: 0;
  185. }
  186. /* https://github.com/ckeditor/ckeditor5/issues/1282 */
  187. .live-snippet .ck.ck-content .table p:last-child,
  188. .live-snippet .ck.ck-content .table ul:last-child,
  189. .live-snippet .ck.ck-content .table ol:last-child {
  190. margin-bottom: 0;
  191. }
  192. #snippet-inline-editor .ck-content {
  193. margin-bottom: 1rem;
  194. padding: 2rem;
  195. }
  196. /* Visually separate inline editors from example description.
  197. https://github.com/ckeditor/ckeditor5/issues/1545 */
  198. #snippet-inline-editor .ck-content:not(.ck-focused),
  199. #snippet-balloon-editor.ck-content:not(.ck-focused),
  200. #snippet-balloon-block-editor.ck-content:not(.ck-focused) {
  201. border: 1px solid rgba(0, 0, 0, 0.15);
  202. }
  203. #snippet-inline-editor h2, #snippet-inline-editor h3 {
  204. margin-top: 0;
  205. padding-top: 0;
  206. border-bottom: 0;
  207. }
  208. #snippet-inline-editor header.ck-content {
  209. text-align: center;
  210. }
  211. #snippet-inline-editor header.ck-content h2 {
  212. margin-bottom: 0;
  213. font-size: 2.1rem;
  214. }
  215. #snippet-inline-editor header.ck-content h3 {
  216. color: rgba(5, 22, 42, 0.59);
  217. font-weight: 600;
  218. font-size: 1.6rem;
  219. }
  220. /* examples/builds/document-editor.html */
  221. .live-snippet .document-editor {
  222. margin: 1.5em 0;
  223. }