_on-edit.scss 6.1 KB

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