Closed jerbaroo closed 7 years ago
To include a single CSS file we currently need to write a HTML file e.g. /samples/static/chat.html and serve the CSS file from our static folder. This is a lot of code for a single CSS file and also requires users to remember to include:
<script src="haskell.js"></script> <script type="text/javascript" charset="utf-8"> Haskell.initFFI(); </script>
(At least I'm not aware of a more simple way)
Suggestion is to add a way of importing CSS files that doesn't require so much wiring. Perhaps:
main = startGUI defaultConfig { includeCSS = ["/static/css/chat.css"] } setup
In the above case we edit the default served HTML by adding a stylesheet import pointing to "/static/css/chat.css".
Could also extend this mechanism for including scripts:
config = defaultConfig { includeScripts = [ "/static/js/chat.js", "https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"] } main = startGUI config setup
Well, for CSS stylesheets, there is the addStyleSheet function. Does that help?
Perfect, I dont know how I missed it.
To include a single CSS file we currently need to write a HTML file e.g. /samples/static/chat.html and serve the CSS file from our static folder. This is a lot of code for a single CSS file and also requires users to remember to include:
(At least I'm not aware of a more simple way)
Suggestion is to add a way of importing CSS files that doesn't require so much wiring. Perhaps:
In the above case we edit the default served HTML by adding a stylesheet import pointing to "/static/css/chat.css".
Could also extend this mechanism for including scripts: