_on-edit.scss 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  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. .container-fluid {
  9. padding-right: 15px;
  10. padding-left: 15px;
  11. }
  12. .grw-navbar {
  13. position: fixed !important;
  14. width: 100vw;
  15. }
  16. // restrict height of subnav
  17. .grw-subnav {
  18. height: $grw-subnav-height-on-edit;
  19. min-height: unset;
  20. padding-top: 0;
  21. @include media-breakpoint-up(lg) {
  22. height: $grw-subnav-height-lg-on-edit;
  23. }
  24. }
  25. .page-wrapper {
  26. position: relative;
  27. top: $grw-navbar-border-width;
  28. height: calc(100vh - #{$grw-navbar-border-width});
  29. }
  30. // calculate margin
  31. $editor-margin-top: $grw-navbar-border-width + $grw-subnav-height-on-edit;
  32. @include expand-editor($editor-margin-top);
  33. @include media-breakpoint-up(lg) {
  34. // calculate margin
  35. $editor-margin-top: $grw-navbar-border-width + $grw-subnav-height-lg-on-edit;
  36. @include expand-editor($editor-margin-top);
  37. }
  38. // show
  39. .d-edit-block {
  40. display: block !important;
  41. }
  42. // hide unnecessary elements
  43. .d-edit-none {
  44. display: none !important;
  45. }
  46. // hide when HackMD view
  47. &.hackmd .d-hackmd-none {
  48. display: none;
  49. }
  50. // show only either Edit button or HackMD button
  51. &.hackmd .nav-tab-edit {
  52. display: none;
  53. }
  54. &.hackmd .grw-nav-item-edit {
  55. display: none;
  56. }
  57. &:not(.hackmd) .nav-tab-hackmd {
  58. display: none;
  59. }
  60. .toast-top-right {
  61. top: 64px;
  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. overflow-y: hidden;
  119. scrollbar-width: thin;
  120. }
  121. }
  122. }
  123. // ellipsis .grw-page-path-hierarchical-link
  124. .grw-subnav-left-side {
  125. overflow: hidden;
  126. .grw-path-nav-container {
  127. margin-right: 1rem;
  128. overflow: hidden;
  129. .grw-page-path-nav {
  130. white-space: nowrap;
  131. .grw-page-path-hierarchical-link {
  132. width: 100%;
  133. overflow: hidden;
  134. text-overflow: ellipsis;
  135. }
  136. h1 {
  137. overflow: hidden;
  138. }
  139. }
  140. }
  141. }
  142. .nav:hover {
  143. .btn-copy,
  144. .btn-edit,
  145. .btn-edit-tags {
  146. // change button opacity
  147. opacity: unset;
  148. }
  149. }
  150. .grw-copy-dropdown {
  151. .btn-copy {
  152. padding: 3px !important; // overwrite padding
  153. }
  154. }
  155. &.builtin-editor {
  156. /*****************
  157. * Editor styles
  158. *****************/
  159. .page-editor-editor-container {
  160. border-right: 1px solid transparent;
  161. // add icon on cursor
  162. .markdown-table-activated,
  163. .markdown-link-activated {
  164. .CodeMirror-cursor {
  165. &:after {
  166. position: relative;
  167. top: -1.1em;
  168. left: 0.3em;
  169. display: block;
  170. width: 1em;
  171. height: 1em;
  172. content: ' ';
  173. background-repeat: no-repeat;
  174. background-size: 1em;
  175. }
  176. }
  177. }
  178. .markdown-table-activated .CodeMirror-cursor {
  179. &:after {
  180. background-image: url(/images/icons/editor/table.svg);
  181. }
  182. }
  183. .markdown-link-activated .CodeMirror-cursor {
  184. &:after {
  185. background-image: url(/images/icons/editor/link.svg);
  186. }
  187. }
  188. .textarea-editor {
  189. font-family: monospace;
  190. border: none;
  191. }
  192. }
  193. .page-editor-preview-container {
  194. }
  195. .page-editor-preview-body {
  196. padding: 18px 15px 0;
  197. overflow-y: scroll;
  198. }
  199. .grw-editor-configuration-dropdown {
  200. .icon-container {
  201. width: 20px;
  202. }
  203. .menuitem-label {
  204. min-width: 130px;
  205. }
  206. }
  207. }
  208. // .builtin-editor .tab-pane#edit
  209. // editing /Sidebar
  210. &.editing-sidebar {
  211. .page-editor-preview-body {
  212. width: 320px;
  213. padding-top: 0;
  214. margin-right: auto;
  215. margin-left: auto;
  216. .wiki {
  217. @extend %grw-custom-sidebar-content;
  218. }
  219. }
  220. }
  221. &.hackmd {
  222. .hackmd-preinit,
  223. #iframe-hackmd-container > iframe {
  224. border: none;
  225. }
  226. .hackmd-error {
  227. top: 0;
  228. background-color: rgba($gray-800, 0.8);
  229. }
  230. .hackmd-status-label {
  231. font-size: 3em;
  232. }
  233. .hackmd-resume-button-container,
  234. .hackmd-discard-button-container {
  235. .btn-text {
  236. display: inline-block;
  237. min-width: 230px;
  238. }
  239. }
  240. .btn-view-outdated-draft {
  241. text-decoration: underline;
  242. vertical-align: unset;
  243. }
  244. }
  245. }
  246. body.on-edit {
  247. .wrapper:not(.growi-layout-fluid) .page-editor-preview-body {
  248. .wiki {
  249. max-width: 980px;
  250. margin: 0 auto;
  251. }
  252. }
  253. .wrapper.growi-layout-fluid .page-editor-preview-body {
  254. .wiki {
  255. margin: 0 auto;
  256. }
  257. }
  258. }
  259. // TODO: Never used this id class
  260. #tag-edit-button-tooltip {
  261. .tooltip-inner {
  262. color: black;
  263. background-color: white;
  264. border: 1px solid $gray-300;
  265. }
  266. .tooltip-arrow {
  267. border-bottom: 5px solid $gray-300;
  268. }
  269. }