2
0

_on-edit.scss 6.9 KB

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