snippet-styles.css 5.4 KB

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