_on-edit.scss 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  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: 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. // hide if screen size is less than tablet
  104. @media (max-width: $screen-sm) {
  105. display: none;
  106. }
  107. }
  108. .page-editor-footer {
  109. width: 100%;
  110. min-height: 40px;
  111. padding: 3px;
  112. margin: 0;
  113. border-top: solid 1px transparent;
  114. .grant-selector {
  115. .btn-group {
  116. min-width: 150px;
  117. }
  118. }
  119. .btn-submit {
  120. width: 100px;
  121. }
  122. }
  123. #page-status-alert .myadmin-alert {
  124. position: absolute;
  125. right: 3px;
  126. bottom: 42px;
  127. left: 3px;
  128. box-shadow: 2px 2px 5px #666;
  129. opacity: 0.8;
  130. &:hover {
  131. opacity: 1;
  132. }
  133. }
  134. &.builtin-editor {
  135. /*****************
  136. * Editor styles
  137. *****************/
  138. .page-editor-editor-container {
  139. border-right: 1px solid transparent;
  140. // override CodeMirror styles
  141. .CodeMirror {
  142. .cm-matchhighlight {
  143. background-color: cyan;
  144. }
  145. .CodeMirror-selection-highlight-scrollbar {
  146. background-color: darkcyan;
  147. }
  148. }
  149. .navbar-editor {
  150. border-bottom: 1px solid transparent;
  151. }
  152. // add icon on cursor
  153. .autoformat-markdown-table-activated .CodeMirror-cursor {
  154. &:after {
  155. position: relative;
  156. top: -1.1em;
  157. left: 0.3em;
  158. display: block;
  159. width: 1em;
  160. height: 1em;
  161. content: ' ';
  162. background-image: url(/images/icons/editor/table.svg);
  163. background-repeat: no-repeat;
  164. background-size: 1em;
  165. }
  166. }
  167. .textarea-editor {
  168. font-family: monospace;
  169. border: none;
  170. }
  171. }
  172. .page-editor-preview-container {
  173. }
  174. .page-editor-preview-body {
  175. padding-top: 18px;
  176. padding-right: 15px;
  177. overflow-y: scroll;
  178. }
  179. #page-editor-options-selector {
  180. label {
  181. margin-right: 0.5em;
  182. }
  183. // configuration dropdown
  184. .configuration-dropdown {
  185. .icon-container {
  186. display: inline-block;
  187. width: 20px;
  188. }
  189. .dropdown-menu > li > a {
  190. display: flex;
  191. align-items: center;
  192. justify-content: space-between;
  193. .menuitem-label {
  194. flex: 1;
  195. margin-right: 10px;
  196. }
  197. }
  198. }
  199. // less than smartphone size
  200. @media (max-width: $screen-xs-max) {
  201. display: none;
  202. }
  203. }
  204. #page-grant-selector {
  205. .btn-group {
  206. min-width: 150px;
  207. }
  208. }
  209. #page-grant-selector {
  210. .btn-group {
  211. min-width: 150px;
  212. }
  213. }
  214. }
  215. // .builtin-editor .tab-pane#edit
  216. &.hackmd {
  217. #page-editor-options-selector {
  218. display: none;
  219. }
  220. .hackmd-preinit,
  221. #iframe-hackmd-container > iframe {
  222. border: none;
  223. }
  224. .hackmd-error {
  225. top: 0;
  226. background-color: rgba($gray-dark, 0.8);
  227. }
  228. .hackmd-status-label {
  229. font-size: 3em;
  230. color: $muted;
  231. }
  232. .hackmd-resume-button-container,
  233. .hackmd-discard-button-container {
  234. .btn-text {
  235. display: inline-block;
  236. min-width: 230px;
  237. }
  238. }
  239. .btn-view-outdated-draft {
  240. text-decoration: underline;
  241. vertical-align: unset;
  242. }
  243. }
  244. }
  245. /*
  246. * for creating portal
  247. */
  248. .nav-tabs-create-portal {
  249. display: none;
  250. }
  251. .on-edit .nav-tabs-create-portal {
  252. display: block;
  253. }
  254. // overwrite .CodeMirror pre
  255. .CodeMirror pre {
  256. font-family: $font-family-monospace;
  257. }
  258. // overwrite .CodeMirror-hints
  259. .CodeMirror-hints {
  260. max-height: 30em !important;
  261. .CodeMirror-hint.crowi-emoji-autocomplete {
  262. font-family: $font-family-monospace-not-strictly;
  263. line-height: 1.6em;
  264. .img-container {
  265. display: inline-block;
  266. width: 30px;
  267. }
  268. }
  269. // active line
  270. .CodeMirror-hint-active.crowi-emoji-autocomplete {
  271. .img-container {
  272. padding-top: 0.3em;
  273. padding-bottom: 0.3em;
  274. font-size: 15px; // adjust to .wiki
  275. }
  276. }
  277. }
  278. // overwrite .CodeMirror-placeholder
  279. .CodeMirror pre.CodeMirror-placeholder {
  280. color: $text-muted;
  281. }
  282. #tag-edit-button-tooltip {
  283. .tooltip-inner {
  284. color: #000;
  285. background-color: #fff;
  286. border: 1px solid #ccc;
  287. }
  288. .tooltip-arrow {
  289. border-bottom: 5px solid #ccc;
  290. }
  291. }