_on-edit.scss 6.1 KB

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