_on-edit.scss 6.4 KB

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