_on-edit.scss 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. @import 'editor-overlay';
  2. body:not(.on-edit) {
  3. // hide .page-editor-footer
  4. .page-editor-footer {
  5. display: none !important;
  6. border: none;
  7. }
  8. }
  9. body.on-edit {
  10. // calculate margin
  11. $header-plus-footer: 42px // .nav height
  12. + 1px // .page-editor-footer border-top
  13. + 40px !default; // .page-editor-footer min-height
  14. @include expand-editor($header-plus-footer);
  15. // for growi layout
  16. .main {
  17. >.row {
  18. margin: 0;
  19. >.col-lg-10,
  20. >.col-md-9 {
  21. width: 100%;
  22. padding: 0;
  23. }
  24. }
  25. }
  26. // hide unnecessary elements
  27. .navbar.navbar-static-top,
  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: 1;
  80. width: calc(100% - #{$left-margin} - #{$right-margin});
  81. pointer-events: none; // disable pointer-events because it becomes an obstacle
  82. background: none;
  83. >.header-container {
  84. width: 100%; // for crowi layout
  85. padding: 0; // for crowi layout
  86. pointer-events: initial; // enable pointer-events
  87. }
  88. .header-wrap {
  89. overflow-x: hidden;
  90. }
  91. h1#revision-path {
  92. @include variable-font-size(20px);
  93. line-height: 1em;
  94. // nowrap even if the path is too long
  95. .d-flex {
  96. flex-wrap: nowrap;
  97. }
  98. .path-segment {
  99. white-space: nowrap;
  100. }
  101. }
  102. div#page-tag {
  103. display: inline;
  104. margin-right: auto;
  105. .page-tag-form {
  106. border-radius: 5px;
  107. }
  108. }
  109. // hide if screen size is less than tablet
  110. @media (max-width: $screen-sm) {
  111. display: none;
  112. }
  113. }
  114. .page-editor-footer {
  115. width: 100%;
  116. min-height: 40px;
  117. padding: 3px;
  118. margin: 0;
  119. border-top: solid 1px transparent;
  120. .grant-selector {
  121. .btn-group {
  122. min-width: 150px;
  123. }
  124. }
  125. .btn-submit {
  126. width: 100px;
  127. }
  128. }
  129. #page-status-alert .myadmin-alert {
  130. position: absolute;
  131. right: 3px;
  132. bottom: 42px;
  133. left: 3px;
  134. box-shadow: 2px 2px 5px #666;
  135. opacity: 0.8;
  136. &:hover {
  137. opacity: 1;
  138. }
  139. }
  140. &.builtin-editor {
  141. /*****************
  142. * Editor styles
  143. *****************/
  144. .page-editor-editor-container {
  145. border-right: 1px solid transparent;
  146. // override CodeMirror styles
  147. .CodeMirror {
  148. .cm-matchhighlight {
  149. background-color: cyan;
  150. }
  151. .CodeMirror-selection-highlight-scrollbar {
  152. background-color: darkcyan;
  153. }
  154. }
  155. .navbar-editor {
  156. border-bottom: 1px solid transparent;
  157. }
  158. // add icon on cursor
  159. .autoformat-markdown-table-activated .CodeMirror-cursor {
  160. &:after {
  161. position: relative;
  162. top: -16px;
  163. left: 5px;
  164. display: block;
  165. width: 14px;
  166. height: 14px;
  167. content: ' ';
  168. background-image: url(/images/icons/editor/table.svg);
  169. }
  170. }
  171. .textarea-editor {
  172. font-family: monospace;
  173. border: none;
  174. }
  175. }
  176. .page-editor-preview-container {}
  177. .page-editor-preview-body {
  178. padding-top: 18px;
  179. padding-right: 15px;
  180. overflow-y: scroll;
  181. }
  182. #page-editor-options-selector {
  183. label {
  184. margin-right: 0.5em;
  185. }
  186. // configuration dropdown
  187. .configuration-dropdown {
  188. .icon-container {
  189. display: inline-block;
  190. width: 20px;
  191. }
  192. .dropdown-menu>li>a {
  193. display: flex;
  194. align-items: center;
  195. justify-content: space-between;
  196. .menuitem-label {
  197. flex: 1;
  198. margin-right: 10px;
  199. }
  200. }
  201. }
  202. // less than smartphone size
  203. @media (max-width: $screen-xs-max) {
  204. display: none;
  205. }
  206. }
  207. #page-grant-selector {
  208. .btn-group {
  209. min-width: 150px;
  210. }
  211. }
  212. #page-grant-selector {
  213. .btn-group {
  214. min-width: 150px;
  215. }
  216. }
  217. }
  218. // .builtin-editor .tab-pane#edit
  219. &.hackmd {
  220. #page-editor-options-selector {
  221. display: none;
  222. }
  223. .hackmd-preinit,
  224. #iframe-hackmd-container>iframe {
  225. border: none;
  226. }
  227. .hackmd-status-label {
  228. font-size: 3em;
  229. color: $muted;
  230. }
  231. .hackmd-start-button-container,
  232. .hackmd-resume-button-container {
  233. .btn-lg .btn-label {
  234. padding-top: 6px; // for SplitButton
  235. padding-bottom: 6px; // for SplitButton
  236. }
  237. }
  238. .hackmd-resume-button-container {
  239. .dropdown-menu {
  240. right: 0;
  241. left: unset;
  242. }
  243. }
  244. .hackmd-discard-button {
  245. text-decoration: underline;
  246. vertical-align: unset;
  247. }
  248. }
  249. }
  250. /*
  251. * for creating portal
  252. */
  253. .nav-tabs-create-portal {
  254. display: none;
  255. }
  256. .on-edit .nav-tabs-create-portal {
  257. display: block;
  258. }
  259. // overwrite .CodeMirror pre
  260. .CodeMirror pre {
  261. font-family: $font-family-monospace;
  262. }
  263. // overwrite .CodeMirror-hints
  264. .CodeMirror-hints {
  265. max-height: 30em !important;
  266. .CodeMirror-hint.crowi-emoji-autocomplete {
  267. font-family: $font-family-monospace-not-strictly;
  268. line-height: 1.6em;
  269. .img-container {
  270. display: inline-block;
  271. width: 30px;
  272. }
  273. }
  274. // active line
  275. .CodeMirror-hint-active.crowi-emoji-autocomplete {
  276. .img-container {
  277. padding-top: 0.3em;
  278. padding-bottom: 0.3em;
  279. font-size: 15px; // adjust to .wiki
  280. }
  281. }
  282. }
  283. // overwrite .CodeMirror-placeholder
  284. .CodeMirror pre.CodeMirror-placeholder {
  285. color: $text-muted;
  286. }
  287. #tag-edit-button-tooltip {
  288. .tooltip-inner {
  289. background-color: #fff;
  290. color: #000;
  291. border: 1px solid #ccc;
  292. }
  293. .tooltip-arrow {
  294. border-bottom: 5px solid #ccc;
  295. }
  296. }