_on-edit.scss 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. @import './bootstrap/init' ;
  2. @import './variables' ;
  3. @import './mixins' ;
  4. @import 'sidebar-wiki';
  5. // global imported
  6. body.on-edit {
  7. overflow-y: hidden !important;
  8. .grw-navbar {
  9. position: fixed !important;
  10. width: 100vw;
  11. }
  12. // restrict height of subnav
  13. .grw-subnav {
  14. height: $grw-subnav-height-on-edit;
  15. min-height: unset;
  16. padding-top: 0;
  17. padding-right: 15px;
  18. padding-left: 15px;
  19. @include media-breakpoint-up(lg) {
  20. height: $grw-subnav-height-lg-on-edit;
  21. }
  22. }
  23. .page-wrapper {
  24. position: relative;
  25. top: $grw-navbar-border-width;
  26. height: calc(100vh - #{$grw-navbar-border-width});
  27. }
  28. // calculate margin
  29. $editor-margin-top: $grw-navbar-border-width + $grw-subnav-height-on-edit;
  30. @include expand-editor($editor-margin-top);
  31. @include media-breakpoint-up(lg) {
  32. // calculate margin
  33. $editor-margin-top: $grw-navbar-border-width + $grw-subnav-height-lg-on-edit;
  34. @include expand-editor($editor-margin-top);
  35. }
  36. // show
  37. .d-edit-block {
  38. display: block !important;
  39. }
  40. // hide unnecessary elements
  41. .d-edit-none {
  42. display: none !important;
  43. }
  44. // hide when HackMD view
  45. &.hackmd .d-hackmd-none {
  46. display: none;
  47. }
  48. // show only either Edit button or HackMD button
  49. &.hackmd .nav-tab-edit {
  50. display: none;
  51. }
  52. &.hackmd .grw-nav-item-edit {
  53. display: none;
  54. }
  55. &:not(.hackmd) .nav-tab-hackmd {
  56. display: none;
  57. }
  58. .toast-top-right {
  59. top: 64px;
  60. }
  61. /*****************
  62. * Expand Editor
  63. *****************/
  64. .grw-editor-navbar-bottom {
  65. height: $grw-editor-navbar-bottom-height;
  66. .grw-grant-selector {
  67. @include media-breakpoint-down(sm) {
  68. .btn .label {
  69. display: none;
  70. }
  71. }
  72. @include media-breakpoint-up(md) {
  73. .dropdown-toggle {
  74. min-width: 100px;
  75. // caret
  76. &::after {
  77. margin-left: 1em;
  78. }
  79. }
  80. }
  81. }
  82. .btn-submit {
  83. width: 100px;
  84. }
  85. .btn-expand {
  86. // rotate icon
  87. i {
  88. display: inline-block;
  89. transition: transform 200ms;
  90. }
  91. &.expand i {
  92. transform: rotate(-180deg);
  93. }
  94. }
  95. }
  96. /*********************
  97. * Navigation styles
  98. */
  99. .grw-subnav {
  100. padding-bottom: 0;
  101. h1 {
  102. font-size: 16px;
  103. }
  104. .grw-drawer-toggler {
  105. width: 38px;
  106. height: 38px;
  107. font-size: 18px;
  108. }
  109. .grw-taglabels-container {
  110. margin-bottom: 0;
  111. // To scroll tags horizontally
  112. .grw-tag-labels.form-inline {
  113. flex-flow: row nowrap;
  114. width: 100%;
  115. overflow-x: auto;
  116. overflow-y: hidden;
  117. scrollbar-width: thin;
  118. }
  119. }
  120. }
  121. // ellipsis .grw-page-path-hierarchical-link
  122. .grw-subnav-left-side {
  123. overflow: hidden;
  124. .grw-path-nav-container {
  125. margin-right: 1rem;
  126. overflow: hidden;
  127. .grw-page-path-nav {
  128. white-space: nowrap;
  129. .grw-page-path-hierarchical-link {
  130. width: 100%;
  131. overflow: hidden;
  132. text-overflow: ellipsis;
  133. }
  134. h1 {
  135. overflow: hidden;
  136. }
  137. }
  138. }
  139. }
  140. .grw-copy-dropdown {
  141. .btn-copy {
  142. padding: 3px !important; // overwrite padding
  143. }
  144. }
  145. &.builtin-editor {
  146. /*****************
  147. * Editor styles
  148. *****************/
  149. .page-editor-editor-container {
  150. border-right: 1px solid transparent;
  151. // add icon on cursor
  152. .markdown-table-activated,
  153. .markdown-link-activated {
  154. .CodeMirror-cursor {
  155. &:after {
  156. position: relative;
  157. top: -1.1em;
  158. left: 0.3em;
  159. display: block;
  160. width: 1em;
  161. height: 1em;
  162. content: ' ';
  163. background-repeat: no-repeat;
  164. background-size: 1em;
  165. }
  166. }
  167. }
  168. .markdown-table-activated .CodeMirror-cursor {
  169. &:after {
  170. background-image: url(/images/icons/editor/table.svg);
  171. }
  172. }
  173. .markdown-link-activated .CodeMirror-cursor {
  174. &:after {
  175. background-image: url(/images/icons/editor/link.svg);
  176. }
  177. }
  178. .textarea-editor {
  179. font-family: monospace;
  180. border: none;
  181. }
  182. }
  183. .page-editor-preview-container {
  184. }
  185. .page-editor-preview-body {
  186. padding: 18px 15px 0;
  187. overflow-y: scroll;
  188. }
  189. .grw-editor-configuration-dropdown {
  190. .icon-container {
  191. width: 20px;
  192. }
  193. .menuitem-label {
  194. min-width: 130px;
  195. }
  196. }
  197. }
  198. // .builtin-editor .tab-pane#edit
  199. // editing /Sidebar
  200. &.editing-sidebar {
  201. .page-editor-preview-body {
  202. width: 320px;
  203. padding-top: 0;
  204. margin-right: auto;
  205. margin-left: auto;
  206. .wiki {
  207. @extend %grw-custom-sidebar-content;
  208. }
  209. }
  210. }
  211. &.hackmd {
  212. .hackmd-preinit,
  213. #iframe-hackmd-container > iframe {
  214. border: none;
  215. }
  216. .hackmd-error {
  217. top: 0;
  218. background-color: rgba($gray-800, 0.8);
  219. }
  220. .hackmd-status-label {
  221. font-size: 3em;
  222. }
  223. .hackmd-resume-button-container,
  224. .hackmd-discard-button-container {
  225. .btn-text {
  226. display: inline-block;
  227. min-width: 230px;
  228. }
  229. }
  230. .btn-view-outdated-draft {
  231. text-decoration: underline;
  232. vertical-align: unset;
  233. }
  234. }
  235. }
  236. body.on-edit {
  237. .wrapper:not(.growi-layout-fluid) .page-editor-preview-body {
  238. .wiki {
  239. max-width: 980px;
  240. margin: 0 auto;
  241. }
  242. }
  243. .wrapper.growi-layout-fluid .page-editor-preview-body {
  244. .wiki {
  245. margin: 0 auto;
  246. }
  247. }
  248. }
  249. // TODO: Never used this id class
  250. #tag-edit-button-tooltip {
  251. .tooltip-inner {
  252. color: black;
  253. background-color: white;
  254. border: 1px solid $gray-300;
  255. }
  256. .tooltip-arrow {
  257. border-bottom: 5px solid $gray-300;
  258. }
  259. }