@@ -84,11 +84,13 @@ runApp app = do
84
84
where
85
85
router js req =
86
86
case Wai. pathInfo req of
87
- (" static" : " css" : path) ->
88
- staticApp
89
- (defaultWebAppSettings " ../miso-functora/dist/css" )
90
- req {Wai. pathInfo = path}
91
- (" node_modules" : _) ->
87
+ (" themes" : _) ->
88
+ staticApp (defaultWebAppSettings " ../miso-functora/dist" ) req
89
+ (" fa" : _) ->
90
+ staticApp (defaultWebAppSettings " ../miso-functora/lib" ) req
91
+ (" miso-functora" : _) ->
92
+ staticApp (defaultWebAppSettings " ../miso-functora/lib" ) req
93
+ (" static" : _) ->
92
94
staticApp (defaultWebAppSettings " ." ) req
93
95
(" favicon.ico" : _) ->
94
96
staticApp (defaultWebAppSettings " static" ) req
@@ -233,33 +235,58 @@ updateModel (PushUpdate updater) st = do
233
235
pure Noop
234
236
]
235
237
238
+ --
239
+ -- TODO : !!!
240
+ --
241
+ -- href_ "https://unpkg.com/[email protected] /css/nes.min.css"
242
+ -- href_ "node_modules/@lowlighter/matcha/dist/matcha.css"
243
+ -- href_ "https://unpkg.com/@sakun/system.css"
244
+ -- href_ "https://unpkg.com/[email protected] /dist/terminal.min.css"
245
+ -- href_ "https://vinibiavatti1.github.io/TuiCss/dist/tuicss.min.css"
246
+ -- href_ "https://fieber.hack.re/fieber.css"
236
247
viewModel :: Model -> View Action
237
248
#if defined(__GHCJS__) || defined(ghcjs_HOST_OS) || defined(wasi_HOST_OS)
238
249
viewModel st =
239
- mainWidget st
250
+ prependViews
251
+ (
252
+ ( if not (st ^. # modelState . # stEnableTheme)
253
+ then mempty
254
+ else
255
+ [ link_
256
+ [ rel_ " stylesheet" ,
257
+ href_ $ " themes/" <> themeCssFile (st ^. # modelState . # stTheme)
258
+ ]
259
+ ]
260
+ ) <>
261
+ [ link_
262
+ [ rel_ " stylesheet" ,
263
+ href_ $ " miso-functora/miso-functora.min.css"
264
+ ]
265
+ ]
266
+ )
267
+ $ mainWidget st
240
268
#else
241
269
viewModel st =
270
+ --
271
+ -- NOTE : using non-optimized css for dev purposes only
272
+ --
242
273
prependViews
243
- [ link_
244
- [ rel_ " stylesheet" ,
245
- href_ " static/css/fontawesome.min.css"
246
- ],
247
- -- href_ "https://unpkg.com/[email protected] /css/nes.min.css"
248
- -- href_ "node_modules/@lowlighter/matcha/dist/matcha.css"
249
- -- href_ "https://unpkg.com/@sakun/system.css"
250
- -- href_ "https://unpkg.com/papercss/dist/paper.min.css"
251
- -- href_ "https://unpkg.com/[email protected] /dist/terminal.min.css"
252
- -- href_ "https://vinibiavatti1.github.io/TuiCss/dist/tuicss.min.css"
253
- -- href_ "https://fieber.hack.re/fieber.css"
254
- link_
255
- [ rel_ " stylesheet" ,
256
- href_ $ " static/css/" <> themeCssFile (st ^. # modelState . # stTheme)
257
- ],
258
- link_
259
- [ rel_ " stylesheet" ,
260
- href_ " static/css/app.css"
261
- ]
262
- ]
274
+ (
275
+ ( if not (st ^. # modelState . # stEnableTheme)
276
+ then mempty
277
+ else
278
+ [ link_
279
+ [ rel_ " stylesheet" ,
280
+ href_ $ " themes/" <> themeCssFile (st ^. # modelState . # stTheme)
281
+ ]
282
+ ]
283
+ ) <>
284
+ [ link_
285
+ [ rel_ " stylesheet" ,
286
+ href_ $ " miso-functora/miso-functora.css"
287
+ ]
288
+ ]
289
+ )
263
290
$ mainWidget st
264
291
#endif
265
292
0 commit comments