File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -363,7 +363,9 @@ div > section.place {
363
363
margin : 0 ;
364
364
}
365
365
366
+ /* https://github.com/website-local/mdn-local/issues/1071 */
366
367
.curriculum-content-container .curriculum-module .curriculum-content scrim-inline [url ],
367
368
.curriculum-content-container .curriculum-overview .curriculum-content scrim-inline [url ] {
368
369
aspect-ratio : auto;
370
+ margin : 0 ;
369
371
}
Original file line number Diff line number Diff line change 964
964
console . warn ( 'toc-scroll-highlight' , e ) ;
965
965
}
966
966
/// endregion toc-scroll-highlight
967
+
968
+ /// region scrim-inline
969
+ // mdn: handle scrim-inline elements #1071
970
+ // https://github.com/website-local/mdn-local/issues/1071
971
+ function scrimCustomElement ( ) {
972
+ // Create a class for the element
973
+ class ScrimInline extends window . HTMLElement {
974
+ constructor ( ) {
975
+ super ( ) ;
976
+ var a = document . createElement ( 'a' ) ;
977
+ a . href = this . getAttribute ( 'url' ) ;
978
+ a . innerText = this . getAttribute ( 'scrimtitle' ) ;
979
+ a . className = 'external' ;
980
+ a . target = '_blank' ;
981
+ this . appendChild ( a ) ;
982
+ }
983
+ }
984
+
985
+ // Define the new element
986
+ window . customElements . define ( 'scrim-inline' , ScrimInline ) ;
987
+
988
+ }
989
+
990
+ try {
991
+ scrimCustomElement ( ) ;
992
+ } catch ( e ) {
993
+ console . warn ( 'scrim-inline' , e ) ;
994
+ }
995
+ /// endregion scrim-inline
967
996
} ( ) ;
You can’t perform that action at this time.
0 commit comments