_editor.scss 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. // Grav Editor
  2. .grav-editor-content {
  3. position: relative;
  4. }
  5. .grav-editor {
  6. [data-grav-editor] {
  7. height: 300px;
  8. &.code-mirrored {
  9. padding: 0;
  10. border: 0;
  11. position: absolute;
  12. z-index: -1;
  13. display: block !important;
  14. }
  15. }
  16. .CodeMirror {
  17. .CodeMirror-vscrollbar, .CodeMirror-hscrollbar {
  18. z-index: 1;
  19. }
  20. }
  21. .CodeMirror-scroll {
  22. //margin-right: -36px;
  23. position: static;
  24. // hide native scrollbar at the bottom
  25. padding-bottom: 15px;
  26. }
  27. .grav-editor-resizer {
  28. height: 6px;
  29. cursor: row-resize;
  30. border-radius: 0 0 3px 3px;
  31. margin-top: -2px;
  32. position: relative;
  33. z-index: 1;
  34. }
  35. .CodeMirror-selected {
  36. background: #D6E8FF;
  37. }
  38. .CodeMirror-gutters {
  39. height: 100%!important;
  40. }
  41. }
  42. .grav-editor-fullscreen {
  43. position: fixed;
  44. top: 4.2rem;
  45. left: 0;
  46. bottom: 0;
  47. right: 0;
  48. z-index: 3;
  49. padding: 0 !important;
  50. margin: 0 !important;
  51. display: flex;
  52. flex-direction: column;
  53. .grav-editor-content {
  54. display: flex;
  55. flex-direction: column;
  56. flex: 1 0 0;
  57. overflow-y: auto;
  58. }
  59. .grav-editor-content, .CodeMirror-wrap, .grav-editor-preview {
  60. height: 100% !important;
  61. }
  62. .grav-editor-toolbar {
  63. flex: 0 0 auto;
  64. }
  65. .grav-editor-toolbar, .grav-editor-toolbar ul li:first-child a, .grav-editor-toolbar-flip ul li:last-child a {
  66. border-radius: 0 !important;
  67. }
  68. .grav-editor-resizer {
  69. display: none;
  70. }
  71. .grav-editor-content.is-active {
  72. display: flex;
  73. }
  74. }
  75. .grav-editor-toolbar {
  76. @include align-items(stretch);
  77. @include display(flex);
  78. @include flex-direction(row);
  79. .grav-editor-actions {
  80. @include flex(1);
  81. }
  82. .grav-editor-modes {
  83. flex-shrink: 0;
  84. margin-right: 2px;
  85. ul {
  86. float: right;
  87. }
  88. }
  89. }
  90. .grav-editor-toolbar {
  91. @include clearfix;
  92. ul {
  93. list-style: none;
  94. margin: 0;
  95. padding: 0;
  96. li {
  97. &:first-child a {
  98. border-top-left-radius: 4px;
  99. }
  100. display: inline-block;
  101. }
  102. a {
  103. display: inline-block;
  104. cursor: pointer;
  105. background-color: transparent;
  106. border-radius: 0;
  107. padding: 0.4rem;
  108. margin-top: -1px;
  109. border: 1px solid transparent;
  110. &, &:hover, &:active, &:focus {
  111. outline: 0;
  112. }
  113. }
  114. }
  115. .dropdown-menu li {
  116. width: 50%;
  117. }
  118. }
  119. .grav-editor-hide-toolbar {
  120. display: none;
  121. }
  122. .grav-editor-toolbar .grav-editor-modes {
  123. li {
  124. &:first-child a {
  125. border-top-left-radius: 0;
  126. }
  127. &:last-child a {
  128. border-top-right-radius: 4px;
  129. }
  130. }
  131. a {
  132. &:hover {
  133. /*border: 1px solid transparent;
  134. border-bottom: 1px solid darken($content-bg, 20%);*/
  135. }
  136. }
  137. }
  138. .grav-editor-toolbar-flip {
  139. float: right;
  140. ul li:last-child a {
  141. border-top-right-radius: 4px;
  142. }
  143. }
  144. .grav-editor-content, .grav-editor-preview {
  145. @include clearfix;
  146. cursor: text;
  147. display: none;
  148. &.is-active {
  149. display: block;
  150. }
  151. }
  152. .grav-editor-content {
  153. /* PADDING */
  154. .CodeMirror-lines {
  155. padding: 10px 0; /* Vertical padding around content */
  156. }
  157. }
  158. #admin-main {
  159. .grav-editor-preview {
  160. padding: 20px;
  161. overflow-y: scroll;
  162. position: relative;
  163. background: #fff;
  164. line-height: 1.5;
  165. h1, h2, h3, h4, h5, h6 {
  166. padding: 0;
  167. margin: 2rem 0 1rem;
  168. border-bottom: 0 !important;
  169. }
  170. p {
  171. padding: 0;
  172. margin: 0.5rem 0 1rem;
  173. }
  174. pre {
  175. padding: 1rem;
  176. }
  177. }
  178. }
  179. .grav-editor-toolbar {
  180. [data-hint]:after {
  181. white-space: nowrap !important;
  182. max-width: 300px;
  183. width: auto !important;
  184. }
  185. p {
  186. margin-top: 10px;
  187. margin-bottom: 10px;
  188. padding-left: 20px;
  189. }
  190. }
  191. // CodeMirror Theme
  192. .cm-s-paper {
  193. $paper-fg: #666;
  194. $tag: darken($paper-fg, 10%);
  195. &.CodeMirror {
  196. color: $paper-fg;
  197. line-height: 1.4;
  198. font-size: 16px;
  199. }
  200. .cm-link {color: #0082ba;}
  201. .cm-comment {color: lighten($paper-fg,10%);}
  202. .cm-header {color: darken($paper-fg,5%);}
  203. .cm-strong {color: darken($paper-fg,10%);}
  204. .cm-em {color: darken($paper-fg, 10%);}
  205. .cm-string {color: #0082BA;}
  206. .cm-tag {color: $tag}
  207. .cm-bracket {color: lighten($tag, 10%);}
  208. .cm-hr {color: lighten($paper-fg,40%);font-weight: bold;}
  209. .cm-keyword {color: #0082ba;}
  210. .cm-atom {color: #9055af;}
  211. .cm-meta {color: $paper-fg;}
  212. .cm-number {color: #7f8c8d;}
  213. .cm-def {color: #00f;}
  214. .cm-variable {color: black;}
  215. //.cm-variable-2 {color: #555;}
  216. //.cm-variable-3 {color: #085;}
  217. .cm-property {color: black;}
  218. .cm-operator {color: black;}
  219. .cm-string-2 {color: #f50;}
  220. .cm-meta {color: #555;}
  221. .cm-error {color: #f00;}
  222. .cm-qualifier {color: #555;}
  223. .cm-builtin {color: #555;}
  224. .cm-attribute {color: #7f8c8d;}
  225. .cm-quote {color: #888;}
  226. .cm-header-1 {font-size: 140%;}
  227. .cm-header-2 {font-size: 120%;}
  228. .cm-header-3 {font-size: 110%;}
  229. .cm-negative {color: #d44;}
  230. .cm-positive {color: #292;}
  231. .cm-header, .cm-strong {font-weight: bold;}
  232. .cm-em {font-style: italic;}
  233. .cm-link {text-decoration: underline;}
  234. .cm-invalidchar {color: #f00;}
  235. }