-2

Version

    nuget Fable.Core ~> 3
    nuget Fable.Elmish ~> 3

How to change body style in elmish app?

JamesFaix
  • 8,050
  • 9
  • 37
  • 73
topica
  • 309
  • 1
  • 6

1 Answers1

2

You can access the Dom through the Fable.Import.Browser module.

Try e.g.,

open Fable.Import

Browser.document.body.style.fontSize <- "20px"

or

Browser.document.body.classList.add("my-class")
Browser.document.body.classList.remove("my-class")
nilekirk
  • 2,353
  • 1
  • 8
  • 9
  • In version 1.3.0, It seems to be `Browser.Dom.document` instead of `Browser.document`. Anyway, it works! Thank you for your answer. – topica Feb 26 '20 at 12:26