_on-edit.scss 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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. }
  114. }
  115. // ellipsis .grw-page-path-hierarchical-link
  116. .grw-subnav-left-side {
  117. overflow: hidden;
  118. .grw-path-nav-container {
  119. overflow: hidden;
  120. .grw-page-path-nav {
  121. white-space: nowrap;
  122. .grw-page-path-hierarchical-link {
  123. width: 100%;
  124. overflow: hidden;
  125. text-overflow: ellipsis;
  126. }
  127. h1 {
  128. overflow: hidden;
  129. }
  130. }
  131. }
  132. }
  133. .nav:hover {
  134. .btn-copy,
  135. .btn-edit,
  136. .btn-edit-tags {
  137. // change button opacity
  138. opacity: unset;
  139. }
  140. }
  141. &.builtin-editor {
  142. /*****************
  143. * Editor styles
  144. *****************/
  145. .page-editor-editor-container {
  146. border-right: 1px solid transparent;
  147. // override CodeMirror styles
  148. .CodeMirror {
  149. .cm-matchhighlight {
  150. background-color: cyan;
  151. }
  152. .CodeMirror-selection-highlight-scrollbar {
  153. background-color: darkcyan;
  154. }
  155. }
  156. // add icon on cursor
  157. .markdown-table-activated,
  158. .markdown-link-activated {
  159. .CodeMirror-cursor {
  160. &:after {
  161. position: relative;
  162. top: -1.1em;
  163. left: 0.3em;
  164. display: block;
  165. width: 1em;
  166. height: 1em;
  167. content: ' ';
  168. background-repeat: no-repeat;
  169. background-size: 1em;
  170. }
  171. }
  172. }
  173. .markdown-table-activated .CodeMirror-cursor {
  174. &:after {
  175. background-image: url(/images/icons/editor/table.svg);
  176. }
  177. }
  178. .markdown-link-activated .CodeMirror-cursor {
  179. &:after {
  180. background-image: url(/images/icons/editor/link.svg);
  181. }
  182. }
  183. .textarea-editor {
  184. font-family: monospace;
  185. border: none;
  186. }
  187. }
  188. .page-editor-preview-container {
  189. }
  190. .page-editor-preview-body {
  191. padding-top: 18px;
  192. padding-right: 15px;
  193. padding-left: 15px;
  194. overflow-y: scroll;
  195. }
  196. .grw-editor-configuration-dropdown {
  197. .icon-container {
  198. width: 20px;
  199. }
  200. .menuitem-label {
  201. min-width: 130px;
  202. }
  203. }
  204. }
  205. // .builtin-editor .tab-pane#edit
  206. &.hackmd {
  207. .hackmd-preinit,
  208. #iframe-hackmd-container > iframe {
  209. border: none;
  210. }
  211. .hackmd-error {
  212. top: 0;
  213. background-color: rgba($gray-800, 0.8);
  214. }
  215. .hackmd-status-label {
  216. font-size: 3em;
  217. }
  218. .hackmd-resume-button-container,
  219. .hackmd-discard-button-container {
  220. .btn-text {
  221. display: inline-block;
  222. min-width: 230px;
  223. }
  224. }
  225. .btn-view-outdated-draft {
  226. text-decoration: underline;
  227. vertical-align: unset;
  228. }
  229. }
  230. }
  231. // overwrite .CodeMirror pre
  232. .CodeMirror pre.CodeMirror-line {
  233. font-family: $font-family-monospace;
  234. }
  235. // overwrite .CodeMirror-hints
  236. .CodeMirror-hints {
  237. max-height: 30em !important;
  238. .CodeMirror-hint.crowi-emoji-autocomplete {
  239. font-family: $font-family-monospace-not-strictly;
  240. line-height: 1.6em;
  241. .img-container {
  242. display: inline-block;
  243. width: 30px;
  244. }
  245. }
  246. // active line
  247. .CodeMirror-hint-active.crowi-emoji-autocomplete {
  248. .img-container {
  249. padding-top: 0.3em;
  250. padding-bottom: 0.3em;
  251. font-size: 15px; // adjust to .wiki
  252. }
  253. }
  254. }
  255. // overwrite .CodeMirror-placeholder
  256. .CodeMirror pre.CodeMirror-placeholder {
  257. color: $text-muted;
  258. }
  259. #tag-edit-button-tooltip {
  260. .tooltip-inner {
  261. color: black;
  262. background-color: white;
  263. border: 1px solid $gray-300;
  264. }
  265. .tooltip-arrow {
  266. border-bottom: 5px solid $gray-300;
  267. }
  268. }