_on-edit.scss 6.3 KB

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