]> BookStack Code Mirror - bookstack/blob - resources/sass/_tinymce.scss
Lexical: Added basic list button/support
[bookstack] / resources / sass / _tinymce.scss
1
2 // Custom full screen mode
3 .tox.tox-fullscreen {
4   position: fixed;
5   top: 0;
6   height: 100%;
7   width: 100%;
8   max-width: 100%;
9   z-index: 100;
10 }
11
12 // Editor wrapper edits
13 .tox.tox-tinymce {
14   border-inline: 0;
15   border-bottom: 0;
16 }
17
18 // In editor body overrides
19 .page-content.mce-content-body {
20   padding-block-start: 1rem;
21   padding-block-end: 1rem;
22   outline: 0;
23   display: block;
24   max-width: 870px;
25 }
26
27 .wysiwyg-input.mce-content-body {
28   padding-block-start: 1rem;
29   padding-block-end: 1rem;
30   outline: 0;
31   display: block;
32 }
33
34 .wysiwyg-input.mce-content-body:before {
35   padding: 1rem;
36   top: 4px;
37   font-style: italic;
38   @include lightDark(color, rgba(34,47,62,.5), rgba(155,155,155,.5))
39 }
40
41 // Default styles for our custom root nodes
42 .page-content.mce-content-body doc-root {
43   display: block;
44 }
45 .page-content.mce-content-body code-block {
46   display: block;
47 }
48
49 // Pad out bottom of editor
50 body.page-content.mce-content-body  {
51   padding-bottom: 5rem;
52 }
53
54 // Remove svg background line in toolbar items
55 .tox .tox-pop__dialog .tox-toolbar {
56   background: transparent !important;
57 }
58
59 // Center toolbar items
60 .tox-toolbar__primary {
61   justify-content: center;
62 }
63
64 // Prevent scroll jumps on codemirror clicks
65 .page-content.mce-content-body code-block > * {
66   pointer-events: none;
67 }
68 .page-content.mce-content-body code-block pre {
69   display: none;
70 }
71
72 // Details/summary editor usability
73 .page-content.mce-content-body details summary {
74   pointer-events: none;
75 }
76 .page-content.mce-content-body details doc-root {
77   padding: $-s;
78   margin-left: (2px - $-s);
79   margin-right: (2px - $-s);
80   margin-bottom: (2px - $-s);
81   margin-top: (2px - $-s);
82   overflow: hidden;
83 }
84
85 // Allow alignment to be reflected in media embed wrappers
86 .page-content.mce-content-body .mce-preview-object.align-right {
87   float: right !important;
88   margin: $-xs 0 $-xs $-s;
89 }
90
91 .page-content.mce-content-body .mce-preview-object.align-left {
92   float: left !important;
93   margin: $-xs $-m $-m 0;
94 }
95
96 .page-content.mce-content-body .mce-preview-object.align-center {
97   display: block;
98   margin-left: auto;
99   margin-right: auto;
100 }
101
102 .page-content.mce-content-body .mce-preview-object iframe,
103 .page-content.mce-content-body .mce-preview-object video {
104   display: block;
105   margin: 0 !important;
106   float: none !important;
107 }
108
109 .page-content.mce-content-body td[data-mce-selected]::after,
110 .page-content.mce-content-body th[data-mce-selected]::after {
111   top: 1px;
112   left: 1px;
113   bottom: 1px;
114   right: 1px;
115   outline: 1px dashed #1a85ff;
116   outline-offset: 0;
117 }
118
119 /**
120  * Dark Mode Overrides
121  */
122 .dark-mode .tox .tox-toolbar__primary,
123 .dark-mode .tox .tox-menu,
124 .dark-mode .tox .tox-dialog__header,
125 .dark-mode .tox .tox-dialog,
126 .dark-mode .tox .tox-dialog__footer,
127 .dark-mode .tox .tox-pop__dialog,
128 .dark-mode .tox.tox-tinymce-aux .tox-toolbar__overflow {
129     background-color: #333 !important;
130 }
131 .dark-mode .tox .tox-tbtn svg,
132 .dark-mode .tox .tox-tbtn,
133 .dark-mode .tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled)
134 {
135   color: #dbdbdb;
136   fill: #dbdbdb;
137 }
138
139
140
141 /**
142  * Format Menu Hacks
143  */
144 .tox .tox-tbtn--bespoke .tox-tbtn__select-label {
145   width: 6em !important;
146 }
147 .tox-menu .tox-collection__item blockquote::before {
148   content: none;
149 }
150 .tox-menu .tox-collection__item blockquote {
151   border-left: 4px solid var(--color-primary) !important;
152   padding: 4px 6px !important;
153 }
154 .tox-menu .tox-collection__item blockquote {
155   border-left: 4px solid var(--color-primary) !important;
156   padding: 4px 6px !important;
157 }
158 .tox-menu .tox-collection__item p[style*="background-color"] {
159   padding: 4px 6px !important;
160   border-left: 3px solid currentColor !important;
161 }
162 .tox-menu .tox-collection__item[title^="<"] > div > div {
163   font-family: var(--font-code) !important;
164   border: 1px solid #DDD !important;
165   background-color: #EEE !important;
166   padding: 4px 6px !important;
167 }
168 .tox-menu .tox-collection__item-label {
169   line-height: normal !important;
170 }
171
172 /**
173  * Fake task list checkboxes
174  */
175 .page-content.mce-content-body .task-list-item {
176   margin-left: 0;
177   position: relative;
178 }
179 .page-content.mce-content-body .task-list-item > input[type="checkbox"] {
180   display: none;
181 }
182 .page-content.mce-content-body .task-list-item:before {
183   content: '';
184   display: inline-block;
185   border: 2px solid #CCC;
186   width: 12px;
187   height: 12px;
188   border-radius: 2px;
189   margin-right: 8px;
190   vertical-align: text-top;
191   cursor: pointer;
192   position: absolute;
193   left: -24px;
194   top: 4px;
195 }
196
197 .page-content.mce-content-body .task-list-item[checked]:before {
198   background-color: #CCC;
199   background-image: url('data:image/svg+xml;utf8,<svg fill="%23FFFFFF" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m8.4856 20.274-6.736-6.736 2.9287-2.7823 3.8073 3.8073 10.836-10.836 2.9287 2.9287z" stroke-width="1.4644"/></svg>');
200   background-position: 50% 50%;
201   background-size: 100% 100%;
202 }