]> BookStack Code Mirror - bookstack/blob - resources/sass/_content.scss
Merge branch 'lexical' into development
[bookstack] / resources / sass / _content.scss
1 /**
2  * Page Content
3  * Styles specific to blocks used within page content.
4  */
5
6 .page-content {
7   width: 100%;
8   max-width: 840px;
9   margin: 0 auto;
10   overflow-wrap: break-word;
11   .align-left {
12     text-align: left;
13   }
14   img.align-left, table.align-left, iframe.align-left, video.align-left {
15     float: left !important;
16     margin: $-xs $-m $-m 0;
17   }
18   .align-right {
19     text-align: right !important;
20   }
21   img.align-right, table.align-right, iframe.align-right, video.align-right {
22     float: right !important;
23     margin: $-xs 0 $-xs $-s;
24   }
25   .align-center {
26     text-align: center;
27   }
28   img.align-center, video.align-center, iframe.align-center {
29     display: block;
30   }
31   img.align-center, table.align-center, iframe.align-center, video.align-center {
32     margin-left: auto;
33     margin-right: auto;
34   }
35   .align-justify {
36     text-align: justify;
37   }
38   h1, h2, h3, h4, h5, h6, pre {
39     clear: left;
40   }
41   hr {
42     clear: both;
43     margin: $-m 0;
44   }
45   table {
46     hyphens: auto;
47     table-layout: fixed;
48     max-width: 100%;
49     height: auto !important;
50   }
51
52   // diffs
53   ins,
54   del {
55     text-decoration: none;
56   }
57   ins {
58     background: #dbffdb;
59   }
60   del {
61     background: #FFECEC;
62   }
63
64   details {
65     border: 1px solid;
66     @include lightDark(border-color, #DDD, #555);
67     margin-bottom: 1em;
68     padding: $-s;
69   }
70   details > summary {
71     margin-top: -$-s;
72     margin-left: -$-s;
73     margin-right: -$-s;
74     margin-bottom: -$-s;
75     font-weight: bold;
76     @include lightDark(background-color, #EEE, #333);
77     padding: $-xs $-s;
78   }
79   details[open] > summary {
80     margin-bottom: $-s;
81     border-bottom: 1px solid;
82     @include lightDark(border-color, #DDD, #555);
83   }
84   details > summary + * {
85     margin-top: .2em;
86   }
87   details:after {
88     content: '';
89     display: block;
90     clear: both;
91   }
92
93   li > input[type="checkbox"] {
94     vertical-align: top;
95     margin-top: 0.3em;
96   }
97
98   p:empty {
99     min-height: 1.6em;
100   }
101
102   &.page-revision {
103     pre code {
104       white-space: pre-wrap;
105     }
106   }
107
108   .cm-editor {
109     margin-bottom: 1.375em;
110   }
111
112   video, iframe {
113     max-width: 100%;
114   }
115
116   a {
117     text-decoration: underline;
118   }
119 }
120
121 // This is seperated out so we can target it out-of-editor by default
122 // and use advanced (:not) syntax, not supported by things like PDF gen,
123 // to target in-editor scenarios to handle edge-case of TinyMCE using an
124 // image for data placeholders where we'd want height attributes to take effect.
125 body .page-content img,
126 .page-content img:not([data-mce-object]) {
127   max-width: 100%;
128   height:auto;
129 }
130
131 /**
132  * Callouts
133  * Some styles duplicated for supporting logical units (eg. inline-end) while
134  * providing fallbacks to non-logical rules, so RTL is natively supported where possible.
135  */
136 .callout {
137   border-left: 3px solid #BBB;
138   border-inline-start: 3px solid #BBB;
139   border-inline-end: none;
140   background-color: #EEE;
141   padding: $-s;
142   padding-left: $-xl;
143   padding-inline-start: $-xl;
144   padding-inline-end: $-s;
145   display: block;
146   position: relative;
147   overflow: auto;
148   &:before {
149     background-image: url('data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMwMTUzODAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bTEgMTVoLTJ2LTZoMnY2em0wLThoLTJWN2gydjJ6Ii8+PC9zdmc+');
150     background-repeat: no-repeat;
151     content: '';
152     width: 1.2em;
153     height: 1.2em;
154     left: $-xs + 2px;
155     inset-inline-start: $-xs + 2px;
156     inset-inline-end: unset;
157     top: 50%;
158     margin-top: -9px;
159     display: inline-block;
160     position: absolute;
161     line-height: 1;
162     opacity: 0.8;
163   }
164   &.success {
165     @include lightDark(border-color, $positive, $positive-dark);
166     @include lightDark(background-color, lighten($positive, 68%), darken($positive-dark, 36%));
167     @include lightDark(color, darken($positive, 16%), $positive-dark);
168   }
169   &.success:before {
170     background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiMzNzZjMzkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEyIDJDNi40OCAyIDIgNi40OCAyIDEyczQuNDggMTAgMTAgMTAgMTAtNC40OCAxMC0xMFMxNy41MiAyIDEyIDJ6bS0yIDE1bC01LTUgMS40MS0xLjQxTDEwIDE0LjE3bDcuNTktNy41OUwxOSA4bC05IDl6Ii8+PC9zdmc+");
171   }
172   &.danger {
173     @include lightDark(border-color, $negative, $negative-dark);
174     @include lightDark(background-color, lighten($negative, 56%), darken($negative-dark, 55%));
175     @include lightDark(color, darken($negative, 20%), $negative-dark);
176   }
177   &.danger:before {
178     background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNiOTE4MTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0xNS43MyAzSDguMjdMMyA4LjI3djcuNDZMOC4yNyAyMWg3LjQ2TDIxIDE1LjczVjguMjdMMTUuNzMgM3pNMTIgMTcuM2MtLjcyIDAtMS4zLS41OC0xLjMtMS4zIDAtLjcyLjU4LTEuMyAxLjMtMS4zLjcyIDAgMS4zLjU4IDEuMyAxLjMgMCAuNzItLjU4IDEuMy0xLjMgMS4zem0xLTQuM2gtMlY3aDJ2NnoiLz4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==");
179   }
180   &.info {
181     @include lightDark(border-color, $info, $info-dark);
182     @include lightDark(color, darken($info, 20%), $info-dark);
183     @include lightDark(background-color, lighten($info, 50%), darken($info-dark, 34%));
184   }
185   &.warning {
186     @include lightDark(border-color, $warning, $warning-dark);
187     @include lightDark(background-color, lighten($warning, 50%), darken($warning-dark, 50%));
188     @include lightDark(color, darken($warning, 20%), $warning-dark);
189   }
190   &.warning:before {
191     background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9IiNiNjUzMWMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4gICAgPHBhdGggZD0iTTEgMjFoMjJMMTIgMiAxIDIxem0xMi0zaC0ydi0yaDJ2MnptMC00aC0ydi00aDJ2NHoiLz48L3N2Zz4=");
192   }
193   a {
194     color: inherit;
195     text-decoration: underline;
196   }
197 }