_on-edit.scss 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  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. // add icon on cursor
  159. .markdown-table-activated,
  160. .markdown-link-activated {
  161. .CodeMirror-cursor {
  162. &:after {
  163. position: relative;
  164. top: -1.1em;
  165. left: 0.3em;
  166. display: block;
  167. width: 1em;
  168. height: 1em;
  169. content: ' ';
  170. background-repeat: no-repeat;
  171. background-size: 1em;
  172. }
  173. }
  174. }
  175. .markdown-table-activated .CodeMirror-cursor {
  176. &:after {
  177. background-image: url(/images/icons/editor/table.svg);
  178. }
  179. }
  180. .markdown-link-activated .CodeMirror-cursor {
  181. &:after {
  182. background-image: url(/images/icons/editor/link.svg);
  183. }
  184. }
  185. .textarea-editor {
  186. font-family: monospace;
  187. border: none;
  188. }
  189. }
  190. .page-editor-preview-container {
  191. }
  192. .page-editor-preview-body {
  193. padding: 18px 15px 0;
  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. // editing /Sidebar
  207. &.pathname-sidebar {
  208. .page-editor-preview-body {
  209. width: 320px;
  210. padding-top: 0;
  211. margin-right: auto;
  212. margin-left: auto;
  213. .wiki {
  214. @extend %grw-custom-sidebar-content;
  215. }
  216. }
  217. }
  218. &.hackmd {
  219. .hackmd-preinit,
  220. #iframe-hackmd-container > iframe {
  221. border: none;
  222. }
  223. .hackmd-error {
  224. top: 0;
  225. background-color: rgba($gray-800, 0.8);
  226. }
  227. .hackmd-status-label {
  228. font-size: 3em;
  229. }
  230. .hackmd-resume-button-container,
  231. .hackmd-discard-button-container {
  232. .btn-text {
  233. display: inline-block;
  234. min-width: 230px;
  235. }
  236. }
  237. .btn-view-outdated-draft {
  238. text-decoration: underline;
  239. vertical-align: unset;
  240. }
  241. }
  242. }
  243. body.on-edit {
  244. &:not(.growi-layout-fluid) .page-editor-preview-body {
  245. .wiki {
  246. max-width: 980px;
  247. margin: 0 auto;
  248. }
  249. }
  250. &.growi-layout-fluid .page-editor-preview-body {
  251. .wiki {
  252. margin: 0 auto;
  253. }
  254. }
  255. }
  256. // overwrite .CodeMirror-hints
  257. .CodeMirror-hints {
  258. max-height: 30em !important;
  259. .CodeMirror-hint.crowi-emoji-autocomplete {
  260. font-family: $font-family-monospace-not-strictly;
  261. line-height: 1.6em;
  262. .img-container {
  263. display: inline-block;
  264. width: 30px;
  265. }
  266. }
  267. // active line
  268. .CodeMirror-hint-active.crowi-emoji-autocomplete {
  269. .img-container {
  270. padding-top: 0.3em;
  271. padding-bottom: 0.3em;
  272. font-size: 15px; // adjust to .wiki
  273. }
  274. }
  275. }
  276. #tag-edit-button-tooltip {
  277. .tooltip-inner {
  278. color: black;
  279. background-color: white;
  280. border: 1px solid $gray-300;
  281. }
  282. .tooltip-arrow {
  283. border-bottom: 5px solid $gray-300;
  284. }
  285. }
  286. /*
  287. Grid Edit Modal
  288. */
  289. .grw-grid-edit-modal {
  290. .desktop-preview,
  291. .tablet-preview,
  292. .mobile-preview {
  293. .row {
  294. height: 140px;
  295. margin: 0px;
  296. }
  297. }
  298. .desktop-preview {
  299. .row {
  300. div {
  301. padding: 0px;
  302. }
  303. }
  304. }
  305. .tablet-preview {
  306. .row {
  307. div {
  308. padding: 0px;
  309. }
  310. }
  311. }
  312. .mobile-preview {
  313. width: 75%;
  314. .row {
  315. div {
  316. padding: 0px;
  317. }
  318. }
  319. }
  320. .grid-division-menu {
  321. width: 60vw;
  322. @include media-breakpoint-down(lg) {
  323. width: 80vw;
  324. }
  325. }
  326. }