File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -210,4 +210,27 @@ function listPlugins(ul) {
210
210
211
211
$$ ( '.plugin-list' ) . forEach ( listPlugins ) ;
212
212
213
+ // small polyfill for Element#matches
214
+ if ( ! Element . prototype . matches ) {
215
+ Element . prototype . matches = Element . prototype . msMatchesSelector || Element . prototype . webkitMatchesSelector ;
216
+ }
217
+
218
+ Prism && Prism . hooks . add ( 'complete' , function ( env ) {
219
+ var element = env . element ;
220
+
221
+ requestAnimationFrame ( function ( ) {
222
+ if ( ! element . matches ( 'div.code-toolbar > pre > code' ) ) {
223
+ return ;
224
+ }
225
+
226
+ var pre = element . parentElement ;
227
+ var wrapper = pre . parentElement ;
228
+
229
+ // transfer margin of pre to wrapper
230
+ wrapper . style . margin = window . getComputedStyle ( pre ) . margin ;
231
+ pre . style . margin = "0" ;
232
+
233
+ } ) ;
234
+ } ) ;
235
+
213
236
} ) ( ) ;
Original file line number Diff line number Diff line change @@ -414,3 +414,12 @@ label a.owner:not(:hover) {
414
414
margin-bottom : 1em ;
415
415
margin-right : 1em ;
416
416
}
417
+
418
+ /*
419
+ * Fix for Toolbar's overflow issue
420
+ */
421
+
422
+ div .code-toolbar {
423
+ display : block;
424
+ overflow : auto;
425
+ }
You can’t perform that action at this time.
0 commit comments