File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 < meta charset ="UTF-8 ">
66 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
77 < title > Python Friendly Error Messages - Demo</ title >
8+ < script >
9+ ( ( ) => {
10+ const localHosts = new Set ( [ 'localhost' , '127.0.0.1' , '::1' ] ) ;
11+ const isLocalDevelopment = window . location . protocol === 'file:' || localHosts . has ( window . location . hostname ) ;
12+ window . __PFEM_IS_LOCAL_DEVELOPMENT__ = isLocalDevelopment ;
13+ if ( isLocalDevelopment ) {
14+ document . documentElement . classList . add ( 'demo--local-dev' ) ;
15+ }
16+ } ) ( ) ;
17+ </ script >
818 < link rel ="stylesheet " href ="styles.css ">
919</ head >
1020
@@ -24,8 +34,7 @@ <h1>Python Friendly Error Messages - Demo</h1>
2434 < script type ="module ">
2535 import { examples } from './demo-examples.js' ;
2636
27- const localHosts = new Set ( [ 'localhost' , '127.0.0.1' , '::1' ] ) ;
28- const isLocalDevelopment = window . location . protocol === 'file:' || localHosts . has ( window . location . hostname ) ;
37+ const isLocalDevelopment = Boolean ( window . __PFEM_IS_LOCAL_DEVELOPMENT__ ) ;
2938
3039 const pageParams = new URLSearchParams ( window . location . search ) ;
3140 const useLocal = isLocalDevelopment && pageParams . has ( 'local' ) ;
Original file line number Diff line number Diff line change 2828 padding : 0.5rem 1rem ;
2929 font-size : 0.85rem ;
3030 font-family : monospace;
31- display : flex ;
31+ display : none ;
3232 align-items : center;
3333 margin-bottom : 1.5rem ;
3434}
3535
36+ .demo--local-dev .demo__source-bar {
37+ display : flex;
38+ }
39+
3640.demo__source-bar .container {
3741 display : flex;
3842 align-items : center;
You can’t perform that action at this time.
0 commit comments