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