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