Created
November 13, 2020 10:19
-
-
Save Zeroto/dbeaa9112927728c8c5a5ea8dd961859 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let styles = StyledComponents.import "./test.module.css" | |
let view (model : Model) (dispatch : Msg -> unit) = | |
div [styles "test"] [str "test"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style>._311kSsEcp617TYlmgIvyg4 { background-color: #FF0000; } | |
</style> | |
</head> | |
<body> | |
<div class="_311kSsEcp617TYlmgIvyg4">test</div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module StyledComponents | |
open Fable.Core | |
open Fable.Core.JsInterop | |
open Fable.React.Props | |
[<Emit("$0[$1]")>] | |
let private getProp (x: obj) (key: string) : obj = jsNative | |
let inline SClass (styles: obj) (name: string): HTMLAttr = | |
!!("className", getProp styles name) | |
let inline import moduleName = | |
let x = importAll<obj> moduleName | |
fun s -> SClass x s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.test { | |
background-color: "#FF0000" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment