_on-edit.scss 6.1 KB

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