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