_editor.scss 5.8 KB

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