_on-edit.scss 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  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. border-style: solid;
  102. border-width: 1px;
  103. border-radius: 16px;
  104. .input-group-addon {
  105. padding: 0px !important;
  106. border-radius: 16px 0px 0px 16px;
  107. }
  108. .custom-control-label {
  109. &::after {
  110. background-image: url(/images/icons/slack/slack-logo-on.svg);
  111. }
  112. }
  113. .custom-control-input:checked ~ .custom-control-label {
  114. &::after {
  115. background-image: url(/images/icons/slack/slack-logo-off.svg);
  116. }
  117. }
  118. .input-group-addon {
  119. padding: 2px 8px;
  120. line-height: 1em;
  121. img,
  122. input {
  123. vertical-align: middle;
  124. }
  125. }
  126. .form-control {
  127. width: 80px;
  128. border: transparent;
  129. @include media-breakpoint-up(sm) {
  130. width: 130px;
  131. }
  132. @include media-breakpoint-up(md) {
  133. width: 180px;
  134. }
  135. }
  136. }
  137. .grw-grant-selector {
  138. @include media-breakpoint-down(sm) {
  139. .btn .label {
  140. display: none;
  141. }
  142. }
  143. @include media-breakpoint-up(md) {
  144. .dropdown-toggle {
  145. min-width: 100px;
  146. // caret
  147. &::after {
  148. margin-left: 1em;
  149. }
  150. }
  151. }
  152. }
  153. .btn-submit {
  154. width: 100px;
  155. }
  156. .btn-expand {
  157. // rotate icon
  158. i {
  159. display: inline-block;
  160. transition: transform 200ms;
  161. }
  162. &.expand i {
  163. transform: rotate(-180deg);
  164. }
  165. }
  166. }
  167. /*********************
  168. * Navigation styles
  169. */
  170. .nav:hover {
  171. .btn-copy,
  172. .btn-edit,
  173. .btn-edit-tags {
  174. // change button opacity
  175. opacity: unset;
  176. }
  177. }
  178. &.builtin-editor {
  179. /*****************
  180. * Editor styles
  181. *****************/
  182. .page-editor-editor-container {
  183. border-right: 1px solid transparent;
  184. // override CodeMirror styles
  185. .CodeMirror {
  186. .cm-matchhighlight {
  187. background-color: cyan;
  188. }
  189. .CodeMirror-selection-highlight-scrollbar {
  190. background-color: darkcyan;
  191. }
  192. }
  193. // add icon on cursor
  194. .markdown-table-activated,
  195. .markdown-link-activated {
  196. .CodeMirror-cursor {
  197. &:after {
  198. position: relative;
  199. top: -1.1em;
  200. left: 0.3em;
  201. display: block;
  202. width: 1em;
  203. height: 1em;
  204. content: ' ';
  205. background-repeat: no-repeat;
  206. background-size: 1em;
  207. }
  208. }
  209. }
  210. .markdown-table-activated .CodeMirror-cursor {
  211. &:after {
  212. background-image: url(/images/icons/editor/table.svg);
  213. }
  214. }
  215. .markdown-link-activated .CodeMirror-cursor {
  216. &:after {
  217. background-image: url(/images/icons/editor/link.svg);
  218. }
  219. }
  220. .textarea-editor {
  221. font-family: monospace;
  222. border: none;
  223. }
  224. }
  225. .page-editor-preview-container {
  226. }
  227. .page-editor-preview-body {
  228. padding-top: 18px;
  229. padding-right: 15px;
  230. padding-left: 15px;
  231. overflow-y: scroll;
  232. }
  233. .grw-editor-configuration-dropdown {
  234. .icon-container {
  235. width: 20px;
  236. }
  237. .menuitem-label {
  238. min-width: 130px;
  239. }
  240. }
  241. }
  242. // .builtin-editor .tab-pane#edit
  243. &.hackmd {
  244. .hackmd-preinit,
  245. #iframe-hackmd-container > iframe {
  246. border: none;
  247. }
  248. .hackmd-error {
  249. top: 0;
  250. background-color: rgba($gray-800, 0.8);
  251. }
  252. .hackmd-status-label {
  253. font-size: 3em;
  254. }
  255. .hackmd-resume-button-container,
  256. .hackmd-discard-button-container {
  257. .btn-text {
  258. display: inline-block;
  259. min-width: 230px;
  260. }
  261. }
  262. .btn-view-outdated-draft {
  263. text-decoration: underline;
  264. vertical-align: unset;
  265. }
  266. }
  267. }
  268. // overwrite .CodeMirror pre
  269. .CodeMirror pre.CodeMirror-line {
  270. font-family: $font-family-monospace;
  271. }
  272. // overwrite .CodeMirror-hints
  273. .CodeMirror-hints {
  274. max-height: 30em !important;
  275. .CodeMirror-hint.crowi-emoji-autocomplete {
  276. font-family: $font-family-monospace-not-strictly;
  277. line-height: 1.6em;
  278. .img-container {
  279. display: inline-block;
  280. width: 30px;
  281. }
  282. }
  283. // active line
  284. .CodeMirror-hint-active.crowi-emoji-autocomplete {
  285. .img-container {
  286. padding-top: 0.3em;
  287. padding-bottom: 0.3em;
  288. font-size: 15px; // adjust to .wiki
  289. }
  290. }
  291. }
  292. // overwrite .CodeMirror-placeholder
  293. .CodeMirror pre.CodeMirror-placeholder {
  294. color: $text-muted;
  295. }
  296. #tag-edit-button-tooltip {
  297. .tooltip-inner {
  298. color: black;
  299. background-color: white;
  300. border: 1px solid $gray-300;
  301. }
  302. .tooltip-arrow {
  303. border-bottom: 5px solid $gray-300;
  304. }
  305. }