_on-edit.scss 6.1 KB

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