_on-edit.scss 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. @import 'editor-overlay';
  2. @import 'layout_variable';
  3. body:not(.on-edit) {
  4. // hide .page-editor-footer
  5. .page-editor-footer {
  6. display: none !important;
  7. border: none;
  8. }
  9. }
  10. body.on-edit {
  11. // calculate margin
  12. $editor-header-plus-footer: 42px // .nav-tabs height
  13. + 1px // .page-editor-footer border-top
  14. + 40px !default; // .page-editor-footer min-height
  15. @include expand-editor($editor-header-plus-footer);
  16. // for growi layout
  17. .main {
  18. .col.grw-page-content-container {
  19. padding: 0;
  20. }
  21. }
  22. // hide unnecessary elements
  23. header,
  24. footer,
  25. .d-edit-none {
  26. display: none !important;
  27. }
  28. // hide unnecessary elements for growi layout
  29. .revision-toc-container {
  30. display: none !important;
  31. }
  32. // show only either Edit button or HackMD button
  33. &.hackmd .nav-tab-edit {
  34. display: none;
  35. }
  36. &.hackmd .grw-nav-item-edit {
  37. display: none;
  38. }
  39. &.hackmd {
  40. #page-editor-options-selector {
  41. display: none !important;
  42. }
  43. }
  44. &:not(.hackmd) .nav-tab-hackmd {
  45. display: none;
  46. }
  47. // hide hackmd related alert
  48. &.hackmd #page-status-alert {
  49. .alert-hackmd-someone-editing,
  50. .alert-hackmd-draft-exists {
  51. display: none;
  52. }
  53. }
  54. // show revision path
  55. .grw-revision-path-for-edit {
  56. display: block !important;
  57. }
  58. /*****************
  59. * Expand Editor
  60. *****************/
  61. .container-fluid {
  62. padding-bottom: 0;
  63. }
  64. .row.grw-subnav {
  65. $left-margin: $grw-nav-main-left-tab-width * 2 + 25px; // width of .grw-nav-main-left-tab x 2 + some margin
  66. $right-margin: 128px + 94px + 46px; // width of all of grw-nav-main-right-tab
  67. position: absolute;
  68. left: $left-margin;
  69. z-index: 7; // forward than .CodeMirror-vscrollbar
  70. width: calc(100% - #{$left-margin} - #{$right-margin});
  71. padding-top: 3px;
  72. pointer-events: none; // disable pointer-events because it becomes an obstacle
  73. background: none;
  74. > .grw-subnav-container {
  75. width: 100%; // for crowi layout
  76. padding: 0; // for crowi layout
  77. pointer-events: initial; // enable pointer-events
  78. }
  79. h1#revision-path {
  80. @include variable-font-size(20px);
  81. line-height: 1em;
  82. // nowrap even if the path is too long
  83. .d-flex {
  84. flex-wrap: nowrap;
  85. }
  86. .path-segment {
  87. white-space: nowrap;
  88. }
  89. }
  90. .tag-labels.new-page {
  91. display: block;
  92. }
  93. }
  94. .page-editor-footer {
  95. width: 100%;
  96. min-height: 40px;
  97. padding: 3px;
  98. margin: 0;
  99. border-top: solid 1px transparent;
  100. .grw-grant-selector {
  101. .dropdown-toggle {
  102. min-width: 100px;
  103. // caret
  104. &::after {
  105. margin-left: 1em;
  106. }
  107. }
  108. }
  109. .btn-submit {
  110. width: 100px;
  111. }
  112. }
  113. &.builtin-editor {
  114. /*****************
  115. * Editor styles
  116. *****************/
  117. .page-editor-editor-container {
  118. border-right: 1px solid transparent;
  119. // override CodeMirror styles
  120. .CodeMirror {
  121. .cm-matchhighlight {
  122. background-color: cyan;
  123. }
  124. .CodeMirror-selection-highlight-scrollbar {
  125. background-color: darkcyan;
  126. }
  127. }
  128. // add icon on cursor
  129. .markdown-table-activated .CodeMirror-cursor {
  130. &:after {
  131. position: relative;
  132. top: -1.1em;
  133. left: 0.3em;
  134. display: block;
  135. width: 1em;
  136. height: 1em;
  137. content: ' ';
  138. background-image: url(/images/icons/editor/table.svg);
  139. background-repeat: no-repeat;
  140. background-size: 1em;
  141. }
  142. }
  143. .textarea-editor {
  144. font-family: monospace;
  145. border: none;
  146. }
  147. }
  148. .page-editor-preview-container {
  149. }
  150. .page-editor-preview-body {
  151. padding-top: 18px;
  152. padding-right: 15px;
  153. padding-left: 15px;
  154. overflow-y: scroll;
  155. }
  156. #page-editor-options-selector {
  157. .grw-editor-configuration-dropdown {
  158. .icon-container {
  159. display: inline-block;
  160. width: 20px;
  161. }
  162. .dropdown-menu > li > a {
  163. display: flex;
  164. align-items: center;
  165. justify-content: space-between;
  166. .menuitem-label {
  167. flex: 1;
  168. margin-right: 10px;
  169. }
  170. }
  171. }
  172. }
  173. #page-grant-selector {
  174. .btn-group {
  175. min-width: 150px;
  176. }
  177. }
  178. #page-grant-selector {
  179. .btn-group {
  180. min-width: 150px;
  181. }
  182. }
  183. }
  184. // .builtin-editor .tab-pane#edit
  185. &.hackmd {
  186. #page-editor-options-selector {
  187. display: none;
  188. }
  189. .hackmd-preinit,
  190. #iframe-hackmd-container > iframe {
  191. border: none;
  192. }
  193. .hackmd-error {
  194. top: 0;
  195. background-color: rgba($gray-800, 0.8);
  196. }
  197. .hackmd-status-label {
  198. font-size: 3em;
  199. color: $muted;
  200. }
  201. .hackmd-resume-button-container,
  202. .hackmd-discard-button-container {
  203. .btn-text {
  204. display: inline-block;
  205. min-width: 230px;
  206. }
  207. }
  208. .btn-view-outdated-draft {
  209. text-decoration: underline;
  210. vertical-align: unset;
  211. }
  212. }
  213. }
  214. /*
  215. * for creating portal
  216. */
  217. .nav-tabs-create-portal {
  218. display: none;
  219. }
  220. .on-edit .nav-tabs-create-portal {
  221. display: block;
  222. }
  223. // overwrite .CodeMirror pre
  224. .CodeMirror pre.CodeMirror-line {
  225. font-family: $font-family-monospace;
  226. }
  227. // overwrite .CodeMirror-hints
  228. .CodeMirror-hints {
  229. max-height: 30em !important;
  230. .CodeMirror-hint.crowi-emoji-autocomplete {
  231. font-family: $font-family-monospace-not-strictly;
  232. line-height: 1.6em;
  233. .img-container {
  234. display: inline-block;
  235. width: 30px;
  236. }
  237. }
  238. // active line
  239. .CodeMirror-hint-active.crowi-emoji-autocomplete {
  240. .img-container {
  241. padding-top: 0.3em;
  242. padding-bottom: 0.3em;
  243. font-size: 15px; // adjust to .wiki
  244. }
  245. }
  246. }
  247. // overwrite .CodeMirror-placeholder
  248. .CodeMirror pre.CodeMirror-placeholder {
  249. color: $text-muted;
  250. }
  251. #tag-edit-button-tooltip {
  252. .tooltip-inner {
  253. color: #000;
  254. background-color: #fff;
  255. border: 1px solid #ccc;
  256. }
  257. .tooltip-arrow {
  258. border-bottom: 5px solid #ccc;
  259. }
  260. }