2
0

_on-edit.scss 7.2 KB

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