UNPKG

3.31 kBSCSSView Raw
1%img-align {
2 &-right {
3 float: right;
4 margin-left: .75rem;
5 }
6 &-left {
7 float: left;
8 margin-right: .75rem;
9 }
10 &-center {
11 display: block;
12 }
13}
14
15.markdown-body {
16 img {
17 & {
18 box-sizing: content-box;
19 display: inline-block;
20 vertical-align: middle;
21 max-width: 100%;
22 margin-left: auto;
23 margin-right: auto;
24 border-style: none;
25
26 outline: none !important;
27 }
28
29 &[align=right],
30 &[alt~=align-right] {
31 @extend %img-align-right;
32 }
33 &[align=left],
34 &[alt~=align-left] {
35 @extend %img-align-left;
36 }
37 &[width="80%"],
38 &[align=center],
39 &[alt~=align-center] {
40 @extend %img-align-center;
41 }
42
43 &[width=smart] {
44 width: auto;
45 max-width: 100%;
46 max-height: 450px;
47 }
48
49 &.border {
50 border: 1px solid rgba(0,0,0,.2);
51 }
52 }
53
54 figure {
55 & {
56 margin: 15px auto;
57 }
58 figcaption {
59 margin-top: 8px;
60 font-size: .93em;
61 font-style: italic;
62 text-align: center;
63 }
64 }
65
66 > img, figure > img {
67 @extend %img-align-center;
68 }
69
70 figure .img {
71 display: inline-block;
72 &, >img:only-of-type {
73 display: block;
74 }
75 }
76
77 .lightbox {
78 & {
79 position: fixed;
80 z-index: 9999999;
81 top: 0;
82 left: 0;
83
84 display: flex;
85 flex-flow: nowrap column;
86 justify-content: flex-start;
87 align-items: center;
88
89 width: 100vw;
90 height: 100vh;
91 overflow: hidden;
92 overflow-y: scroll;
93 background: rgba(white, .966);
94 user-select: none;
95
96 margin-top: 0;
97 margin-bottom: 0;
98 }
99 &:not([open]) {
100 pointer-events: none;
101 }
102
103 // Close Button
104 //
105 &:after {
106 position: fixed;
107 top: 1em;
108 right: 1em;
109 content: '\f00d';
110 display: inline-block;
111 font: normal normal normal 2em/1 FontAwesome;
112 font-size: inherit;
113 text-rendering: auto;
114 -webkit-font-smoothing: antialiased;
115 -moz-osx-font-smoothing: grayscale;
116 transform: translate(0, 0);
117 display: inline-block;
118 cursor: pointer;
119
120 opacity: 1;
121 transform: scale(1.5);
122 transition: .3s .3s ease-in;
123 }
124 &:not([open]):after {
125 transform: scale(0);
126 opacity: 0;
127 }
128
129 &-inner {
130 position: relative;
131 display: inline-flex;
132 justify-content: center;
133 align-items: center;
134 min-height: calc(100vh + 8px);
135 margin: auto;
136 margin: 8px auto auto;
137 padding: 5em 0;
138 box-sizing: content-box;
139 }
140
141 & { // transition
142 transition: .3s ease-out;
143 transition-property: opacity, z-index, transform;
144 img {
145 transform: scale(1);
146 transition: .25s .05s ease-in;
147 }
148 &:not([open]) {
149 opacity: 0 !important;
150 pointer-events: none;
151 img {
152 transform: scale(0);
153 opacity: 0;
154 transition-delay: 0s;
155 }
156 }
157 }
158
159 img {
160 width: auto !important;
161 height: auto !important;
162 min-width: unset !important;
163 max-width: 97.5vw !important;
164 max-height: 97.5vh !important;
165 &.border, &:not([src$=".png"]):not([src$=".svg"]):not([src$=".jp2"]):not([src$=".tiff"]) {
166 box-shadow: 0 .5em 3em -1em rgba(0, 0, 0, .2);
167 }
168 }
169 }
170}