Hello,
Afaik, the canonical way is to have a wrapper HTML file. If you are
concerned about losing fast reloading in elm-reactor, you can use
https://github.com/tomekwi/elm-live which can inject live reloading into
your HTML wrapper when developing! The HTML wrapper can be as simple as:
<html>
<head>
<link rel="stylesheet" href="my-styles.css">
</head>
<body>
<script src="elm.js"></script>
<script>Elm.Main.fullscreen();</script>
</body>
</html>
It's conceivable that you could use elm-html to make Elm render a style tag
into your page that references a css file to avoid having an HTML wrapper
either by making a <style> tag or a <link> tag in your Elm view. I've
never tried that myself, and also wouldn't recommend it even if it does
work because it will cause the browser to load the CSS after the page
starts rendering, so you will get visual artifacts when loading your page
(or at least some users will even if you don't).
On Thu, Oct 6, 2016 at 6:03 PM, Michael Hipp <[email protected]> wrote:
> Hello. Learning Elm. Very impressed with the work being done here.
>
> Wanting to give my app a somewhat polished look, so thought to use an
> outboard CSS library/framework. What is the canonical way to import a CSS
> file into an Elm program? (I'd prefer not to have a "wrapper" HTML document
> but rather write a pure Elm program if possible.)
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups "Elm
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.