1
- module Html.Styled.Lazy exposing (lazy , lazy2 , lazy3 , lazy4 , lazy5 , lazy6 , lazy7 )
1
+ module Html.Styled.Lazy exposing
2
+ ( lazy, lazy2, lazy3, lazy4, lazy5, lazy6, lazy7
3
+ , lazyWithNonce, lazy2WithNonce, lazy3WithNonce, lazy4WithNonce, lazy5WithNonce, lazy6WithNonce
4
+ )
2
5
3
- {- | **NOTE:** `Html.Lazy` goes up to `lazy8`, but `Html.Styled.Lazy` can only go
4
- up to `lazy7` because it uses one of the arguments to track styling info.
6
+ {- | **NOTE:** `Html.Lazy` goes up to `lazy8` and `lazy7WithNonce`, but
7
+ `Html.Styled.Lazy` can only go up to `lazy7` and `lazy6WithNonce` because it
8
+ uses one of the arguments to track styling info.
5
9
6
10
Since all Elm functions are pure we have a guarantee that the same input
7
11
@@ -17,6 +21,7 @@ This is a really cheap test and often makes things a lot faster, but definitely
17
21
benchmark to be sure!
18
22
19
23
@docs lazy, lazy2, lazy3, lazy4, lazy5, lazy6, lazy7
24
+ @docs lazyWithNonce, lazy2WithNonce, lazy3WithNonce, lazy4WithNonce, lazy5WithNonce, lazy6WithNonce
20
25
21
26
-}
22
27
@@ -78,3 +83,51 @@ lazy6 =
78
83
lazy7 : (a -> b -> c -> d -> e -> f -> g -> Html msg ) -> a -> b -> c -> d -> e -> f -> g -> Html msg
79
84
lazy7 =
80
85
VirtualDom . Styled . lazy7
86
+
87
+
88
+ {- | Same as [`lazy`](#lazy) but adds a
89
+ [nonce](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce)
90
+ to the style tag so that it is compliant with the Content Security Policy of
91
+ your website.
92
+
93
+ If you don't need a nonce, you should use [`lazy`](#lazy).
94
+
95
+ -}
96
+ lazyWithNonce : String -> (a -> Html msg ) -> a -> Html msg
97
+ lazyWithNonce =
98
+ VirtualDom . Styled . lazyWithNonce
99
+
100
+
101
+ {- | Same as `lazy2` but adds a nonce to the style tag.
102
+ -}
103
+ lazy2WithNonce : String -> (a -> b -> Html msg ) -> a -> b -> Html msg
104
+ lazy2WithNonce =
105
+ VirtualDom . Styled . lazy2WithNonce
106
+
107
+
108
+ {- | Same as `lazy3` but adds a nonce to the style tag.
109
+ -}
110
+ lazy3WithNonce : String -> (a -> b -> c -> Html msg ) -> a -> b -> c -> Html msg
111
+ lazy3WithNonce =
112
+ VirtualDom . Styled . lazy3WithNonce
113
+
114
+
115
+ {- | Same as `lazy4` but adds a nonce to the style tag.
116
+ -}
117
+ lazy4WithNonce : String -> (a -> b -> c -> d -> Html msg ) -> a -> b -> c -> d -> Html msg
118
+ lazy4WithNonce =
119
+ VirtualDom . Styled . lazy4WithNonce
120
+
121
+
122
+ {- | Same as `lazy5` but adds a nonce to the style tag.
123
+ -}
124
+ lazy5WithNonce : String -> (a -> b -> c -> d -> e -> Html msg ) -> a -> b -> c -> d -> e -> Html msg
125
+ lazy5WithNonce =
126
+ VirtualDom . Styled . lazy5WithNonce
127
+
128
+
129
+ {- | Same as `lazy6` but adds a nonce to the style tag.
130
+ -}
131
+ lazy6WithNonce : String -> (a -> b -> c -> d -> e -> f -> Html msg ) -> a -> b -> c -> d -> e -> f -> Html msg
132
+ lazy6WithNonce =
133
+ VirtualDom . Styled . lazy6WithNonce
0 commit comments