_on-edit.scss 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  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. .toast-top-right {
  64. top: 64px;
  65. }
  66. /*****************
  67. * Expand Editor
  68. *****************/
  69. .grw-editor-navbar-bottom {
  70. height: $grw-editor-navbar-bottom-height;
  71. .grw-grant-selector {
  72. @include media-breakpoint-down(sm) {
  73. .btn .label {
  74. display: none;
  75. }
  76. }
  77. @include media-breakpoint-up(md) {
  78. .dropdown-toggle {
  79. min-width: 100px;
  80. // caret
  81. &::after {
  82. margin-left: 1em;
  83. }
  84. }
  85. }
  86. }
  87. .btn-submit {
  88. width: 100px;
  89. }
  90. .btn-expand {
  91. // rotate icon
  92. i {
  93. display: inline-block;
  94. transition: transform 200ms;
  95. }
  96. &.expand i {
  97. transform: rotate(-180deg);
  98. }
  99. }
  100. }
  101. /*********************
  102. * Navigation styles
  103. */
  104. .grw-subnav {
  105. padding-bottom: 0;
  106. h1 {
  107. font-size: 16px;
  108. }
  109. .grw-drawer-toggler {
  110. width: 38px;
  111. height: 38px;
  112. font-size: 18px;
  113. }
  114. .grw-taglabels-container {
  115. margin-bottom: 0;
  116. // To scroll tags horizontally
  117. .grw-tag-labels.form-inline {
  118. flex-flow: row nowrap;
  119. width: 100%;
  120. overflow-x: auto;
  121. scrollbar-width: thin;
  122. }
  123. }
  124. }
  125. // ellipsis .grw-page-path-hierarchical-link
  126. .grw-subnav-left-side {
  127. overflow: hidden;
  128. .grw-path-nav-container {
  129. margin-right: 1rem;
  130. overflow: hidden;
  131. .grw-page-path-nav {
  132. white-space: nowrap;
  133. .grw-page-path-hierarchical-link {
  134. width: 100%;
  135. overflow: hidden;
  136. text-overflow: ellipsis;
  137. }
  138. h1 {
  139. overflow: hidden;
  140. }
  141. }
  142. }
  143. }
  144. .nav:hover {
  145. .btn-copy,
  146. .btn-edit,
  147. .btn-edit-tags {
  148. // change button opacity
  149. opacity: unset;
  150. }
  151. }
  152. &.builtin-editor {
  153. /*****************
  154. * Editor styles
  155. *****************/
  156. .page-editor-editor-container {
  157. border-right: 1px solid transparent;
  158. // override CodeMirror styles
  159. .CodeMirror {
  160. .cm-matchhighlight {
  161. background-color: cyan;
  162. }
  163. .CodeMirror-selection-highlight-scrollbar {
  164. background-color: darkcyan;
  165. }
  166. }
  167. // add icon on cursor
  168. .markdown-table-activated,
  169. .markdown-link-activated {
  170. .CodeMirror-cursor {
  171. &:after {
  172. position: relative;
  173. top: -1.1em;
  174. left: 0.3em;
  175. display: block;
  176. width: 1em;
  177. height: 1em;
  178. content: ' ';
  179. background-repeat: no-repeat;
  180. background-size: 1em;
  181. }
  182. }
  183. }
  184. .markdown-table-activated .CodeMirror-cursor {
  185. &:after {
  186. background-image: url(/images/icons/editor/table.svg);
  187. }
  188. }
  189. .markdown-link-activated .CodeMirror-cursor {
  190. &:after {
  191. background-image: url(/images/icons/editor/link.svg);
  192. }
  193. }
  194. .textarea-editor {
  195. font-family: monospace;
  196. border: none;
  197. }
  198. }
  199. .page-editor-preview-container {
  200. }
  201. .page-editor-preview-body {
  202. padding: 18px 15px 0;
  203. overflow-y: scroll;
  204. }
  205. .grw-editor-configuration-dropdown {
  206. .icon-container {
  207. width: 20px;
  208. }
  209. .menuitem-label {
  210. min-width: 130px;
  211. }
  212. }
  213. }
  214. // .builtin-editor .tab-pane#edit
  215. // editing /Sidebar
  216. &.pathname-sidebar {
  217. .page-editor-preview-body {
  218. width: 320px;
  219. padding-top: 0;
  220. margin-right: auto;
  221. margin-left: auto;
  222. .wiki {
  223. @extend %grw-custom-sidebar-content;
  224. }
  225. }
  226. }
  227. &.hackmd {
  228. .hackmd-preinit,
  229. #iframe-hackmd-container > iframe {
  230. border: none;
  231. }
  232. .hackmd-error {
  233. top: 0;
  234. background-color: rgba($gray-800, 0.8);
  235. }
  236. .hackmd-status-label {
  237. font-size: 3em;
  238. }
  239. .hackmd-resume-button-container,
  240. .hackmd-discard-button-container {
  241. .btn-text {
  242. display: inline-block;
  243. min-width: 230px;
  244. }
  245. }
  246. .btn-view-outdated-draft {
  247. text-decoration: underline;
  248. vertical-align: unset;
  249. }
  250. }
  251. }
  252. body.on-edit {
  253. &:not(.growi-layout-fluid) .page-editor-preview-body {
  254. .wiki {
  255. max-width: 980px;
  256. margin: 0 auto;
  257. }
  258. }
  259. &.growi-layout-fluid .page-editor-preview-body {
  260. .wiki {
  261. margin: 0 auto;
  262. }
  263. }
  264. }
  265. // overwrite .CodeMirror pre
  266. .CodeMirror pre.CodeMirror-line {
  267. font-family: $font-family-monospace;
  268. }
  269. // overwrite .CodeMirror-hints
  270. .CodeMirror-hints {
  271. max-height: 30em !important;
  272. .CodeMirror-hint.crowi-emoji-autocomplete {
  273. font-family: $font-family-monospace-not-strictly;
  274. line-height: 1.6em;
  275. .img-container {
  276. display: inline-block;
  277. width: 30px;
  278. }
  279. }
  280. // active line
  281. .CodeMirror-hint-active.crowi-emoji-autocomplete {
  282. .img-container {
  283. padding-top: 0.3em;
  284. padding-bottom: 0.3em;
  285. font-size: 15px; // adjust to .wiki
  286. }
  287. }
  288. }
  289. // overwrite .CodeMirror-placeholder
  290. .CodeMirror pre.CodeMirror-placeholder {
  291. color: $text-muted;
  292. }
  293. #tag-edit-button-tooltip {
  294. .tooltip-inner {
  295. color: black;
  296. background-color: white;
  297. border: 1px solid $gray-300;
  298. }
  299. .tooltip-arrow {
  300. border-bottom: 5px solid $gray-300;
  301. }
  302. }
  303. /*
  304. Grid Edit Modal
  305. */
  306. .grw-grid-edit-modal {
  307. .desktop-preview,
  308. .tablet-preview,
  309. .mobile-preview {
  310. .row {
  311. height: 140px;
  312. margin: 0px;
  313. }
  314. }
  315. .desktop-preview {
  316. .row {
  317. div {
  318. padding: 0px;
  319. }
  320. }
  321. }
  322. .tablet-preview {
  323. .row {
  324. div {
  325. padding: 0px;
  326. }
  327. }
  328. }
  329. .mobile-preview {
  330. width: 75%;
  331. .row {
  332. div {
  333. padding: 0px;
  334. }
  335. }
  336. }
  337. .grid-division-menu {
  338. width: 60vw;
  339. @include media-breakpoint-down(lg) {
  340. width: 80vw;
  341. }
  342. }
  343. }