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