_on-edit.scss 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  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. overflow-y: hidden;
  122. scrollbar-width: thin;
  123. }
  124. }
  125. }
  126. // ellipsis .grw-page-path-hierarchical-link
  127. .grw-subnav-left-side {
  128. overflow: hidden;
  129. .grw-path-nav-container {
  130. margin-right: 1rem;
  131. overflow: hidden;
  132. .grw-page-path-nav {
  133. white-space: nowrap;
  134. .grw-page-path-hierarchical-link {
  135. width: 100%;
  136. overflow: hidden;
  137. text-overflow: ellipsis;
  138. }
  139. h1 {
  140. overflow: hidden;
  141. }
  142. }
  143. }
  144. }
  145. .nav:hover {
  146. .btn-copy,
  147. .btn-edit,
  148. .btn-edit-tags {
  149. // change button opacity
  150. opacity: unset;
  151. }
  152. }
  153. &.builtin-editor {
  154. /*****************
  155. * Editor styles
  156. *****************/
  157. .page-editor-editor-container {
  158. border-right: 1px solid transparent;
  159. // add icon on cursor
  160. .markdown-table-activated,
  161. .markdown-link-activated {
  162. .CodeMirror-cursor {
  163. &:after {
  164. position: relative;
  165. top: -1.1em;
  166. left: 0.3em;
  167. display: block;
  168. width: 1em;
  169. height: 1em;
  170. content: ' ';
  171. background-repeat: no-repeat;
  172. background-size: 1em;
  173. }
  174. }
  175. }
  176. .markdown-table-activated .CodeMirror-cursor {
  177. &:after {
  178. background-image: url(/images/icons/editor/table.svg);
  179. }
  180. }
  181. .markdown-link-activated .CodeMirror-cursor {
  182. &:after {
  183. background-image: url(/images/icons/editor/link.svg);
  184. }
  185. }
  186. .textarea-editor {
  187. font-family: monospace;
  188. border: none;
  189. }
  190. }
  191. .page-editor-preview-container {
  192. }
  193. .page-editor-preview-body {
  194. padding: 18px 15px 0;
  195. overflow-y: scroll;
  196. }
  197. .grw-editor-configuration-dropdown {
  198. .icon-container {
  199. width: 20px;
  200. }
  201. .menuitem-label {
  202. min-width: 130px;
  203. }
  204. }
  205. }
  206. // .builtin-editor .tab-pane#edit
  207. // editing /Sidebar
  208. &.pathname-sidebar {
  209. .page-editor-preview-body {
  210. width: 320px;
  211. padding-top: 0;
  212. margin-right: auto;
  213. margin-left: auto;
  214. .wiki {
  215. @extend %grw-custom-sidebar-content;
  216. }
  217. }
  218. }
  219. &.hackmd {
  220. .hackmd-preinit,
  221. #iframe-hackmd-container > iframe {
  222. border: none;
  223. }
  224. .hackmd-error {
  225. top: 0;
  226. background-color: rgba($gray-800, 0.8);
  227. }
  228. .hackmd-status-label {
  229. font-size: 3em;
  230. }
  231. .hackmd-resume-button-container,
  232. .hackmd-discard-button-container {
  233. .btn-text {
  234. display: inline-block;
  235. min-width: 230px;
  236. }
  237. }
  238. .btn-view-outdated-draft {
  239. text-decoration: underline;
  240. vertical-align: unset;
  241. }
  242. }
  243. }
  244. body.on-edit {
  245. &:not(.growi-layout-fluid) .page-editor-preview-body {
  246. .wiki {
  247. max-width: 980px;
  248. margin: 0 auto;
  249. }
  250. }
  251. &.growi-layout-fluid .page-editor-preview-body {
  252. .wiki {
  253. margin: 0 auto;
  254. }
  255. }
  256. }
  257. // overwrite .CodeMirror-hints
  258. .CodeMirror-hints {
  259. max-height: 30em !important;
  260. .CodeMirror-hint.crowi-emoji-autocomplete {
  261. font-family: $font-family-monospace-not-strictly;
  262. line-height: 1.6em;
  263. .img-container {
  264. display: inline-block;
  265. width: 30px;
  266. }
  267. }
  268. // active line
  269. .CodeMirror-hint-active.crowi-emoji-autocomplete {
  270. .img-container {
  271. padding-top: 0.3em;
  272. padding-bottom: 0.3em;
  273. font-size: 15px; // adjust to .wiki
  274. }
  275. }
  276. }
  277. #tag-edit-button-tooltip {
  278. .tooltip-inner {
  279. color: black;
  280. background-color: white;
  281. border: 1px solid $gray-300;
  282. }
  283. .tooltip-arrow {
  284. border-bottom: 5px solid $gray-300;
  285. }
  286. }
  287. /*
  288. Grid Edit Modal
  289. */
  290. .grw-grid-edit-modal {
  291. .desktop-preview,
  292. .tablet-preview,
  293. .mobile-preview {
  294. .row {
  295. height: 140px;
  296. margin: 0px;
  297. }
  298. }
  299. .desktop-preview {
  300. .row {
  301. div {
  302. padding: 0px;
  303. }
  304. }
  305. }
  306. .tablet-preview {
  307. .row {
  308. div {
  309. padding: 0px;
  310. }
  311. }
  312. }
  313. .mobile-preview {
  314. width: 75%;
  315. .row {
  316. div {
  317. padding: 0px;
  318. }
  319. }
  320. }
  321. .grid-division-menu {
  322. width: 60vw;
  323. @include media-breakpoint-down(lg) {
  324. width: 80vw;
  325. }
  326. }
  327. }