Skip to content

Remove int, num deprecation #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/React/Basic/Emotion.purs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ import Data.Number.Format (toString) as Number
import Data.String as String
import Foreign as F
import Foreign.Object (Object, fromHomogeneous)
import Prim.TypeError (class Warn, Text)
import React.Basic (JSX, ReactComponent)
import Type.Row.Homogeneous (class Homogeneous)
import Unsafe.Coerce (unsafeCoerce)
Expand Down Expand Up @@ -199,16 +198,18 @@ merge = unsafeCoerce
str :: String -> StyleProperty
str = unsafeCoerce

int
:: Warn (Text "`int` is deprecated and may be removed in future versions. Prefer `str` or one of the unit combinators like `px` or `em` instead.")
=> Int
-> StyleProperty
-- | Create a unitless `Int` property.
-- |
-- | Wherever units may be specified, use unit combinators like `px`
-- | or `em` instead.
int :: Int -> StyleProperty
int = unsafeCoerce

num
:: Warn (Text "`num` is deprecated and may be removed in future versions. Prefer `str` or one of the unit combinators like `px` or `em` instead.")
=> Number
-> StyleProperty
-- | Create a unitless `Number` property.
-- |
-- | Wherever units may be specified, use unit combinators like `px`
-- | or `em` instead.
num :: Number -> StyleProperty
num = unsafeCoerce

fallbacks :: Array StyleProperty -> StyleProperty
Expand Down