_on-edit.scss 6.0 KB

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