Skip to content

Commit 60bd9bd

Browse files
committed
Deprecate 'int' and 'num'
1 parent 939e102 commit 60bd9bd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/React/Basic/Emotion.purs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ module React.Basic.Emotion
2121
) where
2222

2323
import Prelude
24+
2425
import Color (Color, cssStringHSLA)
2526
import Control.Monad.Except (runExcept)
2627
import Data.Array as Array
2728
import Data.Either (Either(..))
2829
import Data.Function.Uncurried (Fn2, runFn2)
2930
import Foreign as F
31+
import Prim.TypeError (class Warn, Text)
3032
import React.Basic (JSX, ReactComponent)
3133
import Type.Row.Homogeneous (class Homogeneous)
3234
import Unsafe.Coerce (unsafeCoerce)
@@ -122,10 +124,16 @@ merge = unsafeCoerce
122124
str :: String -> StyleProperty
123125
str = unsafeCoerce
124126

125-
int :: Int -> StyleProperty
127+
int
128+
:: Warn (Text "`int` is deprecated and may be removed in future versions. Prefer one of the unit combinators like `px` or `em` instead.")
129+
=> Int
130+
-> StyleProperty
126131
int = unsafeCoerce
127132

128-
num :: Number -> StyleProperty
133+
num
134+
:: Warn (Text "`int` is deprecated and may be removed in future versions. Prefer one of the unit combinators like `px` or `em` instead.")
135+
=> Number
136+
-> StyleProperty
129137
num = unsafeCoerce
130138

131139
fallbacks :: Array StyleProperty -> StyleProperty

0 commit comments

Comments
 (0)