diff --git a/README.md b/README.md
index c70b953..1c057db 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,12 @@
# bs-css
-Statically typed DSL for writing css in reason and rescript.
+Statically typed DSL for writing css in ReScript.
The bs-css library contains type css core definitions, it has different implementations:
- bs-css-emotion is a typed interface to [Emotion](https://github.com/emotion-js/emotion)
- bs-css-fela is a typed interface to [Fela](https://github.com/robinweser/fela) (react)
-- bs-css-dom is a typed interface to `ReactDOMRe.Style.t` (reason-react)
+- bs-css-dom is a typed interface to `ReactDOM.Style.t` (rescript-react)
If you know another implementation that can be added, send a link in an issue or create a PR.
@@ -18,7 +18,7 @@ or
yarn add bs-css bs-css-emotion
```
-In your `bsconfig.json`, include `"bs-css"` and `"bs-css-emotion"` in the `bs-dependencies`.
+In your `rescript.json`, include `"bs-css"` and `"bs-css-emotion"` in the `dependencies`.
You can replace `bs-css-emotion` with `bs-css-dom` in the above instructions if you prefer
to use React styles, or `bs-css-fela` for a different runtime.
@@ -59,7 +59,7 @@ module Styles = {
])
let actionButton = disabled =>
- style(. [
+ style([
background(disabled ? darkgray : white),
color(black),
border(px(1), solid, black),
@@ -82,8 +82,8 @@ You can define global css rules with `global`
```rescript
open CssJs
-global(. "body", [margin(px(0))])
-global(. "h1, h2, h3", [color(rgb(33, 33, 33))])
+global("body", [margin(px(0))])
+global("h1, h2, h3", [color(rgb(33, 33, 33))])
```
**Keyframes**
@@ -99,7 +99,7 @@ let bounce = keyframes(. [
(100, [transform(scale(1.0, 1.0)), opacity(1.0)]),
])
-let styles = style(. [
+let styles = style([
animationName(bounce),
animationDuration(2000),
width(px(50)),
@@ -117,7 +117,7 @@ For some CSS parameters (like setting padding on an input field), one needs to u
```css
input[type="text"] {
- padding:20px;
+ padding: 20px;
}
```
@@ -125,7 +125,7 @@ The `selector` function can be used:
```rescript
open CssJs
-let styles = style(. [selector("input[type='text']", [padding(px(20))])])
+let styles = style([selector("input[type='text']", [padding(px(20))])])
```
### Merging styles
@@ -159,7 +159,7 @@ let media2 = [
color(red)
])
]
-let mergedStyles = style(. Belt.Array.concatMany([base, overrides, media1, media2]))
+let mergedStyles = style(Belt.Array.concatMany([base, overrides, media1, media2]))
```
generates the following:
@@ -184,14 +184,14 @@ As you can see both properties from `base` are overwritten (as opposed to overri
`merge` safely merges styles by name. Uses [Emotion’s `cx` method](https://emotion.sh/docs/cx).
-```reason
+```rescript
open CssJs
-let mergedStyles = merge(. [
- style(. [padding(px(0)), fontSize(px(1))]),
- style(. [padding(px(20)), fontSize(px(24)), color(blue)]),
- style(. [media("(max-width: 768px)", [padding(px(10))])]),
- style(. [media("(max-width: 768px)", [fontSize(px(16)), color(red)])]),
+let mergedStyles = merge([
+ style([padding(px(0)), fontSize(px(1))]),
+ style([padding(px(20)), fontSize(px(24)), color(blue)]),
+ style([media("(max-width: 768px)", [padding(px(10))])]),
+ style([media("(max-width: 768px)", [fontSize(px(16)), color(red)])]),
])
```
@@ -230,7 +230,11 @@ let renderer = createRenderer()
switch ReactDOM.querySelector("#app") {
| None => ()
| Some(dom) =>
- ReactDOM.render( ... , dom)
+ dom
+ ->ReactDOM.Client.createRoot
+ ->ReactDOM.Client.Root.render(
+ ...
+ )
}
```
@@ -245,7 +249,7 @@ module Styles = {
*/
open CssJs
- let card = style(. [
+ let card = style([
display(flexBox),
flexDirection(column),
alignItems(stretch),
@@ -257,7 +261,7 @@ module Styles = {
padding(Theme.basePadding),
])
- let title = style(. [
+ let title = style([
fontSize(rem(1.5)),
lineHeight(#abs(1.25)),
color(Theme.textColor),
@@ -265,7 +269,7 @@ module Styles = {
])
let actionButton = disabled =>
- style(. [
+ style([
background(disabled ? darkgray : white),
color(black),
border(px(1), solid, black),
@@ -277,9 +281,9 @@ module Styles = {
let make = () => {
let {css, _} = CssReact.useFela()
-
-
{React.string("Hello")}
-
+
+
{React.string("Hello")}
+
}
```
@@ -288,12 +292,12 @@ let make = () => {
You can define global css rules with `global`
-```rescript
+```rescript
open CssJs
let renderer = createRenderer()
-renderGlobal(. renderer, "body", [margin(px(0))])
-renderGlobal(. renderer, "h1, h2, h3", [color(rgb(33, 33, 33))])
+renderGlobal(renderer, "body", [margin(px(0))])
+renderGlobal(renderer, "h1, h2, h3", [color(rgb(33, 33, 33))])
```
## Usage for bs-css-dom
@@ -305,7 +309,7 @@ module Styles = {
// Open the Css module, so we can access the style properties below without prefixing them with Css
open CssJs
- let card = style(. [
+ let card = style([
display(flexBox),
flexDirection(column),
alignItems(stretch),
@@ -317,10 +321,10 @@ module Styles = {
padding(Theme.basePadding),
])
- let title = style(. [fontSize(rem(1.5)), color(Theme.textColor), marginBottom(Theme.basePadding)])
+ let title = style([fontSize(rem(1.5)), color(Theme.textColor), marginBottom(Theme.basePadding)])
let actionButton = disabled =>
- style(. [
+ style([
background(disabled ? darkgray : white),
color(black),
border(px(1), solid, black),
diff --git a/bs-css-dom/bsconfig.json b/bs-css-dom/bsconfig.json
deleted file mode 100644
index 28ec48f..0000000
--- a/bs-css-dom/bsconfig.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "name": "bs-css-dom",
- "refmt": 3,
- "warnings": {
- "number": "+A-32-34-44",
- "error": "+A-32-34-44"
- },
- "sources": [
- {
- "dir": "src"
- }
- ],
- "bs-dependencies": [
- "bs-css",
- "@rescript/react"
- ]
-}
diff --git a/bs-css-dom/package.json b/bs-css-dom/package.json
index fc27cb8..bcf3556 100644
--- a/bs-css-dom/package.json
+++ b/bs-css-dom/package.json
@@ -2,33 +2,32 @@
"name": "bs-css-dom",
"version": "6.1.1",
"description": "bs-css bindings for React DOM",
+ "type": "module",
"scripts": {
"re:clean": "rescript clean",
- "re:build": "rescript build",
- "re:watch": "rescript build -w",
+ "re:build": "rescript",
+ "re:watch": "rescript watch",
"serve": "../node_modules/.bin/esbuild ./lib/js/example/App.js --servedir=example --outdir=example/js --bundle --loader:.js=jsx --define:process.env.NODE_ENV=\\\"development\\\""
},
"keywords": [
- "bucklescript",
"rescript",
- "reasonML",
"css"
],
"author": "Hervé Giraud
",
"license": "ISC",
"repository": {
"type": "git",
- "url": "git+https://github.com/reasonml-labs/bs-css.git"
+ "url": "git+https://github.com/giraud/bs-css.git"
},
"dependencies": {
"bs-css": "18.1.1"
},
"peerDependencies": {
- "@rescript/react": "^0.10.0",
- "react": "^17.0.0",
- "react-dom": "^17.0.0"
+ "@rescript/react": "^0.14.0",
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0"
},
"devDependencies": {
- "rescript": "^9.0.0"
+ "rescript": "^12.0.0"
}
}
diff --git a/bs-css-dom/rescript.json b/bs-css-dom/rescript.json
new file mode 100644
index 0000000..e3332c0
--- /dev/null
+++ b/bs-css-dom/rescript.json
@@ -0,0 +1,17 @@
+{
+ "name": "bs-css-dom",
+ "jsx": { "version": 4 },
+ "warnings": {
+ "number": "+A-32-34-44",
+ "error": "+A-32-34-44"
+ },
+ "suffix": ".mjs",
+ "sources": ["src"],
+ "dependencies": ["bs-css", "@rescript/react"],
+ "package-specs": [
+ {
+ "module": "esmodule",
+ "in-source": false
+ }
+ ]
+}
diff --git a/bs-css-dom/src/Css.res b/bs-css-dom/src/Css.res
index d3b72c8..49991f3 100644
--- a/bs-css-dom/src/Css.res
+++ b/bs-css-dom/src/Css.res
@@ -2,26 +2,26 @@ include Css_Legacy_Core
include Css_Colors
include Css_Legacy_Core.Make({
- type styleEncoding = ReactDOM.Style.t
- type renderer = Js.Json.t // not relevant
+ type styleEncoding = JsxDOMStyle.t
+ type renderer = JSON.t // not relevant
exception NotImplemented
- external unsafeJsonCast: Js.Json.t => styleEncoding = "%identity"
- external unsafeJsCast: Js.t<'a> => styleEncoding = "%identity"
+ external unsafeJsonCast: JSON.t => styleEncoding = "%identity"
+ external unsafeJsCast: {..} => styleEncoding = "%identity"
- let injectRaw = (. _) => raise(NotImplemented)
- let renderRaw = (. _, _) => raise(NotImplemented)
+ let injectRaw = _ => throw(NotImplemented)
+ let renderRaw = (_, _) => throw(NotImplemented)
- let injectRules = (. _, _) => raise(NotImplemented)
- let renderRules = (. _, _, _) => raise(NotImplemented)
+ let injectRules = (_, _) => throw(NotImplemented)
+ let renderRules = (_, _, _) => throw(NotImplemented)
- let mergeStyles = (. styles) =>
- Belt.Array.reduce(styles, Js.Obj.empty(), (acc, item) =>
- Js.Obj.assign(acc, Obj.magic(item))
+ let mergeStyles = styles =>
+ Array.reduce(styles, Object.make(), (acc, item) =>
+ Object.assign(acc, Obj.magic(item))
)->unsafeJsCast
- let make = (. props) => props->unsafeJsonCast
+ let make = props => props->unsafeJsonCast
- let makeKeyframes = (. _) => raise(NotImplemented)
- let renderKeyframes = (. _, _) => raise(NotImplemented)
+ let makeKeyframes = _ => throw(NotImplemented)
+ let renderKeyframes = (_, _) => throw(NotImplemented)
})
diff --git a/bs-css-dom/src/CssJs.res b/bs-css-dom/src/CssJs.res
index c9a5f6b..4037e9b 100644
--- a/bs-css-dom/src/CssJs.res
+++ b/bs-css-dom/src/CssJs.res
@@ -2,26 +2,26 @@ include Css_Js_Core
include Css_Colors
include Css_Js_Core.Make({
- type styleEncoding = ReactDOM.Style.t
- type renderer = Js.Json.t // not relevant
+ type styleEncoding = JsxDOMStyle.t
+ type renderer = JSON.t // not relevant
exception NotImplemented
- external unsafeJsonCast: Js.Json.t => styleEncoding = "%identity"
- external unsafeJsCast: Js.t<'a> => styleEncoding = "%identity"
+ external unsafeJsonCast: JSON.t => styleEncoding = "%identity"
+ external unsafeJsCast: {..} => styleEncoding = "%identity"
- let injectRaw = (. _) => raise(NotImplemented)
- let renderRaw = (. _, _) => raise(NotImplemented)
+ let injectRaw = _ => throw(NotImplemented)
+ let renderRaw = (_, _) => throw(NotImplemented)
- let injectRules = (. _, _) => raise(NotImplemented)
- let renderRules = (. _, _, _) => raise(NotImplemented)
+ let injectRules = (_, _) => throw(NotImplemented)
+ let renderRules = (_, _, _) => throw(NotImplemented)
- let mergeStyles = (. styles) =>
- Belt.Array.reduce(styles, Js.Obj.empty(), (acc, item) =>
- Js.Obj.assign(acc, Obj.magic(item))
+ let mergeStyles = styles =>
+ Array.reduce(styles, Object.make(), (acc, item) =>
+ Object.assign(acc, Obj.magic(item))
)->unsafeJsCast
- let make = (. rules) => rules->unsafeJsonCast
+ let make = rules => rules->unsafeJsonCast
- let makeKeyframes = (. _) => raise(NotImplemented)
- let renderKeyframes = (. _, _) => raise(NotImplemented)
-})
\ No newline at end of file
+ let makeKeyframes = _ => throw(NotImplemented)
+ let renderKeyframes = (_, _) => throw(NotImplemented)
+})
diff --git a/bs-css-emotion/bsconfig.json b/bs-css-emotion/bsconfig.json
deleted file mode 100644
index 1e8acc7..0000000
--- a/bs-css-emotion/bsconfig.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "name": "bs-css-emotion",
- "refmt": 3,
- "warnings": {
- "number": "+A-32-34-44",
- "error": "+A-32-34-44"
- },
- "sources": [
- "src"
- ],
- "bs-dependencies": [
- "bs-css"
- ]
-}
diff --git a/bs-css-emotion/package.json b/bs-css-emotion/package.json
index f72e4eb..8fe6750 100644
--- a/bs-css-emotion/package.json
+++ b/bs-css-emotion/package.json
@@ -2,23 +2,22 @@
"name": "bs-css-emotion",
"version": "7.1.1",
"description": "bs-css bindings for Emotion",
+ "type": "module",
"scripts": {
"re:clean": "rescript clean",
- "re:build": "rescript build",
- "re:watch": "rescript build -w"
+ "re:build": "rescript",
+ "re:watch": "rescript watch"
},
"keywords": [
"emotion",
- "bucklescript",
"rescript",
- "reasonML",
"css"
],
"author": "Hervé Giraud ",
"license": "ISC",
"repository": {
"type": "git",
- "url": "git+https://github.com/reasonml-labs/bs-css.git"
+ "url": "git+https://github.com/giraud/bs-css.git"
},
"dependencies": {
"@emotion/cache": "^11.0.0",
@@ -26,6 +25,6 @@
"bs-css": "18.1.1"
},
"devDependencies": {
- "rescript": "^9.0.0"
+ "rescript": "^12.0.0"
}
}
diff --git a/bs-css-emotion/rescript.json b/bs-css-emotion/rescript.json
new file mode 100644
index 0000000..6da3a72
--- /dev/null
+++ b/bs-css-emotion/rescript.json
@@ -0,0 +1,17 @@
+{
+ "name": "bs-css-emotion",
+ "jsx": { "version": 4 },
+ "warnings": {
+ "number": "+A-32-34-44",
+ "error": "+A-32-34-44"
+ },
+ "suffix": ".mjs",
+ "sources": ["src"],
+ "dependencies": ["bs-css"],
+ "package-specs": [
+ {
+ "module": "esmodule",
+ "in-source": false
+ }
+ ]
+}
diff --git a/bs-css-emotion/src/Css.res b/bs-css-emotion/src/Css.res
index 076afd3..7face0d 100644
--- a/bs-css-emotion/src/Css.res
+++ b/bs-css-emotion/src/Css.res
@@ -3,30 +3,30 @@ include Css_Colors
include Css_Legacy_Core.Make({
type styleEncoding = string
- type renderer = Js.Json.t // not relevant
+ type renderer = JSON.t // not relevant
@module("@emotion/css")
- external injectRaw: (. string) => unit = "injectGlobal"
- let renderRaw = (. _, css) => injectRaw(. css)
+ external injectRaw: string => unit = "injectGlobal"
+ let renderRaw = (_, css) => injectRaw(css)
@module("@emotion/css")
- external injectRawRules: (. Js.Json.t) => unit = "injectGlobal"
+ external injectRawRules: JSON.t => unit = "injectGlobal"
- let injectRules = (. selector: string, rules) =>
- injectRawRules(. Js.Dict.fromArray([(selector, rules)])->Js.Json.object_)
- let renderRules = (. _, selector, rules) =>
- injectRawRules(. Js.Dict.fromArray([(selector, rules)])->Js.Json.object_)
+ let injectRules = (selector: string, rules) =>
+ injectRawRules(Dict.fromArray([(selector, rules)])->JSON.Encode.object)
+ let renderRules = (_, selector, rules) =>
+ injectRawRules(Dict.fromArray([(selector, rules)])->JSON.Encode.object)
@module("@emotion/css")
- external mergeStyles: (. array) => styleEncoding = "cx"
+ external mergeStyles: array => styleEncoding = "cx"
- @module("@emotion/css") external make: (. Js.Json.t) => styleEncoding = "css"
+ @module("@emotion/css") external make: JSON.t => styleEncoding = "css"
@module("@emotion/css")
- external makeAnimation: (. Js.Dict.t) => string = "keyframes"
+ external makeAnimation: dict => string = "keyframes"
- let makeKeyframes = (. frames) => makeAnimation(. frames)
- let renderKeyframes = (. _, frames) => makeAnimation(. frames)
+ let makeKeyframes = frames => makeAnimation(frames)
+ let renderKeyframes = (_, frames) => makeAnimation(frames)
})
type cache
diff --git a/bs-css-emotion/src/CssJs.res b/bs-css-emotion/src/CssJs.res
index f3b52b0..6030b60 100644
--- a/bs-css-emotion/src/CssJs.res
+++ b/bs-css-emotion/src/CssJs.res
@@ -3,30 +3,30 @@ include Css_Colors
include Css_Js_Core.Make({
type styleEncoding = string
- type renderer = Js.Json.t // not relevant
+ type renderer = JSON.t // not relevant
@module("@emotion/css")
- external injectRaw: (. string) => unit = "injectGlobal"
- let renderRaw = (. _, css) => injectRaw(. css)
+ external injectRaw: string => unit = "injectGlobal"
+ let renderRaw = (_, css) => injectRaw(css)
@module("@emotion/css")
- external injectRawRules: (. Js.Json.t) => unit = "injectGlobal"
+ external injectRawRules: JSON.t => unit = "injectGlobal"
- let injectRules = (. selector, rules) =>
- injectRawRules(. Js.Dict.fromArray([(selector, rules)])->Js.Json.object_)
- let renderRules = (. _, selector, rules) =>
- injectRawRules(. Js.Dict.fromArray([(selector, rules)])->Js.Json.object_)
+ let injectRules = (selector, rules) =>
+ injectRawRules(Dict.fromArray([(selector, rules)])->JSON.Encode.object)
+ let renderRules = (_, selector, rules) =>
+ injectRawRules(Dict.fromArray([(selector, rules)])->JSON.Encode.object)
@module("@emotion/css")
- external mergeStyles: (. array) => styleEncoding = "cx"
+ external mergeStyles: array => styleEncoding = "cx"
- @module("@emotion/css") external make: (. Js.Json.t) => styleEncoding = "css"
+ @module("@emotion/css") external make: JSON.t => styleEncoding = "css"
@module("@emotion/css")
- external makeAnimation: (. Js.Dict.t) => string = "keyframes"
+ external makeAnimation: dict => string = "keyframes"
- let makeKeyframes = (. frames) => makeAnimation(. frames)
- let renderKeyframes = (. _, frames) => makeAnimation(. frames)
+ let makeKeyframes = frames => makeAnimation(frames)
+ let renderKeyframes = (_, frames) => makeAnimation(frames)
})
type cache
@@ -42,8 +42,16 @@ let fontFace = (
~sizeAdjust=?,
(),
) => {
- insertRule(.
- Css_Js_Core.fontFace(~fontFamily, ~src, ~fontStyle?, ~fontWeight?, ~fontDisplay?, ~sizeAdjust?, ()),
+ insertRule(
+ Css_Js_Core.fontFace(
+ ~fontFamily,
+ ~src,
+ ~fontStyle?,
+ ~fontWeight?,
+ ~fontDisplay?,
+ ~sizeAdjust?,
+ (),
+ ),
)
fontFamily
}
diff --git a/bs-css-fela/bsconfig.json b/bs-css-fela/bsconfig.json
deleted file mode 100644
index afd0bdf..0000000
--- a/bs-css-fela/bsconfig.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "name": "bs-css-fela",
- "reason": {
- "react-jsx": 3
- },
- "refmt": 3,
- "warnings": {
- "number": "+A-32-34-44",
- "error": "+A-32-34-44"
- },
- "sources": [
- "src"
- ],
- "bs-dependencies": [
- "bs-css",
- "@rescript/react"
- ]
-}
diff --git a/bs-css-fela/package.json b/bs-css-fela/package.json
index c9af2f8..64d4311 100644
--- a/bs-css-fela/package.json
+++ b/bs-css-fela/package.json
@@ -1,32 +1,31 @@
{
- "name": "bs-css-fela",
- "version": "5.1.1",
- "description": "bs-css bindings for Fela",
- "scripts": {
- "re:clean": "rescript clean",
- "re:build": "rescript build",
- "re:watch": "rescript build -w"
- },
- "keywords": [
- "fela",
- "bucklescript",
- "rescript",
- "reasonML",
- "css"
- ],
- "author": "Hervé Giraud ",
- "license": "ISC",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/reasonml-labs/bs-css.git"
- },
- "dependencies": {
- "bs-css": "18.1.1",
- "fela": "^11.0.0",
- "react-fela": "^11.0.0"
- },
- "devDependencies": {
- "react": "^17.0.0",
- "rescript": "^9.0.0"
- }
+ "name": "bs-css-fela",
+ "version": "5.1.1",
+ "description": "bs-css bindings for Fela",
+ "type": "module",
+ "scripts": {
+ "re:clean": "rescript clean",
+ "re:build": "rescript",
+ "re:watch": "rescript watch"
+ },
+ "keywords": [
+ "fela",
+ "rescript",
+ "css"
+ ],
+ "author": "Hervé Giraud ",
+ "license": "ISC",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/giraud/bs-css.git"
+ },
+ "dependencies": {
+ "bs-css": "18.1.1",
+ "fela": "^12.2.0",
+ "react-fela": "^12.2.0"
+ },
+ "devDependencies": {
+ "react": "^19.0.0",
+ "rescript": "^12.0.0"
+ }
}
diff --git a/bs-css-fela/rescript.json b/bs-css-fela/rescript.json
new file mode 100644
index 0000000..3704b05
--- /dev/null
+++ b/bs-css-fela/rescript.json
@@ -0,0 +1,17 @@
+{
+ "name": "bs-css-fela",
+ "jsx": { "version": 4 },
+ "warnings": {
+ "number": "+A-32-34-44",
+ "error": "+A-32-34-44"
+ },
+ "suffix": ".mjs",
+ "sources": ["src"],
+ "dependencies": ["bs-css", "@rescript/react"],
+ "package-specs": [
+ {
+ "module": "esmodule",
+ "in-source": false
+ }
+ ]
+}
diff --git a/bs-css-fela/src/Css.res b/bs-css-fela/src/Css.res
index 4ba3e87..51335bd 100644
--- a/bs-css-fela/src/Css.res
+++ b/bs-css-fela/src/Css.res
@@ -4,38 +4,36 @@ include Css_Colors
type renderer
include Css_Js_Core.Make({
- type styleEncoding = Js.Json.t
+ type styleEncoding = JSON.t
type renderer = renderer
exception NotImplemented
@send
external renderStaticString: (renderer, string) => unit = "renderStatic"
- let injectRaw = (. _css) => raise(NotImplemented)
- let renderRaw = (. renderer, css) => renderStaticString(renderer, css)
+ let injectRaw = _css => throw(NotImplemented)
+ let renderRaw = (renderer, css) => renderStaticString(renderer, css)
@send
- external renderStatic: (renderer, Js.Json.t, string) => unit = "renderStatic"
+ external renderStatic: (renderer, JSON.t, string) => unit = "renderStatic"
- let injectRules = (. _selector, _rules) => raise(NotImplemented)
- let renderRules = (. renderer, selector, rules: Js.Json.t) =>
- renderStatic(renderer, rules, selector)
- let make = (. rules) => rules
+ let injectRules = (_selector, _rules) => throw(NotImplemented)
+ let renderRules = (renderer, selector, rules: JSON.t) => renderStatic(renderer, rules, selector)
+ let make = rules => rules
@module("fela")
external // no transformation
- mergeStyles: (. array) => styleEncoding = "combineRules"
+ mergeStyles: array => styleEncoding = "combineRules"
@send
- external felaRenderKeyframes: (renderer, (. 'a) => Js.Dict.t, Js.Json.t) => string =
- "renderKeyframe"
+ external felaRenderKeyframes: (renderer, 'a => dict, JSON.t) => string = "renderKeyframe"
- let makeKeyframes = (. _) => raise(NotImplemented)
+ let makeKeyframes = _ => throw(NotImplemented)
- let renderKeyframes = (. renderer, frames) =>
- renderer->felaRenderKeyframes((. _props) => frames, Js.Json.object_(Js.Dict.empty()))
+ let renderKeyframes = (renderer, frames) =>
+ renderer->felaRenderKeyframes(_props => frames, JSON.Encode.object(Dict.make()))
})
@module("fela")
-external createRenderer: unit => renderer = "createRenderer"
\ No newline at end of file
+external createRenderer: unit => renderer = "createRenderer"
diff --git a/bs-css-fela/src/CssReact.res b/bs-css-fela/src/CssReact.res
index b9f024d..bb50128 100644
--- a/bs-css-fela/src/CssReact.res
+++ b/bs-css-fela/src/CssReact.res
@@ -4,7 +4,7 @@ module RendererProvider = {
"RendererProvider"
}
-type css = (. Js.Json.t) => string
+type css = JSON.t => string
type theme
type felaHook = {
diff --git a/bs-css/__tests__/Css_Js_test.res b/bs-css/__tests__/Css_Js_test.res
index 0e731ed..b888075 100644
--- a/bs-css/__tests__/Css_Js_test.res
+++ b/bs-css/__tests__/Css_Js_test.res
@@ -2,9 +2,9 @@ open EmptyCssImpl.New
let describe = Jest.describe
let test = Jest.test
-let toBe = (e, x) => Jest.toBe(e, x->Js.Json.stringifyAny)
+let toBe = (e, x) => Jest.toBe(e, x->JSON.stringifyAny)
let expect = x =>
- Jest.expect(toJson([x])->Js.Json.stringifyAny) /* simple rule for more readable tests */
+ Jest.expect(toJson([x])->JSON.stringifyAny) /* simple rule for more readable tests */
describe("borderTopStyle", () => {
test("test usage", () => {
diff --git a/bs-css/__tests__/Css_test.res b/bs-css/__tests__/Css_test.res
index 4ca1933..b7f10dd 100644
--- a/bs-css/__tests__/Css_test.res
+++ b/bs-css/__tests__/Css_test.res
@@ -5,9 +5,9 @@ module CssForTest = {
open CssForTest
let describe = Jest.describe
let test = Jest.test
-let toBe = (e, x) => Jest.toBe(e, x->Js.Json.stringifyAny)
+let toBe = (e, x) => Jest.toBe(e, x->JSON.stringifyAny)
let expect = x =>
- Jest.expect(toJson(list{x})->Js.Json.stringifyAny) /* simple rule for more readable tests */
+ Jest.expect(toJson(list{x})->JSON.stringifyAny) /* simple rule for more readable tests */
describe("borderTopStyle", () => {
test("test usage", () => {
diff --git a/bs-css/__tests__/Selectors_test.res b/bs-css/__tests__/Selectors_test.res
index a921251..e5331d0 100644
--- a/bs-css/__tests__/Selectors_test.res
+++ b/bs-css/__tests__/Selectors_test.res
@@ -3,9 +3,9 @@ open EmptyCssImpl.Legacy
let ruleSelector = display(block)
let ruleJson = {"display": "block"}
-let toBe = (e, x) => Jest.toBe(e, x->Js.Json.stringifyAny)
+let toBe = (e, x) => Jest.toBe(e, x->JSON.stringifyAny)
let expect = x =>
- Jest.expect(toJson(list{x})->Js.Json.stringifyAny) /* simple rule for more readable tests */
+ Jest.expect(toJson(list{x})->JSON.stringifyAny) /* simple rule for more readable tests */
describe("Pseudo classes", () => {
test("test selectors that have no parameters", () => {
diff --git a/bs-css/__tests__/Svg_test.res b/bs-css/__tests__/Svg_test.res
index 38963cf..e2dbe66 100644
--- a/bs-css/__tests__/Svg_test.res
+++ b/bs-css/__tests__/Svg_test.res
@@ -1,8 +1,8 @@
open Jest
open EmptyCssImpl.Legacy
-let toBeJson = (e, x) => toBe(e, x->Js.Json.stringifyAny)
-let r = x => toJson(list{x})->Js.Json.stringifyAny /* simple rule for more readable tests */
+let toBeJson = (e, x) => toBe(e, x->JSON.stringifyAny)
+let r = x => toJson(list{x})->JSON.stringifyAny /* simple rule for more readable tests */
describe("Fill", () =>
test("test values", () => {
diff --git a/bs-css/__tests__/helpers/EmptyCssImpl.res b/bs-css/__tests__/helpers/EmptyCssImpl.res
index fd58b9b..6238c2a 100644
--- a/bs-css/__tests__/helpers/EmptyCssImpl.res
+++ b/bs-css/__tests__/helpers/EmptyCssImpl.res
@@ -5,16 +5,16 @@ module New = {
include Css_Js_Core
include Css_Js_Core.Make({
type styleEncoding = string
- type renderer = Js.Json.t
+ type renderer = JSON.t
- let injectRaw = (. _) => raise(NotImplemented)
- let renderRaw = (. _, _) => raise(NotImplemented)
- let injectRules = (. _, _) => raise(NotImplemented)
- let renderRules = (. _, _, _) => raise(NotImplemented)
- let make = (. _) => raise(NotImplemented)
- let mergeStyles = (. _) => raise(NotImplemented)
- let makeKeyframes = (. _) => raise(NotImplemented)
- let renderKeyframes = (. _, _) => raise(NotImplemented)
+ let injectRaw = _ => throw(NotImplemented)
+ let renderRaw = (_, _) => throw(NotImplemented)
+ let injectRules = (_, _) => throw(NotImplemented)
+ let renderRules = (_, _, _) => throw(NotImplemented)
+ let make = _ => throw(NotImplemented)
+ let mergeStyles = _ => throw(NotImplemented)
+ let makeKeyframes = _ => throw(NotImplemented)
+ let renderKeyframes = (_, _) => throw(NotImplemented)
})
}
@@ -23,15 +23,15 @@ module Legacy = {
include Css_Legacy_Core
include Css_Legacy_Core.Make({
type styleEncoding = string
- type renderer = Js.Json.t
+ type renderer = JSON.t
- let injectRaw = (. _) => raise(NotImplemented)
- let renderRaw = (. _, _) => raise(NotImplemented)
- let injectRules = (. _, _) => raise(NotImplemented)
- let renderRules = (. _, _, _) => raise(NotImplemented)
- let make = (. _) => raise(NotImplemented)
- let mergeStyles = (. _) => raise(NotImplemented)
- let makeKeyframes = (. _) => raise(NotImplemented)
- let renderKeyframes = (. _, _) => raise(NotImplemented)
+ let injectRaw = _ => throw(NotImplemented)
+ let renderRaw = (_, _) => throw(NotImplemented)
+ let injectRules = (_, _) => throw(NotImplemented)
+ let renderRules = (_, _, _) => throw(NotImplemented)
+ let make = _ => throw(NotImplemented)
+ let mergeStyles = _ => throw(NotImplemented)
+ let makeKeyframes = _ => throw(NotImplemented)
+ let renderKeyframes = (_, _) => throw(NotImplemented)
})
}
diff --git a/bs-css/__tests__/helpers/Jest.res b/bs-css/__tests__/helpers/Jest.res
index 50c951f..570508c 100644
--- a/bs-css/__tests__/helpers/Jest.res
+++ b/bs-css/__tests__/helpers/Jest.res
@@ -1,12 +1,9 @@
type asyncDone<'a> = 'a => unit
type expectation<'a>
-@val
-external describe: (string, @uncurry (unit => unit)) => unit = "describe"
-@val
-external test: (string, @uncurry (unit => unit)) => unit = "test"
-@val
-external testAsync: (string, @uncurry (asyncDone<'a> => unit)) => unit = "it"
+@val external describe: (string, unit => unit) => unit = "describe"
+@val external test: (string, unit => unit) => unit = "test"
+@val external testAsync: (string, asyncDone<'a> => unit) => unit = "it"
@val external expect: 'a => expectation<'a> = "expect"
@send external toEqual: (expectation<'a>, 'a) => unit = "toEqual"
diff --git a/bs-css/bsconfig.json b/bs-css/bsconfig.json
deleted file mode 100644
index 1772918..0000000
--- a/bs-css/bsconfig.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "name": "bs-css",
- "refmt": 3,
- "warnings": {
- "number": "+A-32-34-44",
- "error": "+A-32-34-44"
- },
- "sources": [
- "src",
- {
- "dir": "__tests__",
- "type": "dev",
- "subdirs": true
- }
- ]
-}
diff --git a/bs-css/package.json b/bs-css/package.json
index 062398b..aca7986 100644
--- a/bs-css/package.json
+++ b/bs-css/package.json
@@ -2,32 +2,31 @@
"name": "bs-css",
"version": "18.1.1",
"description": "Css types",
+ "type": "module",
"scripts": {
"re:clean": "rescript clean",
- "re:build": "rescript build",
- "re:watch": "rescript build -w",
- "test": "jest",
- "testw": "jest --watchAll"
+ "re:build": "rescript",
+ "re:watch": "rescript watch",
+ "test": "node --experimental-vm-modules ../node_modules/jest/bin/jest.js",
+ "testw": "node --experimental-vm-modules ../node_modules/jest/bin/jest.js --watchAll"
},
"keywords": [
- "bucklescript",
"rescript",
- "reasonML",
"css"
],
"author": "Andreas Møller ",
"license": "ISC",
"repository": {
"type": "git",
- "url": "git+https://github.com/reasonml-labs/bs-css.git"
+ "url": "git+https://github.com/giraud/bs-css.git"
},
"devDependencies": {
"jest": "^30.0.0",
- "rescript": "^9.0.0"
+ "rescript": "^12.0.0"
},
"jest": {
"testPathIgnorePatterns": [
- "/lib/js/__tests__/helpers"
+ "/lib/es6/__tests__/helpers"
]
}
}
diff --git a/bs-css/rescript.json b/bs-css/rescript.json
new file mode 100644
index 0000000..31f925d
--- /dev/null
+++ b/bs-css/rescript.json
@@ -0,0 +1,23 @@
+{
+ "name": "bs-css",
+ "jsx": { "version": 4 },
+ "warnings": {
+ "number": "+A-32-34-44",
+ "error": "+A-32-34-44"
+ },
+ "suffix": ".mjs",
+ "sources": [
+ "src",
+ {
+ "dir": "__tests__",
+ "type": "dev",
+ "subdirs": true
+ }
+ ],
+ "package-specs": [
+ {
+ "module": "esmodule",
+ "in-source": false
+ }
+ ]
+}
diff --git a/bs-css/src/Css_AtomicTypes.res b/bs-css/src/Css_AtomicTypes.res
index 0a30bf0..2b7214b 100644
--- a/bs-css/src/Css_AtomicTypes.res
+++ b/bs-css/src/Css_AtomicTypes.res
@@ -1,9 +1,9 @@
let join = (strings, separator) => {
- let rec run = (strings, acc) =>
+ let rec run: (list, string) => string = (strings, acc) =>
switch strings {
| list{} => acc
- | list{x} => acc ++ x
- | list{x, ...xs} => run(xs, acc ++ x ++ separator)
+ | list{x} => acc + x
+ | list{x, ...xs} => run(xs, acc + x + separator)
}
run(strings, "")
}
@@ -29,12 +29,12 @@ module Var = {
let var = x => #var(x)
let varDefault = (x, default) => #varDefault((x, default))
- let prefix = x => Js.String.startsWith("--", x) ? x : "--" ++ x
+ let prefix = x => x->String.startsWith("--") ? x : "--" + x
let toString = x =>
switch x {
- | #var(x) => "var(" ++ prefix(x) ++ ")"
- | #varDefault(x, v) => "var(" ++ prefix(x) ++ "," ++ v ++ ")"
+ | #var(x) => "var(" + prefix(x) + ")"
+ | #varDefault(x, v) => "var(" + prefix(x) + "," + v + ")"
}
}
@@ -46,8 +46,8 @@ module Time = {
let toString = x =>
switch x {
- | #s(v) => Js.Float.toString(v) ++ "s"
- | #ms(v) => Js.Float.toString(v) ++ "ms"
+ | #s(v) => Float.toString(v) + "s"
+ | #ms(v) => Float.toString(v) + "ms"
}
}
@@ -58,7 +58,7 @@ module Percentage = {
let toString = x =>
switch x {
- | #percent(x) => Js.Float.toString(x) ++ "%"
+ | #percent(x) => Float.toString(x) + "%"
}
}
@@ -67,7 +67,7 @@ module Url = {
let toString = x =>
switch x {
- | #url(s) => "url(" ++ s ++ ")"
+ | #url(s) => "url(" + s + ")"
}
}
@@ -111,23 +111,23 @@ module Length = {
let toString = x =>
switch x {
- | #ch(x) => Js.Float.toString(x) ++ "ch"
- | #em(x) => Js.Float.toString(x) ++ "em"
- | #ex(x) => Js.Float.toString(x) ++ "ex"
- | #rem(x) => Js.Float.toString(x) ++ "rem"
- | #vh(x) => Js.Float.toString(x) ++ "vh"
- | #vw(x) => Js.Float.toString(x) ++ "vw"
- | #vmin(x) => Js.Float.toString(x) ++ "vmin"
- | #vmax(x) => Js.Float.toString(x) ++ "vmax"
- | #px(x) => Js.Int.toString(x) ++ "px"
- | #pxFloat(x) => Js.Float.toString(x) ++ "px"
- | #cm(x) => Js.Float.toString(x) ++ "cm"
- | #mm(x) => Js.Float.toString(x) ++ "mm"
- | #inch(x) => Js.Float.toString(x) ++ "in"
- | #pc(x) => Js.Float.toString(x) ++ "pc"
- | #pt(x) => Js.Int.toString(x) ++ "pt"
+ | #ch(x) => Float.toString(x) + "ch"
+ | #em(x) => Float.toString(x) + "em"
+ | #ex(x) => Float.toString(x) + "ex"
+ | #rem(x) => Float.toString(x) + "rem"
+ | #vh(x) => Float.toString(x) + "vh"
+ | #vw(x) => Float.toString(x) + "vw"
+ | #vmin(x) => Float.toString(x) + "vmin"
+ | #vmax(x) => Float.toString(x) + "vmax"
+ | #px(x) => Int.toString(x) + "px"
+ | #pxFloat(x) => Float.toString(x) + "px"
+ | #cm(x) => Float.toString(x) + "cm"
+ | #mm(x) => Float.toString(x) + "mm"
+ | #inch(x) => Float.toString(x) + "in"
+ | #pc(x) => Float.toString(x) + "pc"
+ | #pt(x) => Int.toString(x) + "pt"
| #zero => "0"
- | #percent(x) => Js.Float.toString(x) ++ "%"
+ | #percent(x) => Float.toString(x) + "%"
}
}
@@ -150,12 +150,12 @@ module PercentageLengthCalc = {
switch x {
| #...Percentage.t as p => Percentage.toString(p)
| #...Length.t as l => Length.toString(l)
- | #min(a, b) => "min(" ++ toString(a) ++ ", " ++ toString(b) ++ ")"
- | #max(a, b) => "max(" ++ toString(a) ++ ", " ++ toString(b) ++ ")"
- | #add(a, b) => "calc(" ++ toString(a) ++ " + " ++ toString(b) ++ ")"
- | #subtract(a, b) => "calc(" ++ toString(a) ++ " - " ++ toString(b) ++ ")"
- | #mul(a, b) => "calc(" ++ toString(a) ++ " * " ++ Js.Float.toString(b) ++ ")"
- | #div(a, b) => "calc(" ++ toString(a) ++ " / " ++ Js.Float.toString(b) ++ ")"
+ | #min(a, b) => "min(" + toString(a) + ", " + toString(b) + ")"
+ | #max(a, b) => "max(" + toString(a) + ", " + toString(b) + ")"
+ | #add(a, b) => "calc(" + toString(a) + " + " + toString(b) + ")"
+ | #subtract(a, b) => "calc(" + toString(a) + " - " + toString(b) + ")"
+ | #mul(a, b) => "calc(" + toString(a) + " * " + Float.toString(b) + ")"
+ | #div(a, b) => "calc(" + toString(a) + " / " + Float.toString(b) + ")"
}
}
@@ -169,10 +169,10 @@ module Angle = {
let toString = x =>
switch x {
- | #deg(x) => Js.Float.toString(x) ++ "deg"
- | #rad(x) => Js.Float.toString(x) ++ "rad"
- | #grad(x) => Js.Float.toString(x) ++ "grad"
- | #turn(x) => Js.Float.toString(x) ++ "turn"
+ | #deg(x) => Float.toString(x) + "deg"
+ | #rad(x) => Float.toString(x) + "rad"
+ | #grad(x) => Float.toString(x) + "grad"
+ | #turn(x) => Float.toString(x) + "turn"
}
}
@@ -461,17 +461,17 @@ module TimingFunction = {
| #easeInOut => "ease-in-out"
| #stepStart => "step-start"
| #stepEnd => "step-end"
- | #steps(i, #start) => "steps(" ++ Js.Int.toString(i) ++ ", start)"
- | #steps(i, #end_) => "steps(" ++ Js.Int.toString(i) ++ ", end)"
+ | #steps(i, #start) => "steps(" + Int.toString(i) + ", start)"
+ | #steps(i, #end_) => "steps(" + Int.toString(i) + ", end)"
| #cubicBezier(a, b, c, d) =>
- "cubic-bezier(" ++
- Js.Float.toString(a) ++
- ", " ++
- Js.Float.toString(b) ++
- ", " ++
- Js.Float.toString(c) ++
- ", " ++
- Js.Float.toString(d) ++ ")"
+ "cubic-bezier(" +
+ Float.toString(a) +
+ ", " +
+ Float.toString(b) +
+ ", " +
+ Float.toString(c) +
+ ", " +
+ Float.toString(d) + ")"
| #jumpStart => "jump-start"
| #jumpEnd => "jump-end"
| #jumpNone => "jump-none"
@@ -486,7 +486,7 @@ module RepeatValue = {
switch x {
| #autoFill => "auto-fill"
| #autoFit => "auto-fit"
- | #num(x) => Js.Int.toString(x)
+ | #num(x) => Int.toString(x)
}
}
@@ -590,7 +590,7 @@ module FontWeight = {
let toString = x =>
switch x {
- | #num(n) => Js.Int.toString(n)
+ | #num(n) => Int.toString(n)
| #thin => "100"
| #extraLight => "200"
| #light => "300"
@@ -647,52 +647,46 @@ module Transform = {
let skewX = a => #skewX(a)
let skewY = a => #skewY(a)
- let string_of_scale = (x, y) =>
- "scale(" ++ Js.Float.toString(x) ++ ", " ++ Js.Float.toString(y) ++ ")"
+ let string_of_scale = (x, y) => "scale(" + Float.toString(x) + ", " + Float.toString(y) + ")"
let string_of_translate3d = (x, y, z) =>
- "translate3d(" ++
- Length.toString(x) ++
- ", " ++
- Length.toString(y) ++
- ", " ++
- Length.toString(z) ++ ")"
+ "translate3d(" +
+ Length.toString(x) +
+ ", " +
+ Length.toString(y) +
+ ", " +
+ Length.toString(z) + ")"
let toString = x =>
switch x {
- | #translate(x, y) => "translate(" ++ Length.toString(x) ++ ", " ++ Length.toString(y) ++ ")"
+ | #translate(x, y) => "translate(" + Length.toString(x) + ", " + Length.toString(y) + ")"
| #translate3d(x, y, z) => string_of_translate3d(x, y, z)
- | #translateX(x) => "translateX(" ++ Length.toString(x) ++ ")"
- | #translateY(y) => "translateY(" ++ Length.toString(y) ++ ")"
- | #translateZ(z) => "translateZ(" ++ Length.toString(z) ++ ")"
+ | #translateX(x) => "translateX(" + Length.toString(x) + ")"
+ | #translateY(y) => "translateY(" + Length.toString(y) + ")"
+ | #translateZ(z) => "translateZ(" + Length.toString(z) + ")"
| #scale(x, y) => string_of_scale(x, y)
| #scale3d(x, y, z) =>
- "scale3d(" ++
- Js.Float.toString(x) ++
- ", " ++
- Js.Float.toString(y) ++
- ", " ++
- Js.Float.toString(z) ++ ")"
- | #scaleX(x) => "scaleX(" ++ Js.Float.toString(x) ++ ")"
- | #scaleY(y) => "scaleY(" ++ Js.Float.toString(y) ++ ")"
- | #scaleZ(z) => "scaleZ(" ++ Js.Float.toString(z) ++ ")"
- | #rotate(a) => "rotate(" ++ Angle.toString(a) ++ ")"
+ "scale3d(" + Float.toString(x) + ", " + Float.toString(y) + ", " + Float.toString(z) + ")"
+ | #scaleX(x) => "scaleX(" + Float.toString(x) + ")"
+ | #scaleY(y) => "scaleY(" + Float.toString(y) + ")"
+ | #scaleZ(z) => "scaleZ(" + Float.toString(z) + ")"
+ | #rotate(a) => "rotate(" + Angle.toString(a) + ")"
| #rotate3d(x, y, z, a) =>
- "rotate3d(" ++
- Js.Float.toString(x) ++
- ", " ++
- Js.Float.toString(y) ++
- ", " ++
- Js.Float.toString(z) ++
- ", " ++
- Angle.toString(a) ++ ")"
- | #rotateX(a) => "rotateX(" ++ Angle.toString(a) ++ ")"
- | #rotateY(a) => "rotateY(" ++ Angle.toString(a) ++ ")"
- | #rotateZ(a) => "rotateZ(" ++ Angle.toString(a) ++ ")"
- | #skew(x, y) => "skew(" ++ Angle.toString(x) ++ ", " ++ Angle.toString(y) ++ ")"
- | #skewX(a) => "skewX(" ++ Angle.toString(a) ++ ")"
- | #skewY(a) => "skewY(" ++ Angle.toString(a) ++ ")"
- | #perspective(x) => "perspective(" ++ Js.Int.toString(x) ++ ")"
+ "rotate3d(" +
+ Float.toString(x) +
+ ", " +
+ Float.toString(y) +
+ ", " +
+ Float.toString(z) +
+ ", " +
+ Angle.toString(a) + ")"
+ | #rotateX(a) => "rotateX(" + Angle.toString(a) + ")"
+ | #rotateY(a) => "rotateY(" + Angle.toString(a) + ")"
+ | #rotateZ(a) => "rotateZ(" + Angle.toString(a) + ")"
+ | #skew(x, y) => "skew(" + Angle.toString(x) + ", " + Angle.toString(y) + ")"
+ | #skewX(a) => "skewX(" + Angle.toString(a) + ")"
+ | #skewY(a) => "skewY(" + Angle.toString(a) + ")"
+ | #perspective(x) => "perspective(" + Int.toString(x) + ")"
}
}
@@ -726,7 +720,7 @@ module AnimationIterationCount = {
let toString = x =>
switch x {
| #infinite => "infinite"
- | #count(x) => Js.Int.toString(x)
+ | #count(x) => Int.toString(x)
}
}
@@ -878,7 +872,7 @@ module ColorScheme = {
let toString = x =>
switch x {
| #...value as v => toStringValue(v)
- | #many(v, v') => toStringValue(v) ++ " " ++ toStringValue(v')
+ | #many(v, v') => toStringValue(v) + " " + toStringValue(v')
}
}
@@ -915,7 +909,7 @@ module Color = {
let string_of_alpha = alpha =>
switch alpha {
- | #num(f) => Js.Float.toString(f)
+ | #num(f) => Float.toString(f)
| #...Percentage.t as pc => Percentage.toString(pc)
| #...Var.t as va => Var.toString(va)
}
@@ -929,38 +923,33 @@ module Color = {
let toStringValue = x =>
switch x {
| #rgb(r, g, b) =>
- "rgb(" ++
- Js.Int.toString(r) ++
- ", " ++
- Js.Int.toString(g) ++
- ", " ++
- Js.Int.toString(b) ++ ")"
+ "rgb(" + Int.toString(r) + ", " + Int.toString(g) + ", " + Int.toString(b) + ")"
| #rgba(r, g, b, a) =>
- "rgba(" ++
- Js.Int.toString(r) ++
- ", " ++
- Js.Int.toString(g) ++
- ", " ++
- Js.Int.toString(b) ++
- ", " ++
- string_of_alpha(a) ++ ")"
+ "rgba(" +
+ Int.toString(r) +
+ ", " +
+ Int.toString(g) +
+ ", " +
+ Int.toString(b) +
+ ", " +
+ string_of_alpha(a) + ")"
| #hsl(h, s, l) =>
- "hsl(" ++
- string_of_hue(h) ++
- ", " ++
- string_of_percentage(s) ++
- ", " ++
- string_of_percentage(l) ++ ")"
+ "hsl(" +
+ string_of_hue(h) +
+ ", " +
+ string_of_percentage(s) +
+ ", " +
+ string_of_percentage(l) + ")"
| #hsla(h, s, l, a) =>
- "hsla(" ++
- string_of_hue(h) ++
- ", " ++
- string_of_percentage(s) ++
- ", " ++
- string_of_percentage(l) ++
- ", " ++
- string_of_alpha(a) ++ ")"
- | #hex(s) => "#" ++ s
+ "hsla(" +
+ string_of_hue(h) +
+ ", " +
+ string_of_percentage(s) +
+ ", " +
+ string_of_percentage(l) +
+ ", " +
+ string_of_alpha(a) + ")"
+ | #hex(s) => "#" + s
| #transparent => "transparent"
| #currentColor => "currentColor"
}
@@ -968,7 +957,7 @@ module Color = {
let toString = x =>
switch x {
| #...value as ba => toStringValue(ba)
- | #lightDark(c, c') => "light-dark(" ++ toStringValue(c) ++ ", " ++ toStringValue(c') ++ ")"
+ | #lightDark(c, c') => "light-dark(" + toStringValue(c) + ", " + toStringValue(c') + ")"
}
}
@@ -1037,7 +1026,7 @@ module LineHeight = {
let toString = x =>
switch x {
| #normal => "normal"
- | #abs(x) => Js.Float.toString(x)
+ | #abs(x) => Float.toString(x)
}
}
@@ -1174,8 +1163,8 @@ module OverflowAlignment = {
let toString = x =>
switch x {
- | #safe(pa) => "safe " ++ PositionalAlignment.toString(pa)
- | #unsafe(pa) => "unsafe " ++ PositionalAlignment.toString(pa)
+ | #safe(pa) => "safe " + PositionalAlignment.toString(pa)
+ | #unsafe(pa) => "unsafe " + PositionalAlignment.toString(pa)
}
}
@@ -1322,7 +1311,7 @@ module Clear = {
}
}
-module Float = {
+module Float_AtomicTypes = {
type t = [#left | #right | #none | #inlineStart | #inlineEnd]
let toString = x =>
@@ -1405,7 +1394,7 @@ module ColumnCount = {
let toString = x =>
switch x {
| #auto => "auto"
- | #count(v) => Js.Int.toString(v)
+ | #count(v) => Int.toString(v)
}
}
@@ -1443,7 +1432,7 @@ module GridTemplateAreas = {
switch x {
| #none => "none"
| #areas(items) =>
- String.trim(Belt.Array.reduceU(items, "", (. carry, item) => carry ++ "'" ++ item ++ "' "))
+ String.trim(Array.reduce(items, "", (carry, item) => carry + "'" + item + "' "))
}
}
@@ -1466,12 +1455,12 @@ module GridArea = {
switch t {
| #auto => "auto"
| #ident(s) => s
- | #num(i) => string_of_int(i)
- | #numIdent(i, s) => string_of_int(i) ++ " " ++ s
+ | #num(i) => Int.toString(i)
+ | #numIdent(i, s) => Int.toString(i) + " " + s
| #span(e) =>
- "span " ++
+ "span " +
switch e {
- | #num(i) => string_of_int(i)
+ | #num(i) => Int.toString(i)
| #ident(s) => s
}
}
@@ -1493,30 +1482,30 @@ module BackdropFilter = {
| #sepia([#num(int) | #percent(float)])
]
- let string_of_percent = p => Js.Float.toString(p) ++ "%"
+ let string_of_percent = p => Float.toString(p) + "%"
let toString = x =>
switch x {
- | #blur(#...Length.t as b) => "blur(" ++ Length.toString(b) ++ ")"
- | #brightness(#num(b)) => "brightness(" ++ string_of_int(b) ++ ")"
- | #brightness(#percent(b)) => "brightness(" ++ string_of_percent(b) ++ ")"
- | #contrast(#num(c)) => "contrast(" ++ string_of_int(c) ++ ")"
- | #contrast(#percent(c)) => "contrast(" ++ string_of_percent(c) ++ ")"
- | #dropShadow(#num(i)) => "drop-shadow(" ++ string_of_int(i) ++ ")"
- | #dropShadow(#percent(i)) => "drop-shadow(" ++ string_of_percent(i) ++ ")"
- | #grayscale(#num(i)) => "grayscale(" ++ string_of_int(i) ++ ")"
- | #grayscale(#percent(i)) => "grayscale(" ++ string_of_percent(i) ++ ")"
- | #hueRotate(#...Angle.t as h) => "hue-rotate(" ++ Angle.toString(h) ++ ")"
+ | #blur(#...Length.t as b) => "blur(" + Length.toString(b) + ")"
+ | #brightness(#num(b)) => "brightness(" + Int.toString(b) + ")"
+ | #brightness(#percent(b)) => "brightness(" + string_of_percent(b) + ")"
+ | #contrast(#num(c)) => "contrast(" + Int.toString(c) + ")"
+ | #contrast(#percent(c)) => "contrast(" + string_of_percent(c) + ")"
+ | #dropShadow(#num(i)) => "drop-shadow(" + Int.toString(i) + ")"
+ | #dropShadow(#percent(i)) => "drop-shadow(" + string_of_percent(i) + ")"
+ | #grayscale(#num(i)) => "grayscale(" + Int.toString(i) + ")"
+ | #grayscale(#percent(i)) => "grayscale(" + string_of_percent(i) + ")"
+ | #hueRotate(#...Angle.t as h) => "hue-rotate(" + Angle.toString(h) + ")"
| #hueRotate(#zero) => "hue-rotate(0deg)"
- | #invert(#num(i)) => "invert(" ++ string_of_int(i) ++ ")"
- | #invert(#percent(i)) => "invert(" ++ string_of_percent(i) ++ ")"
+ | #invert(#num(i)) => "invert(" + Int.toString(i) + ")"
+ | #invert(#percent(i)) => "invert(" + string_of_percent(i) + ")"
| #none => "none"
- | #opacity(#num(i)) => "opacity(" ++ string_of_int(i) ++ ")"
- | #opacity(#percent(i)) => "opacity(" ++ string_of_percent(i) ++ ")"
- | #saturate(#num(i)) => "saturate(" ++ string_of_int(i) ++ ")"
- | #saturate(#percent(i)) => "saturate(" ++ string_of_percent(i) ++ ")"
- | #sepia(#num(i)) => "sepia(" ++ string_of_int(i) ++ ")"
- | #sepia(#percent(i)) => "sepia(" ++ string_of_percent(i) ++ ")"
+ | #opacity(#num(i)) => "opacity(" + Int.toString(i) + ")"
+ | #opacity(#percent(i)) => "opacity(" + string_of_percent(i) + ")"
+ | #saturate(#num(i)) => "saturate(" + Int.toString(i) + ")"
+ | #saturate(#percent(i)) => "saturate(" + string_of_percent(i) + ")"
+ | #sepia(#num(i)) => "sepia(" + Int.toString(i) + ")"
+ | #sepia(#percent(i)) => "sepia(" + string_of_percent(i) + ")"
}
}
@@ -1764,20 +1753,19 @@ module Gradient = {
let string_of_stops = stops =>
stops
- ->Belt.Array.map(((l, c)) => string_of_color(c) ++ " " ++ PercentageLengthCalc.toString(l))
- ->Js.Array2.joinWith(", ")
+ ->Array.map(((l, c)) => string_of_color(c) + " " + PercentageLengthCalc.toString(l))
+ ->Array.joinUnsafe(", ")
let toString = x =>
switch x {
| #linearGradient(angle, stops) =>
- "linear-gradient(" ++ Angle.toString(angle) ++ ", " ++ string_of_stops(stops) ++ ")"
+ "linear-gradient(" + Angle.toString(angle) + ", " + string_of_stops(stops) + ")"
| #repeatingLinearGradient(angle, stops) =>
- "repeating-linear-gradient(" ++ Angle.toString(angle) ++ ", " ++ string_of_stops(stops) ++ ")"
- | #radialGradient(stops) => "radial-gradient(" ++ string_of_stops(stops) ++ ")"
- | #repeatingRadialGradient(stops) =>
- "repeating-radial-gradient(" ++ string_of_stops(stops) ++ ")"
+ "repeating-linear-gradient(" + Angle.toString(angle) + ", " + string_of_stops(stops) + ")"
+ | #radialGradient(stops) => "radial-gradient(" + string_of_stops(stops) + ")"
+ | #repeatingRadialGradient(stops) => "repeating-radial-gradient(" + string_of_stops(stops) + ")"
| #conicGradient(angle, stops) =>
- "conic-gradient(from " ++ Angle.toString(angle) ++ ", " ++ string_of_stops(stops) ++ ")"
+ "conic-gradient(from " + Angle.toString(angle) + ", " + string_of_stops(stops) + ")"
}
}
@@ -1970,9 +1958,9 @@ module Counter = {
switch x {
| #counter(counter, style) =>
switch style {
- | #unset => "counter(" ++ counter ++ ")"
+ | #unset => "counter(" + counter + ")"
| #...CounterStyleType.t as t =>
- "counter(" ++ counter ++ "," ++ CounterStyleType.toString(t) ++ ")"
+ "counter(" + counter + "," + CounterStyleType.toString(t) + ")"
}
}
}
@@ -1987,9 +1975,9 @@ module Counters = {
switch x {
| #counters(name, separator, style) =>
switch style {
- | #unset => "counters(" ++ name ++ ",\"" ++ separator ++ "\")"
+ | #unset => "counters(" + name + ",\"" + separator + "\")"
| #...CounterStyleType.t as s =>
- "counters(" ++ name ++ ",\"" ++ separator ++ "\"," ++ CounterStyleType.toString(s) ++ ")"
+ "counters(" + name + ",\"" + separator + "\"," + CounterStyleType.toString(s) + ")"
}
}
}
@@ -2002,7 +1990,7 @@ module CounterIncrement = {
let toString = x =>
switch x {
| #none => "none"
- | #increment(name, value) => name ++ " " ++ string_of_int(value)
+ | #increment(name, value) => name + " " + Int.toString(value)
}
}
@@ -2014,7 +2002,7 @@ module CounterReset = {
let toString = x =>
switch x {
| #none => "none"
- | #reset(name, value) => name ++ " " ++ string_of_int(value)
+ | #reset(name, value) => name + " " + Int.toString(value)
}
}
@@ -2026,7 +2014,7 @@ module CounterSet = {
let toString = x =>
switch x {
| #none => "none"
- | #set(name, value) => name ++ " " ++ string_of_int(value)
+ | #set(name, value) => name + " " + Int.toString(value)
}
}
@@ -2050,11 +2038,11 @@ module Content = {
| #closeQuote => "close-quote"
| #noOpenQuote => "no-open-quote"
| #noCloseQuote => "no-close-quote"
- | #attr(name) => "attr(" ++ name ++ ")"
+ | #attr(name) => "attr(" + name + ")"
| #text(value) =>
- switch value->Js.String2.get(0) {
+ switch value->String.getUnsafe(0) {
| "\"" | "'" => value
- | _ => "\"" ++ value ++ "\""
+ | _ => "\"" + value + "\""
}
}
}
diff --git a/bs-css/src/Css_AtomicTypes.resi b/bs-css/src/Css_AtomicTypes.resi
index 7d773e1..89cafe0 100644
--- a/bs-css/src/Css_AtomicTypes.resi
+++ b/bs-css/src/Css_AtomicTypes.resi
@@ -896,7 +896,7 @@ module Clear: {
/**
https://developer.mozilla.org/docs/Web/CSS/float
*/
-module Float: {
+module Float_AtomicTypes: {
type t = [#left | #right | #none | #inlineStart | #inlineEnd]
let toString: t => string
diff --git a/bs-css/src/Css_Core.res b/bs-css/src/Css_Core.res
index 0f91117..1af49d6 100644
--- a/bs-css/src/Css_Core.res
+++ b/bs-css/src/Css_Core.res
@@ -2,15 +2,15 @@ module type CssImplementationIntf = {
type styleEncoding
type renderer // some implementations might need a renderer
- let injectRaw: (. string /* css */) => unit
- let renderRaw: (. renderer, string /* css */) => unit
+ let injectRaw: string /* css */ => unit
+ let renderRaw: (renderer, string /* css */) => unit
- let injectRules: (. string /* selector */, Js.Json.t) => unit
- let renderRules: (. renderer, string /* selector */, Js.Json.t) => unit
+ let injectRules: (string /* selector */, JSON.t) => unit
+ let renderRules: (renderer, string /* selector */, JSON.t) => unit
- let make: (. Js.Json.t) => styleEncoding
- let mergeStyles: (. array) => styleEncoding
+ let make: JSON.t => styleEncoding
+ let mergeStyles: array => styleEncoding
- let makeKeyframes: (. Js.Dict.t) => string /* animationName */
- let renderKeyframes: (. renderer, Js.Dict.t) => string /* animationName */
+ let makeKeyframes: dict => string /* animationName */
+ let renderKeyframes: (renderer, dict) => string /* animationName */
}
diff --git a/bs-css/src/Css_Js_Core.res b/bs-css/src/Css_Js_Core.res
index c91625d..d9677d8 100644
--- a/bs-css/src/Css_Js_Core.res
+++ b/bs-css/src/Css_Js_Core.res
@@ -7,20 +7,20 @@ type rec rule =
| PseudoClass(string, array)
| PseudoClassParam(string, string, array)
-let rec ruleToDict = (. dict, rule) => {
+let rec ruleToDict = (dict, rule) => {
switch rule {
| D(name, value) if name == "content" =>
- dict->Js.Dict.set(name, Js.Json.string(value == "" ? "\"\"" : value))
- | D(name, value) => dict->Js.Dict.set(name, Js.Json.string(value))
- | S(name, ruleset) => dict->Js.Dict.set(name, toJson(ruleset))
- | PseudoClass(name, ruleset) => dict->Js.Dict.set(":" ++ name, toJson(ruleset))
+ dict->Dict.set(name, JSON.Encode.string(value == "" ? "\"\"" : value))
+ | D(name, value) => dict->Dict.set(name, JSON.Encode.string(value))
+ | S(name, ruleset) => dict->Dict.set(name, toJson(ruleset))
+ | PseudoClass(name, ruleset) => dict->Dict.set(":" + name, toJson(ruleset))
| PseudoClassParam(name, param, ruleset) =>
- dict->Js.Dict.set(":" ++ (name ++ ("(" ++ (param ++ ")"))), toJson(ruleset))
+ dict->Dict.set(":" + name + "(" + param + ")", toJson(ruleset))
}
dict
}
-and toJson = rules => rules->Belt.Array.reduceU(Js.Dict.empty(), ruleToDict)->Js.Json.object_
+and toJson = rules => rules->Array.reduce(Dict.make(), ruleToDict)->JSON.Encode.object
type animationName = string
@@ -28,21 +28,21 @@ module type MakeResult = {
type styleEncoding
type renderer
- let insertRule: (. string) => unit
- let renderRule: (. renderer, string) => unit
+ let insertRule: string => unit
+ let renderRule: (renderer, string) => unit
- let global: (. string, array) => unit
- let renderGlobal: (. renderer, string, array) => unit
+ let global: (string, array) => unit
+ let renderGlobal: (renderer, string, array) => unit
- let style: (. array) => styleEncoding
+ let style: array => styleEncoding
- let merge: (. array) => styleEncoding
- let merge2: (. styleEncoding, styleEncoding) => styleEncoding
- let merge3: (. styleEncoding, styleEncoding, styleEncoding) => styleEncoding
- let merge4: (. styleEncoding, styleEncoding, styleEncoding, styleEncoding) => styleEncoding
+ let merge: array => styleEncoding
+ let merge2: (styleEncoding, styleEncoding) => styleEncoding
+ let merge3: (styleEncoding, styleEncoding, styleEncoding) => styleEncoding
+ let merge4: (styleEncoding, styleEncoding, styleEncoding, styleEncoding) => styleEncoding
- let keyframes: (. array<(int, array)>) => animationName
- let renderKeyframes: (. renderer, array<(int, array)>) => animationName
+ let keyframes: array<(int, array)> => animationName
+ let renderKeyframes: (renderer, array<(int, array)>) => animationName
}
module Make = (CssImpl: Css_Core.CssImplementationIntf): (
@@ -51,31 +51,31 @@ module Make = (CssImpl: Css_Core.CssImplementationIntf): (
type styleEncoding
type renderer
- let insertRule = (. css) => CssImpl.injectRaw(. css)
- let renderRule = (. renderer, css) => CssImpl.renderRaw(. renderer, css)
+ let insertRule = css => CssImpl.injectRaw(css)
+ let renderRule = (renderer, css) => CssImpl.renderRaw(renderer, css)
- let global = (. selector, rules) => CssImpl.injectRules(. selector, toJson(rules))
+ let global = (selector, rules) => CssImpl.injectRules(selector, toJson(rules))
- let renderGlobal = (. renderer, selector, rules) =>
- CssImpl.renderRules(. renderer, selector, toJson(rules))
+ let renderGlobal = (renderer, selector, rules) =>
+ CssImpl.renderRules(renderer, selector, toJson(rules))
- let style = (. rules) => CssImpl.make(. toJson(rules))
+ let style = rules => CssImpl.make(toJson(rules))
- let merge = (. styles) => CssImpl.mergeStyles(. styles)
- let merge2 = (. s, s2) => merge(. [s, s2])
- let merge3 = (. s, s2, s3) => merge(. [s, s2, s3])
- let merge4 = (. s, s2, s3, s4) => merge(. [s, s2, s3, s4])
+ let merge = styles => CssImpl.mergeStyles(styles)
+ let merge2 = (s, s2) => merge([s, s2])
+ let merge3 = (s, s2, s3) => merge([s, s2, s3])
+ let merge4 = (s, s2, s3, s4) => merge([s, s2, s3, s4])
let framesToDict = frames =>
- frames->Belt.Array.reduceU(Js.Dict.empty(), (. dict, (stop, rules)) => {
- Js.Dict.set(dict, Js.Int.toString(stop) ++ "%", toJson(rules))
+ frames->Array.reduce(Dict.make(), (dict, (stop, rules)) => {
+ Dict.set(dict, Int.toString(stop) + "%", toJson(rules))
dict
})
- let keyframes = (. frames) => CssImpl.makeKeyframes(. framesToDict(frames))
+ let keyframes = frames => CssImpl.makeKeyframes(framesToDict(frames))
- let renderKeyframes = (. renderer, frames) =>
- CssImpl.renderKeyframes(. renderer, framesToDict(frames))
+ let renderKeyframes = (renderer, frames) =>
+ CssImpl.renderKeyframes(renderer, framesToDict(frames))
}
module Calc = {
@@ -86,8 +86,8 @@ module Calc = {
}
let join = (strings, separator) =>
- strings->Belt.Array.reduceWithIndexU("", (. acc, item, index) =>
- index == 0 ? item : acc ++ (separator ++ item)
+ strings->Array.reduceWithIndex("", (acc, item, index) =>
+ index == 0 ? item : acc + separator + item
)
module Converter = {
@@ -154,7 +154,7 @@ include Converter
let important = v =>
switch v {
- | D(name, value) => D(name, value ++ " !important")
+ | D(name, value) => D(name, value + " !important")
| S(_, _)
| PseudoClass(_, _)
| PseudoClassParam(_, _, _) => v
@@ -223,7 +223,7 @@ let backfaceVisibility = x => D(
let backdropFilter = x => D(
"backdropFilter",
- x->Belt.Array.map(Types.BackdropFilter.toString)->join(", "),
+ x->Array.map(Types.BackdropFilter.toString)->join(", "),
)
let backgroundAttachment = x => D(
@@ -280,12 +280,12 @@ let string_of_background_position = x =>
switch h {
| #...BackgroundPosition.X.t as h => BackgroundPosition.X.toString(h)
| #...Length.t as l => Length.toString(l)
- } ++
- (" " ++
+ } +
+ " " +
switch v {
| #...BackgroundPosition.Y.t as v => BackgroundPosition.Y.toString(v)
| #...Length.t as l => Length.toString(l)
- })
+ }
| #...Length.t as l => Length.toString(l)
| #...Var.t as va => Var.toString(va)
| #...Cascading.t as c => Cascading.toString(c)
@@ -295,16 +295,18 @@ let backgroundPosition = x => D("backgroundPosition", string_of_background_posit
let backgroundPositions = bp => D(
"backgroundPosition",
- bp->Belt.Array.map(string_of_background_position)->join(", "),
+ bp->Array.map(string_of_background_position)->join(", "),
)
let backgroundPosition4 = (~x, ~offsetX, ~y, ~offsetY) => D(
"backgroundPosition",
- BackgroundPosition.X.toString(x) ++
- (" " ++
- (Length.toString(offsetX) ++
- (" " ++
- (BackgroundPosition.Y.toString(y) ++ (" " ++ Length.toString(offsetY)))))),
+ BackgroundPosition.X.toString(x) +
+ " " +
+ Length.toString(offsetX) +
+ " " +
+ BackgroundPosition.Y.toString(y) +
+ " " +
+ Length.toString(offsetY),
)
let backgroundRepeat = x => D(
@@ -312,7 +314,7 @@ let backgroundRepeat = x => D(
switch x {
| #...BackgroundRepeat.t as br => BackgroundRepeat.toString(br)
| #hv(#...BackgroundRepeat.horizontal as h, #...BackgroundRepeat.vertical as v) =>
- BackgroundRepeat.toString(h) ++ (" " ++ BackgroundRepeat.toString(v))
+ BackgroundRepeat.toString(h) + " " + BackgroundRepeat.toString(v)
| #...Var.t as va => Var.toString(va)
| #...Cascading.t as c => Cascading.toString(c)
},
@@ -325,12 +327,12 @@ let string_of_mask_position = x =>
switch h {
| #...MaskPosition.X.t as h => MaskPosition.X.toString(h)
| #...Length.t as l => Length.toString(l)
- } ++
- (" " ++
+ } +
+ " " +
switch v {
| #...MaskPosition.Y.t as v => MaskPosition.Y.toString(v)
| #...Length.t as l => Length.toString(l)
- })
+ }
| #...Length.t as l => Length.toString(l)
| #...Var.t as va => Var.toString(va)
| #...Cascading.t as c => Cascading.toString(c)
@@ -338,7 +340,7 @@ let string_of_mask_position = x =>
let maskPosition = x => D("maskPosition", string_of_mask_position(x))
-let maskPositions = mp => D("maskPosition", mp->Belt.Array.map(string_of_mask_position)->join(", "))
+let maskPositions = mp => D("maskPosition", mp->Array.map(string_of_mask_position)->join(", "))
let borderBottomColor = x => D("borderBottomColor", string_of_color(x))
@@ -368,11 +370,13 @@ let borderSpacing = x => D("borderSpacing", Length.toString(x))
let borderRadius = x => D("borderRadius", Length.toString(x))
let borderRadius4 = (~topLeft, ~topRight, ~bottomLeft, ~bottomRight) => D(
"borderRadius",
- Length.toString(topLeft) ++
- (" " ++
- (Length.toString(topRight) ++
- (" " ++
- (Length.toString(bottomLeft) ++ (" " ++ Length.toString(bottomRight)))))),
+ Length.toString(topLeft) +
+ " " +
+ Length.toString(topRight) +
+ " " +
+ Length.toString(bottomLeft) +
+ " " +
+ Length.toString(bottomRight),
)
let borderRightColor = x => D("borderRightColor", string_of_color(x))
@@ -440,19 +444,19 @@ let columnCount = x => D(
)
let contentRule = x => D("content", string_of_content(x))
-let contentRules = xs => D("content", xs->Belt.Array.map(string_of_content)->join(" "))
+let contentRules = xs => D("content", xs->Array.map(string_of_content)->join(" "))
let counterIncrement = x => D("counterIncrement", string_of_counter_increment(x))
let countersIncrement = xs => D(
"counterIncrement",
- xs->Belt.Array.map(string_of_counter_increment)->join(" "),
+ xs->Array.map(string_of_counter_increment)->join(" "),
)
let counterReset = x => D("counterReset", string_of_counter_reset(x))
-let countersReset = xs => D("counterReset", xs->Belt.Array.map(string_of_counter_reset)->join(" "))
+let countersReset = xs => D("counterReset", xs->Array.map(string_of_counter_reset)->join(" "))
let counterSet = x => D("counterSet", string_of_counter_set(x))
-let countersSet = xs => D("counterSet", xs->Belt.Array.map(string_of_counter_set)->join(" "))
+let countersSet = xs => D("counterSet", xs->Array.map(string_of_counter_set)->join(" "))
let cursor = x => D("cursor", Cursor.toString(x))
@@ -483,7 +487,7 @@ let flex = x => D(
"flex",
switch x {
| #...Flex.t as f => Flex.toString(f)
- | #num(n) => Js.Float.toString(n)
+ | #num(n) => Float.toString(n)
},
)
@@ -496,9 +500,9 @@ let flexDirection = x => D(
},
)
-let flexGrow = x => D("flexGrow", Js.Float.toString(x))
+let flexGrow = x => D("flexGrow", Float.toString(x))
-let flexShrink = x => D("flexShrink", Js.Float.toString(x))
+let flexShrink = x => D("flexShrink", Float.toString(x))
let flexWrap = x => D(
"flexWrap",
@@ -512,7 +516,7 @@ let flexWrap = x => D(
let float = x => D(
"float",
switch x {
- | #...Float.t as f => Float.toString(f)
+ | #...Float_AtomicTypes.t as f => Float_AtomicTypes.toString(f)
| #...Var.t as va => Var.toString(va)
| #...Cascading.t as c => Cascading.toString(c)
},
@@ -527,7 +531,7 @@ let fontFamily = x => D(
},
)
-let fontFamilies = xs => D("fontFamily", xs->Belt.Array.map(FontFamilyName.toString)->join(", "))
+let fontFamilies = xs => D("fontFamily", xs->Array.map(FontFamilyName.toString)->join(", "))
let fontSize = x => D(
"fontSize",
@@ -576,17 +580,14 @@ let gridAutoFlow = x => D(
let gridColumn = (start, end') => D(
"gridColumn",
- Js.Int.toString(start) ++ (" / " ++ Js.Int.toString(end')),
+ Int.toString(start) + (" / " + Int.toString(end')),
)
-let gridColumnStart = n => D("gridColumnStart", Js.Int.toString(n))
+let gridColumnStart = n => D("gridColumnStart", Int.toString(n))
-let gridColumnEnd = n => D("gridColumnEnd", Js.Int.toString(n))
+let gridColumnEnd = n => D("gridColumnEnd", Int.toString(n))
-let gridRow = (start, end') => D(
- "gridRow",
- Js.Int.toString(start) ++ (" / " ++ Js.Int.toString(end')),
-)
+let gridRow = (start, end') => D("gridRow", Int.toString(start) + " / " + Int.toString(end'))
let gap = x => D("gap", string_of_gap(x))
let columnGap = x => D("columnGap", string_of_gap(x))
@@ -596,14 +597,11 @@ let gridGap = x => D("gridGap", string_of_gap(x))
let gridColumnGap = x => D("gridColumnGap", string_of_gap(x))
let gridRowGap = x => D("gridRowGap", string_of_gap(x))
-let gap2 = (~rowGap, ~columnGap) => D(
- "gap",
- string_of_gap(rowGap) ++ (" " ++ string_of_gap(columnGap)),
-)
+let gap2 = (~rowGap, ~columnGap) => D("gap", string_of_gap(rowGap) + " " + string_of_gap(columnGap))
-let gridRowEnd = n => D("gridRowEnd", Js.Int.toString(n))
+let gridRowEnd = n => D("gridRowEnd", Int.toString(n))
-let gridRowStart = n => D("gridRowStart", Js.Int.toString(n))
+let gridRowStart = n => D("gridRowStart", Int.toString(n))
let height = x => D(
"height",
@@ -663,14 +661,14 @@ let lineHeight = x => D(
let listStyle = (style, position, image) => D(
"listStyle",
- ListStyleType.toString(style) ++
- (" " ++
- (ListStylePosition.toString(position) ++
- (" " ++
+ ListStyleType.toString(style) +
+ " " +
+ ListStylePosition.toString(position) +
+ " " +
switch image {
| #...ListStyleImage.t as lsi => ListStyleImage.toString(lsi)
| #...Url.t as u => Url.toString(u)
- }))),
+ },
)
let listStyleImage = x => D(
@@ -710,18 +708,20 @@ let string_of_margin = x =>
}
let margin = x => D("margin", string_of_margin(x))
-let margin2 = (~v, ~h) => D("margin", string_of_margin(v) ++ (" " ++ string_of_margin(h)))
+let margin2 = (~v, ~h) => D("margin", string_of_margin(v) + " " + string_of_margin(h))
let margin3 = (~top, ~h, ~bottom) => D(
"margin",
- string_of_margin(top) ++ (" " ++ (string_of_margin(h) ++ (" " ++ string_of_margin(bottom)))),
+ string_of_margin(top) + " " + string_of_margin(h) + " " + string_of_margin(bottom),
)
let margin4 = (~top, ~right, ~bottom, ~left) => D(
"margin",
- string_of_margin(top) ++
- (" " ++
- (string_of_margin(right) ++
- (" " ++
- (string_of_margin(bottom) ++ (" " ++ string_of_margin(left)))))),
+ string_of_margin(top) +
+ " " +
+ string_of_margin(right) +
+ " " +
+ string_of_margin(bottom) +
+ " " +
+ string_of_margin(left),
)
let marginLeft = x => D("marginLeft", string_of_margin(x))
let marginRight = x => D("marginRight", string_of_margin(x))
@@ -783,13 +783,11 @@ let objectFit = x => D(
let objectPosition = x => D("objectPosition", string_of_background_position(x))
-let opacity = x => D("opacity", Js.Float.toString(x))
+let opacity = x => D("opacity", Float.toString(x))
let outline = (size, style, color) => D(
"outline",
- Length.toString(size) ++
- (" " ++
- (OutlineStyle.toString(style) ++ (" " ++ string_of_color(color)))),
+ Length.toString(size) + " " + (OutlineStyle.toString(style) + " " + string_of_color(color)),
)
let outlineColor = x => D("outlineColor", string_of_color(x))
let outlineOffset = x => D("outlineOffset", Length.toString(x))
@@ -812,21 +810,25 @@ let overflowWrap = x => D(
let padding = x => D("padding", PercentageLengthCalc.toString(x))
let padding2 = (~v, ~h) => D(
"padding",
- PercentageLengthCalc.toString(v) ++ (" " ++ PercentageLengthCalc.toString(h)),
+ PercentageLengthCalc.toString(v) + " " + PercentageLengthCalc.toString(h),
)
let padding3 = (~top, ~h, ~bottom) => D(
"padding",
- PercentageLengthCalc.toString(top) ++
- (" " ++
- (PercentageLengthCalc.toString(h) ++ (" " ++ PercentageLengthCalc.toString(bottom)))),
+ PercentageLengthCalc.toString(top) +
+ " " +
+ PercentageLengthCalc.toString(h) +
+ " " +
+ PercentageLengthCalc.toString(bottom),
)
let padding4 = (~top, ~right, ~bottom, ~left) => D(
"padding",
- PercentageLengthCalc.toString(top) ++
- (" " ++
- (PercentageLengthCalc.toString(right) ++
- (" " ++
- (PercentageLengthCalc.toString(bottom) ++ (" " ++ PercentageLengthCalc.toString(left)))))),
+ PercentageLengthCalc.toString(top) +
+ " " +
+ PercentageLengthCalc.toString(right) +
+ " " +
+ PercentageLengthCalc.toString(bottom) +
+ " " +
+ PercentageLengthCalc.toString(left),
)
let paddingBottom = x => D("paddingBottom", PercentageLengthCalc.toString(x))
@@ -849,12 +851,12 @@ let perspectiveOrigin = (x, y) => D(
switch x {
| #...Perspective.t as p => Perspective.toString(p)
| #...Length.t as l => Length.toString(l)
- } ++
- (" " ++
+ } +
+ " " +
switch y {
| #...Perspective.t as p => Perspective.toString(p)
| #...Length.t as l => Length.toString(l)
- }),
+ },
)
let pointerEvents = x => D(
@@ -997,16 +999,13 @@ let transform = x => D(
},
)
-let transforms = x => D("transform", x->Belt.Array.map(Transform.toString)->join(" "))
+let transforms = x => D("transform", x->Array.map(Transform.toString)->join(" "))
-let transformOrigin = (x, y) => D(
- "transformOrigin",
- Length.toString(x) ++ (" " ++ Length.toString(y)),
-)
+let transformOrigin = (x, y) => D("transformOrigin", Length.toString(x) + " " + Length.toString(y))
let transformOrigin3d = (x, y, z) => D(
"transformOrigin",
- Length.toString(x) ++ (" " ++ (Length.toString(y) ++ (" " ++ (Length.toString(z) ++ " ")))),
+ Length.toString(x) + " " + Length.toString(y) + " " + (Length.toString(z) + " "),
)
let transformBox = x => D("transformBox", TransformBox.toString(x))
@@ -1128,12 +1127,12 @@ let wordSpacing = x => D(
let wordWrap = overflowWrap
-let zIndex = x => D("zIndex", Js.Int.toString(x))
+let zIndex = x => D("zIndex", Int.toString(x))
/* Selectors */
-let media = (. query, rules) => S("@media " ++ query, rules)
-let selector = (. selector, rules) => S(selector, rules)
+let media = (query, rules) => S("@media " + query, rules)
+let selector = (selector, rules) => S(selector, rules)
let pseudoClass = (selector, rules) => PseudoClass(selector, rules)
let active = rules => pseudoClass("active", rules)
@@ -1170,8 +1169,8 @@ module Nth = {
switch x {
| #odd => "odd"
| #even => "even"
- | #n(x) => Js.Int.toString(x) ++ "n"
- | #add(x, y) => Js.Int.toString(x) ++ ("n+" ++ Js.Int.toString(y))
+ | #n(x) => Int.toString(x) + "n"
+ | #add(x, y) => Int.toString(x) + ("n+" + Int.toString(y))
}
}
let nthChild = (x, rules) => PseudoClassParam("nth-child", Nth.toString(x), rules)
@@ -1192,19 +1191,19 @@ let target = rules => pseudoClass("target", rules)
let valid = rules => pseudoClass("valid", rules)
let visited = rules => pseudoClass("visited", rules)
-let after = rules => selector(. "::after", rules)
-let before = rules => selector(. "::before", rules)
-let firstLetter = rules => selector(. "::first-letter", rules)
-let firstLine = rules => selector(. "::first-line", rules)
-let selection = rules => selector(. "::selection", rules)
+let after = rules => selector("::after", rules)
+let before = rules => selector("::before", rules)
+let firstLetter = rules => selector("::first-letter", rules)
+let firstLine = rules => selector("::first-line", rules)
+let selection = rules => selector("::selection", rules)
-let child = (x, rules) => selector(. " > " ++ x, rules)
-let children = rules => selector(. " > *", rules)
-let directSibling = rules => selector(. " + ", rules)
-let placeholder = rules => selector(. "::placeholder", rules)
-let siblings = rules => selector(. " ~ ", rules)
+let child = (x, rules) => selector(" > " + x, rules)
+let children = rules => selector(" > *", rules)
+let directSibling = rules => selector(" + ", rules)
+let placeholder = rules => selector("::placeholder", rules)
+let siblings = rules => selector(" ~ ", rules)
-let anyLink = rules => selector(. ":any-link", rules)
+let anyLink = rules => selector(":any-link", rules)
/* Type aliasing */
@@ -1524,14 +1523,14 @@ let manipulation = #manipulation
let flex3 = (~grow, ~shrink, ~basis) => D(
"flex",
- Js.Float.toString(grow) ++
- (" " ++
- (Js.Float.toString(shrink) ++
- (" " ++
+ Float.toString(grow) +
+ " " +
+ Float.toString(shrink) +
+ " " +
switch basis {
| #...FlexBasis.t as b => FlexBasis.toString(b)
| #...Length.t as l => Length.toString(l)
- }))),
+ },
)
let flexBasis = x => D(
"flexBasis",
@@ -1541,7 +1540,7 @@ let flexBasis = x => D(
},
)
-let order = x => D("order", Js.Int.toString(x))
+let order = x => D("order", Int.toString(x))
type minmax = [PercentageLengthCalc.t | #minContent | #maxContent | #auto | #fr(float)]
@@ -1551,7 +1550,7 @@ let minmaxToJs = x =>
| #minContent => "min-content"
| #maxContent => "max-content"
| #auto => "auto"
- | #fr(x) => Js.Float.toString(x) ++ "fr"
+ | #fr(x) => Float.toString(x) + "fr"
}
type trackLength = [
@@ -1569,8 +1568,8 @@ let trackLengthToJs = x =>
| #auto => "auto"
| #minContent => "min-content"
| #maxContent => "max-content"
- | #fr(x) => Js.Float.toString(x) ++ "fr"
- | #minmax(a, b) => "minmax(" ++ minmaxToJs(a) ++ "," ++ minmaxToJs(b) ++ ")"
+ | #fr(x) => Float.toString(x) + "fr"
+ | #minmax(a, b) => "minmax(" + minmaxToJs(a) + "," + minmaxToJs(b) + ")"
}
type gridLength = [trackLength | #repeat(RepeatValue.t, trackLength)]
@@ -1578,22 +1577,22 @@ type gridLength = [trackLength | #repeat(RepeatValue.t, trackLength)]
let gridLengthToJs = x =>
switch x {
| #...PercentageLengthCalc.t as plc => PercentageLengthCalc.toString(plc)
- | #fr(x) => Js.Float.toString(x) ++ "fr"
+ | #fr(x) => Float.toString(x) + "fr"
| #auto => "auto"
| #minContent => "min-content"
| #maxContent => "max-content"
- | #minmax(a, b) => "minmax(" ++ minmaxToJs(a) ++ "," ++ minmaxToJs(b) ++ ")"
- | #repeat(n, x) => "repeat(" ++ RepeatValue.toString(n) ++ ", " ++ trackLengthToJs(x) ++ ")"
+ | #minmax(a, b) => "minmax(" + minmaxToJs(a) + "," + minmaxToJs(b) + ")"
+ | #repeat(n, x) => "repeat(" + RepeatValue.toString(n) + ", " + trackLengthToJs(x) + ")"
}
let gridTemplateColumns = dimensions => D(
"gridTemplateColumns",
- dimensions->Belt.Array.map(gridLengthToJs)->join(" "),
+ dimensions->Array.map(gridLengthToJs)->join(" "),
)
let gridTemplateRows = dimensions => D(
"gridTemplateRows",
- dimensions->Belt.Array.map(gridLengthToJs)->join(" "),
+ dimensions->Array.map(gridLengthToJs)->join(" "),
)
let gridAutoColumns = dimension => D("gridAutoColumns", trackLengthToJs(dimension))
@@ -1609,21 +1608,21 @@ let gridArea = s => D(
},
)
-let gridArea2 = (s, s2) => D("gridArea", GridArea.toString(s) ++ " / " ++ GridArea.toString(s2))
+let gridArea2 = (s, s2) => D("gridArea", GridArea.toString(s) + " / " + GridArea.toString(s2))
let gridArea3 = (s, s2, s3) => D(
"gridArea",
- GridArea.toString(s) ++ " / " ++ GridArea.toString(s2) ++ " / " ++ GridArea.toString(s3),
+ GridArea.toString(s) + " / " + GridArea.toString(s2) + " / " + GridArea.toString(s3),
)
let gridArea4 = (s, s2, s3, s4) => D(
"gridArea",
- GridArea.toString(s) ++
- " / " ++
- GridArea.toString(s2) ++
- " / " ++
- GridArea.toString(s3) ++
- " / " ++
+ GridArea.toString(s) +
+ " / " +
+ GridArea.toString(s2) +
+ " / " +
+ GridArea.toString(s3) +
+ " / " +
GridArea.toString(s4),
)
@@ -1655,31 +1654,31 @@ type filter = [
let string_of_filter = x =>
switch x {
- | #blur(v) => "blur(" ++ Length.toString(v) ++ ")"
- | #brightness(v) => "brightness(" ++ Js.Float.toString(v) ++ "%)"
- | #contrast(v) => "contrast(" ++ Js.Float.toString(v) ++ "%)"
+ | #blur(v) => "blur(" + Length.toString(v) + ")"
+ | #brightness(v) => "brightness(" + Float.toString(v) + "%)"
+ | #contrast(v) => "contrast(" + Float.toString(v) + "%)"
| #dropShadow(a, b, c, d) =>
- "drop-shadow(" ++
- Length.toString(a) ++
- " " ++
- Length.toString(b) ++
- " " ++
- Length.toString(c) ++
- " " ++
- Color.toString(d) ++ ")"
- | #grayscale(v) => "grayscale(" ++ Js.Float.toString(v) ++ "%)"
- | #hueRotate(v) => "hue-rotate(" ++ Angle.toString(v) ++ ")"
- | #invert(v) => "invert(" ++ Js.Float.toString(v) ++ "%)"
- | #opacity(v) => "opacity(" ++ Js.Float.toString(v) ++ "%)"
- | #saturate(v) => "saturate(" ++ Js.Float.toString(v) ++ "%)"
- | #sepia(v) => "sepia(" ++ Js.Float.toString(v) ++ "%)"
+ "drop-shadow(" +
+ Length.toString(a) +
+ " " +
+ Length.toString(b) +
+ " " +
+ Length.toString(c) +
+ " " +
+ Color.toString(d) + ")"
+ | #grayscale(v) => "grayscale(" + Float.toString(v) + "%)"
+ | #hueRotate(v) => "hue-rotate(" + Angle.toString(v) + ")"
+ | #invert(v) => "invert(" + Float.toString(v) + "%)"
+ | #opacity(v) => "opacity(" + Float.toString(v) + "%)"
+ | #saturate(v) => "saturate(" + Float.toString(v) + "%)"
+ | #sepia(v) => "sepia(" + Float.toString(v) + "%)"
| #none => "none"
| #...Url.t as u => Url.toString(u)
| #...Var.t as va => Var.toString(va)
| #...Cascading.t as c => Cascading.toString(c)
}
-let filter = x => D("filter", x->Belt.Array.map(string_of_filter)->join(" "))
+let filter = x => D("filter", x->Array.map(string_of_filter)->join(" "))
module Shadow = {
type value<'a> = string
@@ -1689,25 +1688,25 @@ module Shadow = {
let box = (~x=zero, ~y=zero, ~blur=zero, ~spread=zero, ~inset=false, color) =>
#shadow(
- Length.toString(x) ++
- " " ++
- Length.toString(y) ++
- " " ++
- Length.toString(blur) ++
- " " ++
- Length.toString(spread) ++
- " " ++
- string_of_color(color) ++ (inset ? " inset" : ""),
+ Length.toString(x) +
+ " " +
+ Length.toString(y) +
+ " " +
+ Length.toString(blur) +
+ " " +
+ Length.toString(spread) +
+ " " +
+ string_of_color(color) + (inset ? " inset" : ""),
)
let text = (~x=zero, ~y=zero, ~blur=zero, color) =>
#shadow(
- Length.toString(x) ++
- " " ++
- Length.toString(y) ++
- " " ++
- Length.toString(blur) ++
- " " ++
+ Length.toString(x) +
+ " " +
+ Length.toString(y) +
+ " " +
+ Length.toString(blur) +
+ " " +
string_of_color(color),
)
@@ -1727,7 +1726,7 @@ let boxShadow = x => D(
},
)
-let boxShadows = x => D("boxShadow", x->Belt.Array.map(Shadow.toString)->join(", "))
+let boxShadows = x => D("boxShadow", x->Array.map(Shadow.toString)->join(", "))
let string_of_border_style = x =>
switch x {
@@ -1738,32 +1737,32 @@ let string_of_border_style = x =>
let border = (px, style, color) => D(
"border",
- Length.toString(px) ++ " " ++ string_of_border_style(style) ++ " " ++ string_of_color(color),
+ Length.toString(px) + " " + string_of_border_style(style) + " " + string_of_color(color),
)
let borderStyle = x => D("borderStyle", string_of_border_style(x))
let borderLeft = (px, style, color) => D(
"borderLeft",
- Length.toString(px) ++ " " ++ string_of_border_style(style) ++ " " ++ string_of_color(color),
+ Length.toString(px) + " " + string_of_border_style(style) + " " + string_of_color(color),
)
let borderLeftStyle = x => D("borderLeftStyle", string_of_border_style(x))
let borderRight = (px, style, color) => D(
"borderRight",
- Length.toString(px) ++ " " ++ string_of_border_style(style) ++ " " ++ string_of_color(color),
+ Length.toString(px) + " " + string_of_border_style(style) + " " + string_of_color(color),
)
let borderRightStyle = x => D("borderRightStyle", string_of_border_style(x))
let borderTop = (px, style, color) => D(
"borderTop",
- Length.toString(px) ++ " " ++ string_of_border_style(style) ++ " " ++ string_of_color(color),
+ Length.toString(px) + " " + string_of_border_style(style) + " " + string_of_color(color),
)
let borderTopStyle = x => D("borderTopStyle", string_of_border_style(x))
let borderBottom = (px, style, color) => D(
"borderBottom",
- Length.toString(px) ++ " " ++ string_of_border_style(style) ++ " " ++ string_of_color(color),
+ Length.toString(px) + " " + string_of_border_style(style) + " " + string_of_color(color),
)
let borderBottomStyle = x => D("borderBottomStyle", string_of_border_style(x))
@@ -1781,7 +1780,7 @@ let background = x => D(
let backgrounds = x => D(
"background",
x
- ->Belt.Array.map(item =>
+ ->Array.map(item =>
switch item {
| #...Color.t as c => Color.toString(c)
| #...Url.t as u => Url.toString(u)
@@ -1795,7 +1794,7 @@ let backgrounds = x => D(
let backgroundSize = x => D(
"backgroundSize",
switch x {
- | #size(x, y) => Length.toString(x) ++ " " ++ Length.toString(y)
+ | #size(x, y) => Length.toString(x) + " " + Length.toString(y)
| #auto => "auto"
| #cover => "cover"
| #contain => "contain"
@@ -1811,11 +1810,11 @@ let fontFace = (
~sizeAdjust=?,
(),
) => {
- let fontStyle = Js.Option.map((. value) => FontStyle.toString(value), fontStyle)
+ let fontStyle = fontStyle->Option.map(value => FontStyle.toString(value))
let src =
src
- ->Belt.Array.map(x =>
+ ->Array.map(x =>
switch x {
| #localUrl(value) => `local("${value}")`
| #url(value) => `url("${value}")`
@@ -1823,20 +1822,20 @@ let fontFace = (
)
->join(", ")
- let fontStyle = Belt.Option.mapWithDefault(fontStyle, "", s => "font-style: " ++ s ++ ";")
- let fontWeight = Belt.Option.mapWithDefault(fontWeight, "", w =>
- "font-weight: " ++
+ let fontStyle = Option.mapOr(fontStyle, "", s => "font-style: " + s + ";")
+ let fontWeight = Option.mapOr(fontWeight, "", w =>
+ "font-weight: " +
switch w {
| #...FontWeight.t as f => FontWeight.toString(f)
| #...Var.t as va => Var.toString(va)
| #...Cascading.t as c => Cascading.toString(c)
- } ++ ";"
+ } + ";"
)
- let fontDisplay = Belt.Option.mapWithDefault(fontDisplay, "", f =>
- "font-display: " ++ FontDisplay.toString(f) ++ ";"
+ let fontDisplay = Option.mapOr(fontDisplay, "", f =>
+ "font-display: " + FontDisplay.toString(f) + ";"
)
- let sizeAdjust = Belt.Option.mapWithDefault(sizeAdjust, "", s =>
- "size-adjust: " ++ Types.Percentage.toString(s) ++ ";"
+ let sizeAdjust = Option.mapOr(sizeAdjust, "", s =>
+ "size-adjust: " + Types.Percentage.toString(s) + ";"
)
`@font-face {
@@ -1872,7 +1871,7 @@ let textShadow = x => D(
},
)
-let textShadows = x => D("textShadow", x->Belt.Array.map(Shadow.toString)->join(", "))
+let textShadows = x => D("textShadow", x->Array.map(Shadow.toString)->join(", "))
let transformStyle = x => D(
"transformStyle",
@@ -1891,12 +1890,12 @@ module Transition = {
let shorthand = (~duration=#ms(0.), ~delay=#ms(0.), ~timingFunction=#ease, property) =>
#value(
- string_of_time(duration) ++
- " " ++
- TimingFunction.toString(timingFunction) ++
- " " ++
- string_of_time(delay) ++
- " " ++
+ string_of_time(duration) +
+ " " +
+ TimingFunction.toString(timingFunction) +
+ " " +
+ string_of_time(delay) +
+ " " +
property,
)
@@ -1908,7 +1907,7 @@ module Transition = {
let transitionValue = x => D("transition", Transition.toString(x))
-let transitionList = x => D("transition", x->Belt.Array.map(Transition.toString)->join(", "))
+let transitionList = x => D("transition", x->Array.map(Transition.toString)->join(", "))
let transitions = transitionList
let transition = (~duration=?, ~delay=?, ~timingFunction=?, property) =>
@@ -1939,20 +1938,20 @@ module Animation = {
name,
) =>
#value(
- name ++
- " " ++
- string_of_time(duration) ++
- " " ++
- TimingFunction.toString(timingFunction) ++
- " " ++
- string_of_time(delay) ++
- " " ++
- AnimationIterationCount.toString(iterationCount) ++
- " " ++
- AnimationDirection.toString(direction) ++
- " " ++
- AnimationFillMode.toString(fillMode) ++
- " " ++
+ name +
+ " " +
+ string_of_time(duration) +
+ " " +
+ TimingFunction.toString(timingFunction) +
+ " " +
+ string_of_time(delay) +
+ " " +
+ AnimationIterationCount.toString(iterationCount) +
+ " " +
+ AnimationDirection.toString(direction) +
+ " " +
+ AnimationFillMode.toString(fillMode) +
+ " " +
AnimationPlayState.toString(playState),
)
@@ -1987,14 +1986,13 @@ let animation = (
),
)
-let animations = x => D("animation", x->Belt.Array.map(Animation.toString)->join(", "))
+let animations = x => D("animation", x->Array.map(Animation.toString)->join(", "))
let animationName = x => D("animationName", x)
/**
* SVG
*/
-
module SVG = {
let fill = x => D(
"fill",
@@ -2005,7 +2003,7 @@ module SVG = {
| #...Types.Url.t as u => Types.Url.toString(u)
},
)
- let fillOpacity = opacity => D("fillOpacity", Js.Float.toString(opacity))
+ let fillOpacity = opacity => D("fillOpacity", Float.toString(opacity))
let fillRule = x => D(
"fillRule",
switch x {
@@ -2018,12 +2016,12 @@ module SVG = {
"strokeDasharray",
switch x {
| #none => "none"
- | #dasharray(a) => a->Belt.Array.map(string_of_dasharray)->join(" ")
+ | #dasharray(a) => a->Array.map(string_of_dasharray)->join(" ")
},
)
let strokeWidth = x => D("strokeWidth", Length.toString(x))
- let strokeOpacity = opacity => D("strokeOpacity", Js.Float.toString(opacity))
- let strokeMiterlimit = x => D("strokeMiterlimit", Js.Float.toString(x))
+ let strokeOpacity = opacity => D("strokeOpacity", Float.toString(opacity))
+ let strokeMiterlimit = x => D("strokeMiterlimit", Float.toString(x))
let strokeLinecap = x => D(
"strokeLinecap",
switch x {
@@ -2042,7 +2040,7 @@ module SVG = {
},
)
let stopColor = x => D("stopColor", string_of_color(x))
- let stopOpacity = x => D("stopOpacity", Js.Float.toString(x))
+ let stopOpacity = x => D("stopOpacity", Float.toString(x))
}
let touchAction = x => D("touchAction", x->TouchAction.toString)
diff --git a/bs-css/src/Css_Js_Core.resi b/bs-css/src/Css_Js_Core.resi
index 604ad9d..e4476e6 100644
--- a/bs-css/src/Css_Js_Core.resi
+++ b/bs-css/src/Css_Js_Core.resi
@@ -9,27 +9,27 @@ module type MakeResult = {
type styleEncoding
type renderer
- let insertRule: (. string) => unit
- let renderRule: (. renderer, string) => unit
+ let insertRule: string => unit
+ let renderRule: (renderer, string) => unit
- let global: (. string, array) => unit
- let renderGlobal: (. renderer, string, array) => unit
+ let global: (string, array) => unit
+ let renderGlobal: (renderer, string, array) => unit
- let style: (. array) => styleEncoding
+ let style: array => styleEncoding
- let merge: (. array) => styleEncoding
- let merge2: (. styleEncoding, styleEncoding) => styleEncoding
- let merge3: (. styleEncoding, styleEncoding, styleEncoding) => styleEncoding
- let merge4: (. styleEncoding, styleEncoding, styleEncoding, styleEncoding) => styleEncoding
+ let merge: array => styleEncoding
+ let merge2: (styleEncoding, styleEncoding) => styleEncoding
+ let merge3: (styleEncoding, styleEncoding, styleEncoding) => styleEncoding
+ let merge4: (styleEncoding, styleEncoding, styleEncoding, styleEncoding) => styleEncoding
- let keyframes: (. array<(int, array)>) => animationName
- let renderKeyframes: (. renderer, array<(int, array)>) => animationName
+ let keyframes: array<(int, array)> => animationName
+ let renderKeyframes: (renderer, array<(int, array)>) => animationName
}
module Make: (C: Css_Core.CssImplementationIntf) =>
(MakeResult with type styleEncoding := C.styleEncoding and type renderer := C.renderer)
-let toJson: array => Js.Json.t
+let toJson: array => JSON.t
let important: rule => rule
let label: string => rule
@@ -454,7 +454,7 @@ let flexWrap: [< Types.FlexWrap.t | Types.Var.t | Types.Cascading.t] => rule
The element is removed from the normal flow of the page, though still remaining a part of the flow
(in contrast to absolute positioning).
*/
-let float: [< Types.Float.t | Types.Var.t | Types.Cascading.t] => rule
+let float: [< Types.Float_AtomicTypes.t | Types.Var.t | Types.Cascading.t] => rule
/**
The font-family CSS property specifies a prioritized list of one or more font family names and/or generic family names
@@ -1095,8 +1095,8 @@ let zIndex: int => rule
selectors
********* */
-let selector: (. string, array) => rule
-let media: (. string, array) => rule
+let selector: (string, array) => rule
+let media: (string, array) => rule
/*
Pseudo-classes selectors
@@ -1385,7 +1385,6 @@ let selection: array => rule
/**
Combinators selectors
*/
-
/**
The > combinator selects nodes that are direct children of the first element.
*/
@@ -1829,7 +1828,6 @@ let fontFace: (
/**
* Transition
*/
-
module Transition: {
type t = [#value(string)]
@@ -1857,7 +1855,6 @@ let transitions: array<[Transition.t]> => rule
/**
* Animation
*/
-
module Animation: {
type t = [#value(string)]
diff --git a/bs-css/src/Css_Legacy_Core.res b/bs-css/src/Css_Legacy_Core.res
index a8102f4..0a0354c 100644
--- a/bs-css/src/Css_Legacy_Core.res
+++ b/bs-css/src/Css_Legacy_Core.res
@@ -10,20 +10,20 @@ type rec rule =
let rec ruleToDict = (dict, rule) => {
switch rule {
| D(name, value) if name == "content" =>
- dict->Js.Dict.set(name, Js.Json.string(value == "" ? "\"\"" : value))
- | D(name, value) => dict->Js.Dict.set(name, Js.Json.string(value))
- | S(name, ruleset) => dict->Js.Dict.set(name, toJson(ruleset))
- | PseudoClass(name, ruleset) => dict->Js.Dict.set(":" ++ name, toJson(ruleset))
+ dict->Dict.set(name, JSON.Encode.string(value == "" ? "\"\"" : value))
+ | D(name, value) => dict->Dict.set(name, JSON.Encode.string(value))
+ | S(name, ruleset) => dict->Dict.set(name, toJson(ruleset))
+ | PseudoClass(name, ruleset) => dict->Dict.set(":" + name, toJson(ruleset))
| PseudoClassParam(name, param, ruleset) =>
- dict->Js.Dict.set(":" ++ (name ++ ("(" ++ (param ++ ")"))), toJson(ruleset))
+ dict->Dict.set(":" + name + "(" + param + ")", toJson(ruleset))
}
dict
}
-and toJson = rules => rules->Belt.List.reduce(Js.Dict.empty(), ruleToDict)->Js.Json.object_
+and toJson = rules => rules->List.reduce(Dict.make(), ruleToDict)->JSON.Encode.object
let addStop = (dict, (stop, rules)) => {
- Js.Dict.set(dict, Js.Int.toString(stop) ++ "%", toJson(rules))
+ Dict.set(dict, Int.toString(stop) + "%", toJson(rules))
dict
}
@@ -37,7 +37,7 @@ module type MakeResult = {
let renderRule: (renderer, string) => unit
let global: (string, list) => unit
- let renderGlobal: (. renderer, string, list) => unit
+ let renderGlobal: (renderer, string, list) => unit
let style: list => styleEncoding
@@ -56,24 +56,23 @@ module Make = (CssImpl: Css_Core.CssImplementationIntf): (
type styleEncoding
type renderer
- let insertRule = css => CssImpl.injectRaw(. css)
- let renderRule = (renderer, css) => CssImpl.renderRaw(. renderer, css)
+ let insertRule = css => CssImpl.injectRaw(css)
+ let renderRule = (renderer, css) => CssImpl.renderRaw(renderer, css)
- let global = (selector, rules) => CssImpl.injectRules(. selector, toJson(rules))
- let renderGlobal = (. renderer, selector, rules) =>
- CssImpl.renderRules(. renderer, selector, toJson(rules))
+ let global = (selector, rules) => CssImpl.injectRules(selector, toJson(rules))
+ let renderGlobal = (renderer, selector, rules) =>
+ CssImpl.renderRules(renderer, selector, toJson(rules))
- let style = rules => CssImpl.make(. rules->toJson)
+ let style = rules => CssImpl.make(rules->toJson)
- let merge = styles => CssImpl.mergeStyles(. styles->Belt.List.toArray)
+ let merge = styles => CssImpl.mergeStyles(styles->List.toArray)
let merge2 = (s, s2) => merge(list{s, s2})
let merge3 = (s, s2, s3) => merge(list{s, s2, s3})
let merge4 = (s, s2, s3, s4) => merge(list{s, s2, s3, s4})
- let keyframes = frames =>
- CssImpl.makeKeyframes(. frames->Belt.List.reduce(Js.Dict.empty(), addStop))
+ let keyframes = frames => CssImpl.makeKeyframes(frames->List.reduce(Dict.make(), addStop))
let renderKeyframes = (renderer, frames) =>
- CssImpl.renderKeyframes(. renderer, frames->Belt.List.reduce(Js.Dict.empty(), addStop))
+ CssImpl.renderKeyframes(renderer, frames->List.reduce(Dict.make(), addStop))
}
module Calc = {
@@ -84,18 +83,18 @@ module Calc = {
}
let join = (strings, separator) => {
- let rec run = (strings, acc) =>
+ let rec run: (list, string) => string = (strings, acc) =>
switch strings {
| list{} => acc
- | list{x} => acc ++ x
- | list{x, ...xs} => run(xs, acc ++ (x ++ separator))
+ | list{x} => acc + x
+ | list{x, ...xs} => run(xs, acc + (x + separator))
}
run(strings, "")
}
module Converter = {
let string_of_stops = stops =>
- stops->Belt.List.map(((l, c)) => Color.toString(c) ++ (" " ++ Length.toString(l)))->join(", ")
+ stops->List.map(((l, c)) => Color.toString(c) + " " + Length.toString(l))->join(", ")
let string_of_time = t => Time.toString(t)
@@ -160,7 +159,7 @@ include Converter
let important = v =>
switch v {
- | D(name, value) => D(name, value ++ " !important")
+ | D(name, value) => D(name, value + " !important")
| S(_, _)
| PseudoClass(_, _)
| PseudoClassParam(_, _, _) => v
@@ -229,7 +228,7 @@ let backfaceVisibility = x => D(
let backdropFilter = x => D(
"backdropFilter",
- x->Belt.List.map(Types.BackdropFilter.toString)->join(", "),
+ x->List.map(Types.BackdropFilter.toString)->join(", "),
)
let backgroundAttachment = x => D(
@@ -286,12 +285,12 @@ let string_of_background_position = x =>
switch h {
| #...BackgroundPosition.X.t as h => BackgroundPosition.X.toString(h)
| #...Length.t as l => Length.toString(l)
- } ++
- (" " ++
+ } +
+ " " +
switch v {
| #...BackgroundPosition.Y.t as v => BackgroundPosition.Y.toString(v)
| #...Length.t as l => Length.toString(l)
- })
+ }
| #...Length.t as l => Length.toString(l)
| #...Var.t as va => Var.toString(va)
| #...Cascading.t as c => Cascading.toString(c)
@@ -301,16 +300,18 @@ let backgroundPosition = x => D("backgroundPosition", string_of_background_posit
let backgroundPositions = bp => D(
"backgroundPosition",
- bp->Belt.List.map(string_of_background_position)->join(", "),
+ bp->List.map(string_of_background_position)->join(", "),
)
let backgroundPosition4 = (~x, ~offsetX, ~y, ~offsetY) => D(
"backgroundPosition",
- BackgroundPosition.X.toString(x) ++
- (" " ++
- (Length.toString(offsetX) ++
- (" " ++
- (BackgroundPosition.Y.toString(y) ++ (" " ++ Length.toString(offsetY)))))),
+ BackgroundPosition.X.toString(x) +
+ " " +
+ Length.toString(offsetX) +
+ " " +
+ BackgroundPosition.Y.toString(y) +
+ " " +
+ Length.toString(offsetY),
)
let backgroundRepeat = x => D(
@@ -318,7 +319,7 @@ let backgroundRepeat = x => D(
switch x {
| #...BackgroundRepeat.t as br => BackgroundRepeat.toString(br)
| #hv(#...BackgroundRepeat.horizontal as h, #...BackgroundRepeat.vertical as v) =>
- BackgroundRepeat.toString(h) ++ (" " ++ BackgroundRepeat.toString(v))
+ BackgroundRepeat.toString(h) + " " + BackgroundRepeat.toString(v)
| #...Var.t as va => Var.toString(va)
| #...Cascading.t as c => Cascading.toString(c)
},
@@ -331,12 +332,12 @@ let string_of_mask_position = x =>
switch h {
| #...MaskPosition.X.t as h => MaskPosition.X.toString(h)
| #...Length.t as l => Length.toString(l)
- } ++
- (" " ++
+ } +
+ " " +
switch v {
| #...MaskPosition.Y.t as v => MaskPosition.Y.toString(v)
| #...Length.t as l => Length.toString(l)
- })
+ }
| #...Length.t as l => Length.toString(l)
| #...Var.t as va => Var.toString(va)
| #...Cascading.t as c => Cascading.toString(c)
@@ -344,7 +345,7 @@ let string_of_mask_position = x =>
let maskPosition = x => D("maskPosition", string_of_mask_position(x))
-let maskPositions = mp => D("maskPosition", mp->Belt.List.map(string_of_mask_position)->join(", "))
+let maskPositions = mp => D("maskPosition", mp->List.map(string_of_mask_position)->join(", "))
let borderBottomColor = x => D("borderBottomColor", string_of_color(x))
@@ -438,19 +439,19 @@ let columnCount = x => D(
)
let contentRule = x => D("content", string_of_content(x))
-let contentRules = xs => D("content", xs->Belt.List.map(string_of_content)->join(" "))
+let contentRules = xs => D("content", xs->List.map(string_of_content)->join(" "))
let counterIncrement = x => D("counterIncrement", string_of_counter_increment(x))
let countersIncrement = xs => D(
"counterIncrement",
- xs->Belt.List.map(string_of_counter_increment)->join(" "),
+ xs->List.map(string_of_counter_increment)->join(" "),
)
let counterReset = x => D("counterReset", string_of_counter_reset(x))
-let countersReset = xs => D("counterReset", xs->Belt.List.map(string_of_counter_reset)->join(" "))
+let countersReset = xs => D("counterReset", xs->List.map(string_of_counter_reset)->join(" "))
let counterSet = x => D("counterSet", string_of_counter_set(x))
-let countersSet = xs => D("counterSet", xs->Belt.List.map(string_of_counter_set)->join(" "))
+let countersSet = xs => D("counterSet", xs->List.map(string_of_counter_set)->join(" "))
let cursor = x => D("cursor", Cursor.toString(x))
@@ -481,7 +482,7 @@ let flex = x => D(
"flex",
switch x {
| #...Flex.t as f => Flex.toString(f)
- | #num(n) => Js.Float.toString(n)
+ | #num(n) => Float.toString(n)
},
)
@@ -494,9 +495,9 @@ let flexDirection = x => D(
},
)
-let flexGrow = x => D("flexGrow", Js.Float.toString(x))
+let flexGrow = x => D("flexGrow", Float.toString(x))
-let flexShrink = x => D("flexShrink", Js.Float.toString(x))
+let flexShrink = x => D("flexShrink", Float.toString(x))
let flexWrap = x => D(
"flexWrap",
@@ -510,7 +511,7 @@ let flexWrap = x => D(
let float = x => D(
"float",
switch x {
- | #...Float.t as f => Float.toString(f)
+ | #...Float_AtomicTypes.t as f => Float_AtomicTypes.toString(f)
| #...Var.t as va => Var.toString(va)
| #...Cascading.t as c => Cascading.toString(c)
},
@@ -525,7 +526,7 @@ let fontFamily = x => D(
},
)
-let fontFamilies = xs => D("fontFamily", xs->Belt.List.map(FontFamilyName.toString)->join(", "))
+let fontFamilies = xs => D("fontFamily", xs->List.map(FontFamilyName.toString)->join(", "))
let fontSize = x => D(
"fontSize",
@@ -572,19 +573,13 @@ let gridAutoFlow = x => D(
},
)
-let gridColumn = (start, end') => D(
- "gridColumn",
- Js.Int.toString(start) ++ (" / " ++ Js.Int.toString(end')),
-)
+let gridColumn = (start, end') => D("gridColumn", Int.toString(start) + " / " + Int.toString(end'))
-let gridColumnStart = n => D("gridColumnStart", Js.Int.toString(n))
+let gridColumnStart = n => D("gridColumnStart", Int.toString(n))
-let gridColumnEnd = n => D("gridColumnEnd", Js.Int.toString(n))
+let gridColumnEnd = n => D("gridColumnEnd", Int.toString(n))
-let gridRow = (start, end') => D(
- "gridRow",
- Js.Int.toString(start) ++ (" / " ++ Js.Int.toString(end')),
-)
+let gridRow = (start, end') => D("gridRow", Int.toString(start) + " / " + Int.toString(end'))
let gap = x => D("gap", string_of_gap(x))
let columnGap = x => D("columnGap", string_of_gap(x))
@@ -594,14 +589,11 @@ let gridGap = x => D("gridGap", string_of_gap(x))
let gridColumnGap = x => D("gridColumnGap", string_of_gap(x))
let gridRowGap = x => D("gridRowGap", string_of_gap(x))
-let gap2 = (~rowGap, ~columnGap) => D(
- "gap",
- string_of_gap(rowGap) ++ (" " ++ string_of_gap(columnGap)),
-)
+let gap2 = (~rowGap, ~columnGap) => D("gap", string_of_gap(rowGap) + " " + string_of_gap(columnGap))
-let gridRowEnd = n => D("gridRowEnd", Js.Int.toString(n))
+let gridRowEnd = n => D("gridRowEnd", Int.toString(n))
-let gridRowStart = n => D("gridRowStart", Js.Int.toString(n))
+let gridRowStart = n => D("gridRowStart", Int.toString(n))
let height = x => D(
"height",
@@ -661,14 +653,14 @@ let lineHeight = x => D(
let listStyle = (style, position, image) => D(
"listStyle",
- ListStyleType.toString(style) ++
- (" " ++
- (ListStylePosition.toString(position) ++
- (" " ++
+ ListStyleType.toString(style) +
+ " " +
+ ListStylePosition.toString(position) +
+ " " +
switch image {
| #...ListStyleImage.t as lsi => ListStyleImage.toString(lsi)
| #...Url.t as u => Url.toString(u)
- }))),
+ },
)
let listStyleImage = x => D(
@@ -708,18 +700,20 @@ let string_of_margin = x =>
}
let margin = x => D("margin", string_of_margin(x))
-let margin2 = (~v, ~h) => D("margin", string_of_margin(v) ++ (" " ++ string_of_margin(h)))
+let margin2 = (~v, ~h) => D("margin", string_of_margin(v) + " " + string_of_margin(h))
let margin3 = (~top, ~h, ~bottom) => D(
"margin",
- string_of_margin(top) ++ (" " ++ (string_of_margin(h) ++ (" " ++ string_of_margin(bottom)))),
+ string_of_margin(top) + " " + string_of_margin(h) + " " + string_of_margin(bottom),
)
let margin4 = (~top, ~right, ~bottom, ~left) => D(
"margin",
- string_of_margin(top) ++
- (" " ++
- (string_of_margin(right) ++
- (" " ++
- (string_of_margin(bottom) ++ (" " ++ string_of_margin(left)))))),
+ string_of_margin(top) +
+ " " +
+ string_of_margin(right) +
+ " " +
+ string_of_margin(bottom) +
+ " " +
+ string_of_margin(left),
)
let marginLeft = x => D("marginLeft", string_of_margin(x))
let marginRight = x => D("marginRight", string_of_margin(x))
@@ -781,13 +775,11 @@ let objectFit = x => D(
let objectPosition = x => D("objectPosition", string_of_background_position(x))
-let opacity = x => D("opacity", Js.Float.toString(x))
+let opacity = x => D("opacity", Float.toString(x))
let outline = (size, style, color) => D(
"outline",
- Length.toString(size) ++
- (" " ++
- (OutlineStyle.toString(style) ++ (" " ++ string_of_color(color)))),
+ Length.toString(size) + " " + OutlineStyle.toString(style) + " " + string_of_color(color),
)
let outlineColor = x => D("outlineColor", string_of_color(x))
let outlineOffset = x => D("outlineOffset", Length.toString(x))
@@ -810,21 +802,25 @@ let overflowWrap = x => D(
let padding = x => D("padding", PercentageLengthCalc.toString(x))
let padding2 = (~v, ~h) => D(
"padding",
- PercentageLengthCalc.toString(v) ++ (" " ++ PercentageLengthCalc.toString(h)),
+ PercentageLengthCalc.toString(v) + " " + PercentageLengthCalc.toString(h),
)
let padding3 = (~top, ~h, ~bottom) => D(
"padding",
- PercentageLengthCalc.toString(top) ++
- (" " ++
- (PercentageLengthCalc.toString(h) ++ (" " ++ PercentageLengthCalc.toString(bottom)))),
+ PercentageLengthCalc.toString(top) +
+ " " +
+ PercentageLengthCalc.toString(h) +
+ " " +
+ PercentageLengthCalc.toString(bottom),
)
let padding4 = (~top, ~right, ~bottom, ~left) => D(
"padding",
- PercentageLengthCalc.toString(top) ++
- (" " ++
- (PercentageLengthCalc.toString(right) ++
- (" " ++
- (PercentageLengthCalc.toString(bottom) ++ (" " ++ PercentageLengthCalc.toString(left)))))),
+ PercentageLengthCalc.toString(top) +
+ " " +
+ PercentageLengthCalc.toString(right) +
+ " " +
+ PercentageLengthCalc.toString(bottom) +
+ " " +
+ PercentageLengthCalc.toString(left),
)
let paddingBottom = x => D("paddingBottom", PercentageLengthCalc.toString(x))
@@ -847,12 +843,12 @@ let perspectiveOrigin = (x, y) => D(
switch x {
| #...Perspective.t as p => Perspective.toString(p)
| #...Length.t as l => Length.toString(l)
- } ++
- (" " ++
+ } +
+ " " +
switch y {
| #...Perspective.t as p => Perspective.toString(p)
| #...Length.t as l => Length.toString(l)
- }),
+ },
)
let pointerEvents = x => D(
@@ -995,16 +991,13 @@ let transform = x => D(
},
)
-let transforms = x => D("transform", x->Belt.List.map(Transform.toString)->join(" "))
+let transforms = x => D("transform", x->List.map(Transform.toString)->join(" "))
-let transformOrigin = (x, y) => D(
- "transformOrigin",
- Length.toString(x) ++ (" " ++ Length.toString(y)),
-)
+let transformOrigin = (x, y) => D("transformOrigin", Length.toString(x) + " " + Length.toString(y))
let transformOrigin3d = (x, y, z) => D(
"transformOrigin",
- Length.toString(x) ++ (" " ++ (Length.toString(y) ++ (" " ++ (Length.toString(z) ++ " ")))),
+ Length.toString(x) + " " + Length.toString(y) + " " + Length.toString(z) + " ",
)
let transformBox = x => D("transformBox", TransformBox.toString(x))
@@ -1126,11 +1119,11 @@ let wordSpacing = x => D(
let wordWrap = overflowWrap
-let zIndex = x => D("zIndex", Js.Int.toString(x))
+let zIndex = x => D("zIndex", Int.toString(x))
/* Selectors */
-let media = (query, rules) => S("@media " ++ query, rules)
+let media = (query, rules) => S("@media " + query, rules)
let selector = (selector, rules) => S(selector, rules)
let pseudoClass = (selector, rules) => PseudoClass(selector, rules)
@@ -1168,8 +1161,8 @@ module Nth = {
switch x {
| #odd => "odd"
| #even => "even"
- | #n(x) => Js.Int.toString(x) ++ "n"
- | #add(x, y) => Js.Int.toString(x) ++ ("n+" ++ Js.Int.toString(y))
+ | #n(x) => Int.toString(x) + "n"
+ | #add(x, y) => Int.toString(x) + ("n+" + Int.toString(y))
}
}
let nthChild = (x, rules) => PseudoClassParam("nth-child", Nth.toString(x), rules)
@@ -1196,7 +1189,7 @@ let firstLetter = rules => selector("::first-letter", rules)
let firstLine = rules => selector("::first-line", rules)
let selection = rules => selector("::selection", rules)
-let child = (x, rules) => selector(" > " ++ x, rules)
+let child = (x, rules) => selector(" > " + x, rules)
let children = rules => selector(" > *", rules)
let directSibling = rules => selector(" + ", rules)
let placeholder = rules => selector("::placeholder", rules)
@@ -1347,7 +1340,7 @@ let radialGradient = Gradient.radialGradient
let repeatingRadialGradient = Gradient.repeatingRadialGradient
let conicGradient = Gradient.conicGradient
-let areas = items => GridTemplateAreas.areas(Belt.List.toArray(items))
+let areas = items => GridTemplateAreas.areas(List.toArray(items))
let ident = GridArea.ident
let numIdent = GridArea.numIdent
@@ -1522,14 +1515,14 @@ let manipulation = #manipulation
let flex3 = (~grow, ~shrink, ~basis) => D(
"flex",
- Js.Float.toString(grow) ++
- (" " ++
- (Js.Float.toString(shrink) ++
- (" " ++
+ Float.toString(grow) +
+ " " +
+ Float.toString(shrink) +
+ " " +
switch basis {
| #...FlexBasis.t as b => FlexBasis.toString(b)
| #...Length.t as l => Length.toString(l)
- }))),
+ },
)
let flexBasis = x => D(
"flexBasis",
@@ -1539,7 +1532,7 @@ let flexBasis = x => D(
},
)
-let order = x => D("order", Js.Int.toString(x))
+let order = x => D("order", Int.toString(x))
type minmax = [PercentageLengthCalc.t | #minContent | #maxContent | #auto | #fr(float)]
@@ -1549,7 +1542,7 @@ let minmaxToJs = x =>
| #minContent => "min-content"
| #maxContent => "max-content"
| #auto => "auto"
- | #fr(x) => Js.Float.toString(x) ++ "fr"
+ | #fr(x) => Float.toString(x) + "fr"
}
type trackLength = [
@@ -1567,8 +1560,8 @@ let trackLengthToJs = x =>
| #auto => "auto"
| #minContent => "min-content"
| #maxContent => "max-content"
- | #fr(x) => Js.Float.toString(x) ++ "fr"
- | #minmax(a, b) => "minmax(" ++ minmaxToJs(a) ++ "," ++ minmaxToJs(b) ++ ")"
+ | #fr(x) => Float.toString(x) + "fr"
+ | #minmax(a, b) => "minmax(" + minmaxToJs(a) + "," + minmaxToJs(b) + ")"
}
type gridLength = [trackLength | #repeat(RepeatValue.t, trackLength)]
@@ -1576,22 +1569,22 @@ type gridLength = [trackLength | #repeat(RepeatValue.t, trackLength)]
let gridLengthToJs = x =>
switch x {
| #...PercentageLengthCalc.t as plc => PercentageLengthCalc.toString(plc)
- | #fr(x) => Js.Float.toString(x) ++ "fr"
+ | #fr(x) => Float.toString(x) + "fr"
| #auto => "auto"
| #minContent => "min-content"
| #maxContent => "max-content"
- | #minmax(a, b) => "minmax(" ++ minmaxToJs(a) ++ "," ++ minmaxToJs(b) ++ ")"
- | #repeat(n, x) => "repeat(" ++ RepeatValue.toString(n) ++ ", " ++ trackLengthToJs(x) ++ ")"
+ | #minmax(a, b) => "minmax(" + minmaxToJs(a) + "," + minmaxToJs(b) + ")"
+ | #repeat(n, x) => "repeat(" + RepeatValue.toString(n) + ", " + trackLengthToJs(x) + ")"
}
let gridTemplateColumns = dimensions => D(
"gridTemplateColumns",
- dimensions->Belt.List.map(gridLengthToJs)->Belt.List.toArray->Js.Array2.joinWith(" "),
+ dimensions->List.map(gridLengthToJs)->List.toArray->Array.joinUnsafe(" "),
)
let gridTemplateRows = dimensions => D(
"gridTemplateRows",
- dimensions->Belt.List.map(gridLengthToJs)->Belt.List.toArray->Js.Array2.joinWith(" "),
+ dimensions->List.map(gridLengthToJs)->List.toArray->Array.joinUnsafe(" "),
)
let gridAutoColumns = dimensions => D("gridAutoColumns", trackLengthToJs(dimensions))
@@ -1607,20 +1600,22 @@ let gridArea = s => D(
},
)
-let gridArea2 = (s, s2) => D("gridArea", GridArea.toString(s) ++ (" / " ++ GridArea.toString(s2)))
+let gridArea2 = (s, s2) => D("gridArea", GridArea.toString(s) + " / " + GridArea.toString(s2))
let gridArea3 = (s, s2, s3) => D(
"gridArea",
- GridArea.toString(s) ++ (" / " ++ (GridArea.toString(s2) ++ (" / " ++ GridArea.toString(s3)))),
+ GridArea.toString(s) + " / " + GridArea.toString(s2) + " / " + GridArea.toString(s3),
)
let gridArea4 = (s, s2, s3, s4) => D(
"gridArea",
- GridArea.toString(s) ++
- (" / " ++
- (GridArea.toString(s2) ++
- (" / " ++
- (GridArea.toString(s3) ++ (" / " ++ GridArea.toString(s4)))))),
+ GridArea.toString(s) +
+ " / " +
+ GridArea.toString(s2) +
+ " / " +
+ GridArea.toString(s3) +
+ " / " +
+ GridArea.toString(s4),
)
let gridTemplateAreas = l => D(
@@ -1651,28 +1646,31 @@ type filter = [
let string_of_filter = x =>
switch x {
- | #blur(v) => "blur(" ++ (Length.toString(v) ++ ")")
- | #brightness(v) => "brightness(" ++ (Js.Float.toString(v) ++ "%)")
- | #contrast(v) => "contrast(" ++ (Js.Float.toString(v) ++ "%)")
+ | #blur(v) => "blur(" + Length.toString(v) + ")"
+ | #brightness(v) => "brightness(" + Float.toString(v) + "%)"
+ | #contrast(v) => "contrast(" + Float.toString(v) + "%)"
| #dropShadow(a, b, c, d) =>
- "drop-shadow(" ++
- (Length.toString(a) ++
- (" " ++
- (Length.toString(b) ++
- (" " ++ (Length.toString(c) ++ (" " ++ (Color.toString(d) ++ ")")))))))
- | #grayscale(v) => "grayscale(" ++ (Js.Float.toString(v) ++ "%)")
- | #hueRotate(v) => "hue-rotate(" ++ (Angle.toString(v) ++ ")")
- | #invert(v) => "invert(" ++ (Js.Float.toString(v) ++ "%)")
- | #opacity(v) => "opacity(" ++ (Js.Float.toString(v) ++ "%)")
- | #saturate(v) => "saturate(" ++ (Js.Float.toString(v) ++ "%)")
- | #sepia(v) => "sepia(" ++ (Js.Float.toString(v) ++ "%)")
+ "drop-shadow(" +
+ Length.toString(a) +
+ " " +
+ Length.toString(b) +
+ " " +
+ Length.toString(c) +
+ " " +
+ Color.toString(d) + ")"
+ | #grayscale(v) => "grayscale(" + Float.toString(v) + "%)"
+ | #hueRotate(v) => "hue-rotate(" + Angle.toString(v) + ")"
+ | #invert(v) => "invert(" + Float.toString(v) + "%)"
+ | #opacity(v) => "opacity(" + Float.toString(v) + "%)"
+ | #saturate(v) => "saturate(" + Float.toString(v) + "%)"
+ | #sepia(v) => "sepia(" + Float.toString(v) + "%)"
| #none => "none"
| #...Url.t as u => Url.toString(u)
| #...Var.t as va => Var.toString(va)
| #...Cascading.t as c => Cascading.toString(c)
}
-let filter = x => D("filter", x->Belt.List.map(string_of_filter)->join(" "))
+let filter = x => D("filter", x->List.map(string_of_filter)->join(" "))
module Shadow = {
type value<'a> = string
@@ -1682,22 +1680,26 @@ module Shadow = {
let box = (~x=zero, ~y=zero, ~blur=zero, ~spread=zero, ~inset=false, color) =>
#shadow(
- Length.toString(x) ++
- (" " ++
- (Length.toString(y) ++
- (" " ++
- (Length.toString(blur) ++
- (" " ++
- (Length.toString(spread) ++
- (" " ++
- (string_of_color(color) ++ (inset ? " inset" : ""))))))))),
+ Length.toString(x) +
+ " " +
+ Length.toString(y) +
+ " " +
+ Length.toString(blur) +
+ " " +
+ Length.toString(spread) +
+ " " +
+ string_of_color(color) + (inset ? " inset" : ""),
)
let text = (~x=zero, ~y=zero, ~blur=zero, color) =>
#shadow(
- Length.toString(x) ++
- (" " ++
- (Length.toString(y) ++ (" " ++ (Length.toString(blur) ++ (" " ++ string_of_color(color)))))),
+ Length.toString(x) +
+ " " +
+ Length.toString(y) +
+ " " +
+ Length.toString(blur) +
+ " " +
+ string_of_color(color),
)
let toString: t<'a> => string = x =>
@@ -1716,7 +1718,7 @@ let boxShadow = x => D(
},
)
-let boxShadows = x => D("boxShadow", x->Belt.List.map(Shadow.toString)->join(", "))
+let boxShadows = x => D("boxShadow", x->List.map(Shadow.toString)->join(", "))
let string_of_border_style = x =>
switch x {
@@ -1727,42 +1729,32 @@ let string_of_border_style = x =>
let border = (px, style, color) => D(
"border",
- Length.toString(px) ++
- (" " ++
- (string_of_border_style(style) ++ (" " ++ string_of_color(color)))),
+ Length.toString(px) + " " + string_of_border_style(style) + " " + string_of_color(color),
)
let borderStyle = x => D("borderStyle", string_of_border_style(x))
let borderLeft = (px, style, color) => D(
"borderLeft",
- Length.toString(px) ++
- (" " ++
- (string_of_border_style(style) ++ (" " ++ string_of_color(color)))),
+ Length.toString(px) + " " + string_of_border_style(style) + " " + string_of_color(color),
)
let borderLeftStyle = x => D("borderLeftStyle", string_of_border_style(x))
let borderRight = (px, style, color) => D(
"borderRight",
- Length.toString(px) ++
- (" " ++
- (string_of_border_style(style) ++ (" " ++ string_of_color(color)))),
+ Length.toString(px) + " " + string_of_border_style(style) + " " + string_of_color(color),
)
let borderRightStyle = x => D("borderRightStyle", string_of_border_style(x))
let borderTop = (px, style, color) => D(
"borderTop",
- Length.toString(px) ++
- (" " ++
- (string_of_border_style(style) ++ (" " ++ string_of_color(color)))),
+ Length.toString(px) + " " + string_of_border_style(style) + " " + string_of_color(color),
)
let borderTopStyle = x => D("borderTopStyle", string_of_border_style(x))
let borderBottom = (px, style, color) => D(
"borderBottom",
- Length.toString(px) ++
- (" " ++
- (string_of_border_style(style) ++ (" " ++ string_of_color(color)))),
+ Length.toString(px) + " " + string_of_border_style(style) + " " + string_of_color(color),
)
let borderBottomStyle = x => D("borderBottomStyle", string_of_border_style(x))
@@ -1780,7 +1772,7 @@ let background = x => D(
let backgrounds = x => D(
"background",
x
- ->Belt.List.map(item =>
+ ->List.map(item =>
switch item {
| #...Color.t as c => Color.toString(c)
| #...Url.t as u => Url.toString(u)
@@ -1794,7 +1786,7 @@ let backgrounds = x => D(
let backgroundSize = x => D(
"backgroundSize",
switch x {
- | #size(x, y) => Length.toString(x) ++ (" " ++ Length.toString(y))
+ | #size(x, y) => Length.toString(x) + " " + Length.toString(y)
| #auto => "auto"
| #cover => "cover"
| #contain => "contain"
@@ -1810,33 +1802,33 @@ let fontFace = (
~sizeAdjust=?,
(),
) => {
- let fontStyle = Js.Option.map((. value) => FontStyle.toString(value), fontStyle)
+ let fontStyle = fontStyle->Option.map(value => FontStyle.toString(value))
let src =
src
- ->Belt.List.map(x =>
+ ->List.map(x =>
switch x {
| #localUrl(value) => `local("${value}")`
| #url(value) => `url("${value}")`
}
)
- ->Belt.List.toArray
- ->Js.Array2.joinWith(" ")
+ ->List.toArray
+ ->Array.joinUnsafe(" ")
- let fontStyle = Belt.Option.mapWithDefault(fontStyle, "", s => "font-style: " ++ (s ++ ";"))
- let fontWeight = Belt.Option.mapWithDefault(fontWeight, "", w =>
- "font-weight: " ++
+ let fontStyle = Option.mapOr(fontStyle, "", s => "font-style: " + (s + ";"))
+ let fontWeight = Option.mapOr(fontWeight, "", w =>
+ "font-weight: " +
(switch w {
| #...FontWeight.t as f => FontWeight.toString(f)
| #...Var.t as va => Var.toString(va)
| #...Cascading.t as c => Cascading.toString(c)
- } ++
+ } +
";")
)
- let fontDisplay = Belt.Option.mapWithDefault(fontDisplay, "", f =>
- "font-display: " ++ (FontDisplay.toString(f) ++ ";")
+ let fontDisplay = Option.mapOr(fontDisplay, "", f =>
+ "font-display: " + (FontDisplay.toString(f) + ";")
)
- let sizeAdjust = Belt.Option.mapWithDefault(sizeAdjust, "", s =>
- "size-adjust: " ++ Types.Percentage.toString(s) ++ ";"
+ let sizeAdjust = Option.mapOr(sizeAdjust, "", s =>
+ "size-adjust: " + Types.Percentage.toString(s) + ";"
)
`@font-face {
@@ -1872,7 +1864,7 @@ let textShadow = x => D(
},
)
-let textShadows = x => D("textShadow", x->Belt.List.map(Shadow.toString)->join(", "))
+let textShadows = x => D("textShadow", x->List.map(Shadow.toString)->join(", "))
let transformStyle = x => D(
"transformStyle",
@@ -1891,11 +1883,13 @@ module Transition = {
let shorthand = (~duration=#ms(0.), ~delay=#ms(0.), ~timingFunction=#ease, property) =>
#value(
- string_of_time(duration) ++
- (" " ++
- (TimingFunction.toString(timingFunction) ++
- (" " ++
- (string_of_time(delay) ++ (" " ++ property))))),
+ string_of_time(duration) +
+ " " +
+ TimingFunction.toString(timingFunction) +
+ " " +
+ string_of_time(delay) +
+ " " +
+ property,
)
let toString = x =>
@@ -1906,7 +1900,7 @@ module Transition = {
let transitionValue = x => D("transition", Transition.toString(x))
-let transitionList = x => D("transition", x->Belt.List.map(Transition.toString)->join(", "))
+let transitionList = x => D("transition", x->List.map(Transition.toString)->join(", "))
let transitions = transitionList
let transition = (~duration=?, ~delay=?, ~timingFunction=?, property) =>
@@ -1937,21 +1931,21 @@ module Animation = {
name,
) =>
#value(
- name ++
- (" " ++
- (string_of_time(duration) ++
- (" " ++
- (TimingFunction.toString(timingFunction) ++
- (" " ++
- (string_of_time(delay) ++
- (" " ++
- (AnimationIterationCount.toString(iterationCount) ++
- (" " ++
- (AnimationDirection.toString(direction) ++
- (" " ++
- (AnimationFillMode.toString(fillMode) ++
- (" " ++
- AnimationPlayState.toString(playState)))))))))))))),
+ name +
+ " " +
+ string_of_time(duration) +
+ " " +
+ TimingFunction.toString(timingFunction) +
+ " " +
+ string_of_time(delay) +
+ " " +
+ AnimationIterationCount.toString(iterationCount) +
+ " " +
+ AnimationDirection.toString(direction) +
+ " " +
+ AnimationFillMode.toString(fillMode) +
+ " " +
+ AnimationPlayState.toString(playState),
)
let toString = x =>
@@ -1985,14 +1979,13 @@ let animation = (
),
)
-let animations = x => D("animation", x->Belt.List.map(Animation.toString)->join(", "))
+let animations = x => D("animation", x->List.map(Animation.toString)->join(", "))
let animationName = x => D("animationName", x)
/**
* SVG
*/
-
module SVG = {
let fill = x => D(
"fill",
@@ -2003,7 +1996,7 @@ module SVG = {
| #...Types.Url.t as u => Types.Url.toString(u)
},
)
- let fillOpacity = opacity => D("fillOpacity", Js.Float.toString(opacity))
+ let fillOpacity = opacity => D("fillOpacity", Float.toString(opacity))
let fillRule = x => D(
"fillRule",
switch x {
@@ -2016,12 +2009,12 @@ module SVG = {
"strokeDasharray",
switch x {
| #none => "none"
- | #dasharray(a) => a->Belt.List.map(string_of_dasharray)->join(" ")
+ | #dasharray(a) => a->List.map(string_of_dasharray)->join(" ")
},
)
let strokeWidth = x => D("strokeWidth", Length.toString(x))
- let strokeOpacity = opacity => D("strokeOpacity", Js.Float.toString(opacity))
- let strokeMiterlimit = x => D("strokeMiterlimit", Js.Float.toString(x))
+ let strokeOpacity = opacity => D("strokeOpacity", Float.toString(opacity))
+ let strokeMiterlimit = x => D("strokeMiterlimit", Float.toString(x))
let strokeLinecap = x => D(
"strokeLinecap",
switch x {
@@ -2040,7 +2033,7 @@ module SVG = {
},
)
let stopColor = x => D("stopColor", string_of_color(x))
- let stopOpacity = x => D("stopOpacity", Js.Float.toString(x))
+ let stopOpacity = x => D("stopOpacity", Float.toString(x))
}
let touchAction = x => D("touchAction", x->TouchAction.toString)
diff --git a/bs-css/src/Css_Legacy_Core.resi b/bs-css/src/Css_Legacy_Core.resi
index b0453ca..3d5531e 100644
--- a/bs-css/src/Css_Legacy_Core.resi
+++ b/bs-css/src/Css_Legacy_Core.resi
@@ -13,7 +13,7 @@ module type MakeResult = {
let renderRule: (renderer, string) => unit
let global: (string, list) => unit
- let renderGlobal: (. renderer, string, list) => unit
+ let renderGlobal: (renderer, string, list) => unit
let style: list => styleEncoding
@@ -29,7 +29,7 @@ module type MakeResult = {
module Make: (CssImpl: Css_Core.CssImplementationIntf) =>
(MakeResult with type styleEncoding := CssImpl.styleEncoding and type renderer := CssImpl.renderer)
-let toJson: list => Js.Json.t
+let toJson: list => JSON.t
let important: rule => rule
let label: string => rule
@@ -448,7 +448,7 @@ let flexWrap: [< Types.FlexWrap.t | Types.Var.t | Types.Cascading.t] => rule
The element is removed from the normal flow of the page, though still remaining a part of the flow
(in contrast to absolute positioning).
*/
-let float: [< Types.Float.t | Types.Var.t | Types.Cascading.t] => rule
+let float: [< Types.Float_AtomicTypes.t | Types.Var.t | Types.Cascading.t] => rule
/**
The font-family CSS property specifies a prioritized list of one or more font family names and/or generic family names
@@ -1371,7 +1371,6 @@ let selection: list => rule
/**
Combinators selectors
*/
-
/**
The > combinator selects nodes that are direct children of the first element.
*/
@@ -1815,7 +1814,6 @@ let fontFace: (
/**
* Transition
*/
-
module Transition: {
type t = [#value(string)]
@@ -1843,7 +1841,6 @@ let transitions: list<[Transition.t]> => rule
/**
* Animation
*/
-
module Animation: {
type t = [#value(string)]
@@ -1918,7 +1915,6 @@ let animationTimingFunction: Types.TimingFunction.t => rule
/**
SVG
*** */
-
module SVG: {
let fill: [< Types.SVG.Fill.t | Types.Color.t | Types.Var.t | Types.Url.t] => rule
let fillRule: [#nonzero | #evenodd] => rule
diff --git a/dev-server-dom/bsconfig.json b/dev-server-dom/bsconfig.json
deleted file mode 100644
index 57ebbe3..0000000
--- a/dev-server-dom/bsconfig.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "name": "dev-server-dom",
- "reason": {
- "react-jsx": 3
- },
- "warnings": {
- "number": "+A-32-34-44",
- "error": "+A-32-34-44"
- },
- "sources": [
- "src"
- ],
- "bs-dependencies": [
- "bs-css",
- "bs-css-dom",
- "@rescript/react"
- ]
-}
diff --git a/dev-server-dom/package.json b/dev-server-dom/package.json
index a41ea85..c483266 100644
--- a/dev-server-dom/package.json
+++ b/dev-server-dom/package.json
@@ -2,31 +2,32 @@
"name": "dev-server-dom",
"version": "1.0.0",
"description": "Dev server",
+ "type": "module",
"private": true,
"scripts": {
"re:clean": "rescript clean",
- "re:build": "rescript build",
- "re:watch": "rescript build -w",
+ "re:build": "rescript",
+ "re:watch": "rescript watch",
"dev": "rspack dev"
},
"author": "Hervé Giraud ",
"license": "ISC",
"repository": {
"type": "git",
- "url": "git+https://github.com/reasonml-labs/bs-css.git"
+ "url": "git+https://github.com/giraud/bs-css.git"
},
"dependencies": {
"bs-css": "^18.0.0",
"bs-css-dom": "^6.0.0"
},
"devDependencies": {
- "@rescript/react": "^0.10.0",
+ "@rescript/react": "^0.14.0",
"@rspack/cli": "^1.4.0",
"@rspack/core": "^1.4.0",
"@rspack/plugin-react-refresh": "^1.4.0",
- "react": "^17.0.0",
- "react-dom": "^17.0.0",
- "react-refresh": "^0.17.0",
- "rescript": "^9.0.0"
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0",
+ "react-refresh": "^0.18.0",
+ "rescript": "^12.0.0"
}
}
diff --git a/dev-server-dom/rescript.json b/dev-server-dom/rescript.json
new file mode 100644
index 0000000..de6835a
--- /dev/null
+++ b/dev-server-dom/rescript.json
@@ -0,0 +1,17 @@
+{
+ "name": "dev-server-dom",
+ "jsx": { "version": 4 },
+ "warnings": {
+ "number": "+A-32-34-44",
+ "error": "+A-32-34-44"
+ },
+ "suffix": ".mjs",
+ "sources": ["src"],
+ "dependencies": ["bs-css", "bs-css-dom", "@rescript/react"],
+ "package-specs": [
+ {
+ "module": "esmodule",
+ "in-source": false
+ }
+ ]
+}
diff --git a/dev-server-dom/src/App.res b/dev-server-dom/src/App.res
index 6500481..3b99098 100644
--- a/dev-server-dom/src/App.res
+++ b/dev-server-dom/src/App.res
@@ -1,4 +1,4 @@
switch ReactDOM.querySelector("#app") {
| None => ()
-| Some(dom) => ReactDOM.render( , dom)
+| Some(dom) => dom->ReactDOM.Client.createRoot->ReactDOM.Client.Root.render( )
}
diff --git a/dev-server-dom/src/Comp.res b/dev-server-dom/src/Comp.res
index fd33872..960af9f 100644
--- a/dev-server-dom/src/Comp.res
+++ b/dev-server-dom/src/Comp.res
@@ -10,8 +10,8 @@ module Section = {
(),
)
- let section = style(. [
- selector(.
+ let section = style([
+ selector(
"& > h1",
[fontFamily(#custom(arialNarrow)), fontWeight(#num(300)), marginTop(#zero)],
),
@@ -26,13 +26,14 @@ module Section = {
]),
])
- let rowLayout = style(. [display(#flex), flexDirection(#row), flexWrap(#wrap)])
+ let rowLayout = style([display(#flex), flexDirection(#row), flexWrap(#wrap)])
}
@react.component
let make = (~name, ~children) =>
- {name->React.string} children
+ {name->React.string}
+ children
}
@@ -47,10 +48,7 @@ let redBox = [
module RedBox = {
@react.component
let make = (~rules=?, ~children=?) =>
- Belt.Option.mapWithDefaultU(redBox, (. r) => redBox->Belt.Array.concat(r)),
- )}>
+
Option.mapOr(redBox, r => redBox->Array.concat(r)))}>
{switch children {
| None => React.null
| Some(c) => c
diff --git a/dev-server-dom/src/Demo.res b/dev-server-dom/src/Demo.res
index 0760ae1..57542a3 100644
--- a/dev-server-dom/src/Demo.res
+++ b/dev-server-dom/src/Demo.res
@@ -2,18 +2,18 @@ open CssJs
module Section = Comp.Section
module RedBox = Comp.RedBox
-let concat = Belt.Array.concat
-let addToRedBox = rules => Comp.redBox->Belt.Array.concat(rules)
+let concat = Array.concat
+let addToRedBox = rules => Comp.redBox->Array.concat(rules)
let fontItem = [marginLeft(10->px), paddingRight(10->px), borderRight(1->px, solid, black)]
let miniBox = [border(2->px, solid, black), width(15->px), height(15->px), margin(1->px)]
-let mergedStyles = merge(. [
- style(. [padding(0->px), fontSize(1->px)]),
- style(. [padding(20->px), fontSize(24->px), color(blue)]),
- style(. [media(. "(maxWidth: 768px)", [padding(10->px)])]),
- style(. [media(. "(maxWidth: 768px)", [fontSize(16->px), color(red)])]),
+let mergedStyles = merge([
+ style([padding(0->px), fontSize(1->px)]),
+ style([padding(20->px), fontSize(24->px), color(blue)]),
+ style([media("(maxWidth: 768px)", [padding(10->px)])]),
+ style([media("(maxWidth: 768px)", [fontSize(16->px), color(red)])]),
])
let differentHeightLengths =
@@ -32,15 +32,15 @@ let differentHeightLengths =
1.0->vmin,
zero,
]
- ->Belt.Array.map(x => {
- let className = style(. addToRedBox([height(x)]))
-
+ ->Array.mapWithIndex((x, index) => {
+ let className = style(addToRedBox([height(x)]))
+
})
->React.array
@react.component
let make = () =>
-
+
deg))] />
rad))] />
@@ -58,11 +58,11 @@ let make = () =>
-
-
+
+
{"color-scheme: light"->React.string}
])}
/>
-
+
{"color-scheme: dark"->React.string}
whitesmoke,
yellow,
yellowgreen,
- ]->Belt.Array.map(c =>
-
Belt.Array.concat(miniBox))} />
+ ]->Array.map(c =>
+
Css_AtomicTypes.Color.toString}
+ style={style([background(c)]->Array.concat(miniBox))}
+ />
),
)}
@@ -314,15 +317,16 @@ let make = () =>
pct),
height(500->px),
display(grid),
gridTemplateColumns([150->px, auto, 150->px]),
gridTemplateRows([60->px, auto]),
- ])}>
+ ])}
+ >
gridRowEnd(1),
])}
/>
-
+
px, auto]),
gridTemplateRows([40->px, auto]),
- ])}>
-
-
-
+ ])}
+ >
+
+
+
])}
/>
-
-
- {"grid auto direction row 1"->React.string}
-
-
- {"grid auto direction row 2"->React.string}
-
+
+
{"grid auto direction row 1"->React.string}
+
{"grid auto direction row 2"->React.string}
px, #repeat(#num(2), 60->px)])])}>
-
{"Grid track repeat"->React.string}
-
{"two times"->React.string}
-
{"three times"->React.string}
+ style={style([display(#grid), gridTemplateColumns([100->px, #repeat(#num(2), 60->px)])])}
+ >
+
{"Grid track repeat"->React.string}
+
{"two times"->React.string}
+
{"three times"->React.string}
-
px)])}>
-
- {"Grid auto columns (100px)"->React.string}
-
-
{"100px"->React.string}
-
{"100px"->React.string}
+
px)])}>
+
{"Grid auto columns (100px)"->React.string}
+
{"100px"->React.string}
+
{"100px"->React.string}
*", [marginBottom(10->px), width(100.->pct)]),
- ])}>
+ selector("& > *", [marginBottom(10->px), width(100.->pct)]),
+ ])}
+ >
+ ])}
+ >
px)] />
@@ -399,54 +401,69 @@ let make = () =>
-
+ ])}
+ >
+
+
+
- px), width(50->px)] />
+ ])}
+ >
+
+ px), width(50->px)] />
+
- px), width(50->px)] />
+ ])}
+ >
+
+ px), width(50->px)] />
+
- px), width(50->px)] />
+ ])}
+ >
+
+ px), width(50->px)] />
+
- px), width(50->px)] />
+ ])}
+ >
+
+ px), width(50->px)] />
+
@@ -569,19 +586,19 @@ let make = () =>
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
pt),
@@ -655,43 +672,39 @@ let make = () =>
wordWrap(breakWord),
width(#maxContent),
maxWidth(#maxContent),
- ])}>
+ ])}
+ >
{"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."->React.string}
- pct)])}> {"Named Font weights"->React.string}
+ pct)])}> {"Named Font weights"->React.string}
px), borderRight(1->px, solid, black)])}>
+ style={style([fontWeight(thin), paddingRight(10->px), borderRight(1->px, solid, black)])}
+ >
{"thin"->React.string}
- concat(fontItem))}>
+ concat(fontItem))}>
{"extra light"->React.string}
- concat(fontItem))}> {"light"->React.string}
- concat(fontItem))}>
- {"normal"->React.string}
-
- concat(fontItem))}>
- {"medium"->React.string}
-
- concat(fontItem))}>
+ concat(fontItem))}> {"light"->React.string}
+ concat(fontItem))}> {"normal"->React.string}
+ concat(fontItem))}> {"medium"->React.string}
+ concat(fontItem))}>
{"semiBold"->React.string}
- concat(fontItem))}> {"bold"->React.string}
- concat(fontItem))}>
+ concat(fontItem))}> {"bold"->React.string}
+ concat(fontItem))}>
{"extra bold"->React.string}
- concat(fontItem))}> {"black"->React.string}
- concat(fontItem))}>
+ concat(fontItem))}> {"black"->React.string}
+ concat(fontItem))}>
{"lighter"->React.string}
- concat(fontItem))}>
- {"bolder"->React.string}
-
+ concat(fontItem))}> {"bolder"->React.string}
{"inherit"->React.string}
/>
{"unset"->React.string}
/>
-
+
{"This is a bunch of text split into columns
using the CSS `column-count` property. The text
is equally distributed over the columns."->React.string}
-
- px), overflow(scroll), resize(horizontal)])}>
+
+
px), overflow(scroll), resize(horizontal)])}>
{"Resizable div (horizontal)"->React.string}
-
px), overflow(scroll), resize(vertical)])}>
+
px), overflow(scroll), resize(vertical)])}>
{"Resizable div (vertical)"->React.string}
height(100.->pct),
border(1->px, solid, black),
]),
- ])}>
+ ])}
+ >
{"none"->React.string}
height(100.->pct),
border(1->px, solid, black),
]),
- ])}>
+ ])}
+ >
{"normal"->React.string}
- px)])}>
+
px),
after([
@@ -784,11 +800,12 @@ let make = () =>
height(100.->pct),
border(1->px, solid, black),
]),
- ])}>
+ ])}
+ >
{"empty content"->React.string}
px),
paddingLeft(20->px),
@@ -801,42 +818,44 @@ let make = () =>
height(18->px),
border(1->px, solid, black),
]),
- ])}>
+ ])}
+ >
{"url"->React.string}
px),
counterReset(Types.CounterReset.reset /* for test */("foo", ~value=1)),
before([contentRule(Types.Counter.counter("foo")), border(1->px, solid, black)]),
- ])}>
+ ])}
+ >
{"counter"->React.string}
px),
- ])}>
+ style={style([counterReset(Types.CounterReset.reset("foo", ~value=1)), marginLeft(20->px)])}
+ >
px, solid, black),
]),
- ])}>
+ ])}
+ >
{"counters"->React.string}
px),
before([contentRule(#attr("class")), border(1->px, solid, black)]),
- ])}>
+ ])}
+ >
{"attr"->React.string}
px),
before([
contentRule(linearGradient(45.->deg, [(zero, red), (100.->pct, blue)])),
@@ -845,21 +864,25 @@ let make = () =>
height(18->px),
width(18->px),
]),
- ])}>
+ ])}
+ >
{"linear gradient"->React.string}
px),
before([
contentRules([#openQuote, #text("foo"), #closeQuote]),
border(1->px, solid, black),
]),
- ])}>
+ ])}
+ >
{"contents (quotes)"->React.string}
-
+
@@ -883,14 +906,16 @@ let make = () =>
]),
]
/>
-
-
+
+
+
+
-
+
{"1"->React.string}
{"2"->React.string}
{"3"->React.string}
@@ -898,7 +923,7 @@ let make = () =>
-
+
{"1"->React.string}
{"2"->React.string}
{"3"->React.string}
@@ -906,7 +931,7 @@ let make = () =>
-
+
diff --git a/dev-server-emotion/bsconfig.json b/dev-server-emotion/bsconfig.json
deleted file mode 100644
index 46b099c..0000000
--- a/dev-server-emotion/bsconfig.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "name": "dev-server-emotion",
- "reason": {
- "react-jsx": 3
- },
- "warnings": {
- "number": "+A-32-34-44",
- "error": "+A-32-34-44"
- },
- "sources": [
- "src"
- ],
- "bs-dependencies": [
- "bs-css",
- "bs-css-emotion",
- "@rescript/react"
- ]
-}
diff --git a/dev-server-emotion/package.json b/dev-server-emotion/package.json
index f85f77a..4fa7cb9 100644
--- a/dev-server-emotion/package.json
+++ b/dev-server-emotion/package.json
@@ -2,31 +2,32 @@
"name": "dev-server-emotion",
"version": "1.0.0",
"description": "Dev server",
+ "type": "module",
"private": true,
"scripts": {
"re:clean": "rescript clean",
- "re:build": "rescript build",
- "re:watch": "rescript build -w",
+ "re:build": "rescript",
+ "re:watch": "rescript watch",
"dev": "rspack dev"
},
"author": "Hervé Giraud
",
"license": "ISC",
"repository": {
"type": "git",
- "url": "git+https://github.com/reasonml-labs/bs-css.git"
+ "url": "git+https://github.com/giraud/bs-css.git"
},
"dependencies": {
"bs-css": "^18.0.0",
"bs-css-emotion": "^7.0.0"
},
"devDependencies": {
- "@rescript/react": "^0.10.0",
+ "@rescript/react": "^0.14.0",
"@rspack/cli": "^1.4.0",
"@rspack/core": "^1.4.0",
"@rspack/plugin-react-refresh": "^1.4.0",
- "react": "^17.0.0",
- "react-dom": "^17.0.0",
- "react-refresh": "^0.17.0",
- "rescript": "^9.0.0"
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0",
+ "react-refresh": "^0.18.0",
+ "rescript": "^12.0.0"
}
}
diff --git a/dev-server-emotion/rescript.json b/dev-server-emotion/rescript.json
new file mode 100644
index 0000000..749e91f
--- /dev/null
+++ b/dev-server-emotion/rescript.json
@@ -0,0 +1,17 @@
+{
+ "name": "dev-server-emotion",
+ "jsx": { "version": 4 },
+ "warnings": {
+ "number": "+A-32-34-44",
+ "error": "+A-32-34-44"
+ },
+ "suffix": ".mjs",
+ "sources": ["src"],
+ "dependencies": ["bs-css", "bs-css-emotion", "@rescript/react"],
+ "package-specs": [
+ {
+ "module": "esmodule",
+ "in-source": false
+ }
+ ]
+}
diff --git a/dev-server-emotion/src/App.res b/dev-server-emotion/src/App.res
index f5008c1..c4fd639 100644
--- a/dev-server-emotion/src/App.res
+++ b/dev-server-emotion/src/App.res
@@ -1,8 +1,8 @@
open CssJs
-global(. "html, body", [margin(zero), padding(zero), backgroundColor(lavender)])
+global("html, body", [margin(zero), padding(zero), backgroundColor(lavender)])
switch ReactDOM.querySelector("#app") {
| None => ()
-| Some(dom) => ReactDOM.render( , dom)
+| Some(dom) => dom->ReactDOM.Client.createRoot->ReactDOM.Client.Root.render( )
}
diff --git a/dev-server-emotion/src/Comp.res b/dev-server-emotion/src/Comp.res
index ca0d436..3efa569 100644
--- a/dev-server-emotion/src/Comp.res
+++ b/dev-server-emotion/src/Comp.res
@@ -10,8 +10,8 @@ module Section = {
(),
)
- let section = style(. [
- selector(. "& > h1", [fontFamily(#custom(arialNarrow)), marginTop(zero)]),
+ let section = style([
+ selector("& > h1", [fontFamily(#custom(arialNarrow)), marginTop(zero)]),
position(relative),
background(hex("f5f5f5")),
margin(20->px),
@@ -23,13 +23,14 @@ module Section = {
]),
])
- let rowLayout = style(. [display(flexBox), flexDirection(row), flexWrap(wrap)])
+ let rowLayout = style([display(flexBox), flexDirection(row), flexWrap(wrap)])
}
@react.component
let make = (~name, ~children) =>
- {name->React.string} children
+ {name->React.string}
+ children
}
@@ -44,10 +45,7 @@ let redBox = [
module RedBox = {
@react.component
let make = (~rules=?, ~children=?) =>
- Belt.Option.mapWithDefaultU(redBox, (. r) => redBox->Belt.Array.concat(r)),
- )}>
+
Option.mapOr(redBox, r => redBox->Array.concat(r)))}>
{switch children {
| None => React.null
| Some(c) => c
diff --git a/dev-server-emotion/src/Demo.res b/dev-server-emotion/src/Demo.res
index 1c0451d..74e2b46 100644
--- a/dev-server-emotion/src/Demo.res
+++ b/dev-server-emotion/src/Demo.res
@@ -1,30 +1,30 @@
open CssJs
-insertRule(. ".raw-css { display:block; background-color: green; width: 50px; height: 50px; }")
+insertRule(".raw-css { display:block; background-color: green; width: 50px; height: 50px; }")
module Section = Comp.Section
module RedBox = Comp.RedBox
-let concat = Belt.Array.concat
+let concat = Array.concat
let redBox = Comp.redBox
let addToRedBox = rules => redBox->concat(rules)
let fontItem = [marginLeft(10->px), paddingRight(10->px), borderRight(1->px, solid, black)]
-let spin = keyframes(. [(0, [transform(rotate(deg(0.)))]), (100, [transform(rotate(deg(360.)))])])
+let spin = keyframes([(0, [transform(rotate(deg(0.)))]), (100, [transform(rotate(deg(360.)))])])
-let scaleAnimation = keyframes(. [
+let scaleAnimation = keyframes([
(0, [transform(scale(0.3, 0.3))]),
(100, [transform(scale(1.0, 1.0))]),
])
let miniBox = [border(2->px, solid, black), width(15->px), height(15->px), margin(1->px)]
-let mergedStyles = merge(. [
- style(. [padding(0->px), fontSize(1->px)]),
- style(. [padding(20->px), fontSize(24->px), color(blue)]),
- style(. [media(. "(max-width: 768px)", [padding(10->px)])]),
- style(. [media(. "(max-width: 768px)", [fontSize(16->px), color(red)])]),
+let mergedStyles = merge([
+ style([padding(0->px), fontSize(1->px)]),
+ style([padding(20->px), fontSize(24->px), color(blue)]),
+ style([media("(max-width: 768px)", [padding(10->px)])]),
+ style([media("(max-width: 768px)", [fontSize(16->px), color(red)])]),
])
let differentHeightLengths =
@@ -43,8 +43,8 @@ let differentHeightLengths =
vmin(1.0),
zero,
]
- ->Belt.Array.map(x => {
- let className = style(. addToRedBox([height(x)]))
+ ->Array.map(x => {
+ let className = style(addToRedBox([height(x)]))
})
->React.array
@@ -69,11 +69,11 @@ let make = () =>
-
-
+
+
{"color-scheme: light"->React.string}
])}
/>
-
+
{"color-scheme: dark"->React.string}
("whitesmoke", whitesmoke),
("yellow", yellow),
("yellowgreen", yellowgreen),
- ]->Belt.Array.map(((name, value)) =>
-
concat(miniBox))} />
+ ]->Array.map(((name, value)) =>
+
concat(miniBox))} />
),
)}
@@ -325,15 +325,16 @@ let make = () =>
px),
display(grid),
gridTemplateColumns([150->px, auto, 150->px]),
gridTemplateRows([60->px, auto]),
- ])}>
+ ])}
+ >
gridRowEnd(1),
])}
/>
-
+
px, auto]),
gridTemplateRows([40->px, auto]),
- ])}>
-
-
-
+ ])}
+ >
+
+
+
])}
/>
-
-
+
+
{"grid auto direction row 1"->React.string}
-
+
{"grid auto direction row 2"->React.string}
px, #repeat(#num(2), 60->px)]),
- ])}>
-
{"Grid track repeat"->React.string}
-
{"two times"->React.string}
-
{"three times"->React.string}
+ ])}
+ >
+
{"Grid track repeat"->React.string}
+
{"two times"->React.string}
+
{"three times"->React.string}
-
px)])}>
-
+
px)])}>
+
{"Grid auto columns (100px)"->React.string}
-
{"100px"->React.string}
-
{"100px"->React.string}
+
{"100px"->React.string}
+
{"100px"->React.string}
*", [marginBottom(10->px), width(pct(100.))]),
- ])}>
+ selector("& > *", [marginBottom(10->px), width(pct(100.))]),
+ ])}
+ >
+ ])}
+ >
px)] />
@@ -413,54 +418,69 @@ let make = () =>
-
+ ])}
+ >
+
+
+
- px), width(50->px)] />
+ ])}
+ >
+
+ px), width(50->px)] />
+
- px), width(50->px)] />
+ ])}
+ >
+
+ px), width(50->px)] />
+
- px), width(50->px)] />
+ ])}
+ >
+
+ px), width(50->px)] />
+
- px), width(50->px)] />
+ ])}
+ >
+
+ px), width(50->px)] />
+
@@ -583,19 +603,19 @@ let make = () =>
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
wordBreak(breakAll),
wordSpacing(20->px),
wordWrap(breakWord),
- ])}>
+ ])}
+ >
{"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."->React.string}
- {"Named Font weights"->React.string}
+ {"Named Font weights"->React.string}
px),
borderRight(1->px, solid, black),
- ])}>
+ ])}
+ >
{"thin"->React.string}
- concat(fontItem))}>
+ concat(fontItem))}>
{"extra light"->React.string}
- concat(fontItem))}>
+ concat(fontItem))}>
{"light"->React.string}
- concat(fontItem))}>
+ concat(fontItem))}>
{"normal"->React.string}
- concat(fontItem))}>
+ concat(fontItem))}>
{"medium"->React.string}
- concat(fontItem))}>
+ concat(fontItem))}>
{"semiBold"->React.string}
- concat(fontItem))}>
- {"bold"->React.string}
-
- concat(fontItem))}>
+ concat(fontItem))}> {"bold"->React.string}
+ concat(fontItem))}>
{"extra bold"->React.string}
- concat(fontItem))}>
+ concat(fontItem))}>
{"black"->React.string}
- concat(fontItem))}>
+ concat(fontItem))}>
{"lighter"->React.string}
- concat(fontItem))}>
+ concat(fontItem))}>
{"bolder"->React.string}
@@ -749,7 +769,7 @@ let make = () =>
{"inherit"->React.string}
/>
{"unset"->React.string}
/>
-
+
{"This is a bunch of text split into columns
using the CSS `column-count` property. The text
is equally distributed over the columns."->React.string}
-
- px), overflow(scroll), resize(horizontal)])}>
+
+
px), overflow(scroll), resize(horizontal)])}>
{"Resizable div (horizontal)"->React.string}
-
px), overflow(scroll), resize(vertical)])}>
+
px), overflow(scroll), resize(vertical)])}>
{"Resizable div (vertical)"->React.string}
height(pct(100.)),
border(1->px, solid, black),
]),
- ])}>
+ ])}
+ >
{"none"->React.string}
height(pct(100.)),
border(1->px, solid, black),
]),
- ])}>
+ ])}
+ >
{"normal"->React.string}
- px)])}>
+
px),
after([
@@ -842,11 +865,12 @@ let make = () =>
height(pct(100.)),
border(1->px, solid, black),
]),
- ])}>
+ ])}
+ >
{"empty content"->React.string}
px),
paddingLeft(20->px),
@@ -859,45 +883,50 @@ let make = () =>
height(18->px),
border(1->px, solid, black),
]),
- ])}>
+ ])}
+ >
{"url"->React.string}
px),
counterReset(Types.CounterReset.reset("foo", ~value=1)),
before([
contentRule(Types.Counter.counter("foo")),
border(px /* for test */(1), solid, black),
]),
- ])}>
+ ])}
+ >
{"counter"->React.string}
px),
- ])}>
+ ])}
+ >
px, solid, black),
]),
- ])}>
+ ])}
+ >
{"counters"->React.string}
px),
before([contentRule(#attr("class")), border(1->px, solid, black)]),
- ])}>
+ ])}
+ >
{"attr"->React.string}
px),
before([
contentRule(Types.Gradient.linearGradient(deg(45.), [(zero, red), (pct(100.), blue)])),
@@ -906,21 +935,25 @@ let make = () =>
height(18->px),
width(18->px),
]),
- ])}>
+ ])}
+ >
{"linear gradient"->React.string}
px),
before([
contentRules([#openQuote, #text("foo"), #closeQuote]),
border(px(1), solid, black),
]),
- ])}>
+ ])}
+ >
{"contents (quotes)"->React.string}
-
+
@@ -944,14 +977,16 @@ let make = () =>
]),
]
/>
-
-
+
+
+
+
-
+
{"1"->React.string}
{"2"->React.string}
{"3"->React.string}
@@ -959,7 +994,7 @@ let make = () =>
-
+
{"1"->React.string}
{"2"->React.string}
{"3"->React.string}
@@ -967,7 +1002,7 @@ let make = () =>
-
+
diff --git a/dev-server-fela/bsconfig.json b/dev-server-fela/bsconfig.json
deleted file mode 100644
index 5099506..0000000
--- a/dev-server-fela/bsconfig.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "name": "dev-server-fela",
- "reason": {
- "react-jsx": 3
- },
- "refmt": 3,
- "warnings": {
- "number": "+A-32-34-44",
- "error": "+A-32-34-44"
- },
- "sources": [
- {
- "dir": "src"
- }
- ],
- "bs-dependencies": [
- "bs-css",
- "bs-css-fela",
- "@rescript/react"
- ]
-}
diff --git a/dev-server-fela/package.json b/dev-server-fela/package.json
index 7aec116..57bb722 100644
--- a/dev-server-fela/package.json
+++ b/dev-server-fela/package.json
@@ -2,30 +2,31 @@
"name": "dev-server-fela",
"version": "1.0.0",
"description": "Dev server",
+ "type": "module",
"private": true,
"scripts": {
"re:clean": "rescript clean",
- "re:build": "rescript build",
- "re:watch": "rescript build -w",
+ "re:build": "rescript",
+ "re:watch": "rescript watch",
"serve": "../node_modules/.bin/esbuild ./lib/js/src/App.js --servedir=../www --outdir=../www/js --bundle --loader:.js=jsx --define:process.env.NODE_ENV=\\\"development\\\""
},
"author": "Hervé Giraud
",
"license": "ISC",
"repository": {
"type": "git",
- "url": "git+https://github.com/reasonml-labs/bs-css.git"
+ "url": "git+https://github.com/giraud/bs-css.git"
},
"dependencies": {
"bs-css": "^18.0.0",
"bs-css-fela": "^5.0.0",
- "fela": "^11.0.0",
- "react-fela": "^11.0.0"
+ "fela": "^12.2.0",
+ "react-fela": "^12.2.0"
},
"devDependencies": {
- "@rescript/react": "^0.10.0",
+ "@rescript/react": "^0.14.0",
"esbuild": "^0.9.0",
- "react": "^17.0.0",
- "react-dom": "^17.0.0",
- "rescript": "^9.0.0"
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0",
+ "rescript": "^12.0.0"
}
}
diff --git a/dev-server-fela/rescript.json b/dev-server-fela/rescript.json
new file mode 100644
index 0000000..bd1d9cc
--- /dev/null
+++ b/dev-server-fela/rescript.json
@@ -0,0 +1,17 @@
+{
+ "name": "dev-server-fela",
+ "jsx": { "version": 4 },
+ "warnings": {
+ "number": "+A-32-34-44",
+ "error": "+A-32-34-44"
+ },
+ "suffix": ".mjs",
+ "sources": ["src"],
+ "dependencies": ["bs-css", "bs-css-fela", "@rescript/react"],
+ "package-specs": [
+ {
+ "module": "esmodule",
+ "in-source": false
+ }
+ ]
+}
diff --git a/dev-server-fela/src/App.res b/dev-server-fela/src/App.res
index 5192f11..2b2c058 100644
--- a/dev-server-fela/src/App.res
+++ b/dev-server-fela/src/App.res
@@ -1,8 +1,8 @@
open Css
let renderer = createRenderer()
-renderGlobal(. renderer, "html, body", [margin(#zero), padding(#zero), backgroundColor(lavender)])
-renderRule(.
+renderGlobal(renderer, "html, body", [margin(#zero), padding(#zero), backgroundColor(lavender)])
+renderRule(
renderer,
".raw-css { display:block; background-color: green; width: 50px; height: 50px; }",
)
@@ -10,5 +10,11 @@ renderRule(.
switch ReactDOM.querySelector("#app") {
| None => ()
| Some(dom) =>
- ReactDOM.render( , dom)
+ dom
+ ->ReactDOM.Client.createRoot
+ ->ReactDOM.Client.Root.render(
+
+
+ ,
+ )
}
diff --git a/dev-server-fela/src/Demo.res b/dev-server-fela/src/Demo.res
index ca28cd0..a6925e7 100644
--- a/dev-server-fela/src/Demo.res
+++ b/dev-server-fela/src/Demo.res
@@ -1,20 +1,20 @@
open Css
-let fontItem = style(. [marginLeft(10->px), paddingRight(10->px), borderRight(1->px, solid, black)])
+let fontItem = style([marginLeft(10->px), paddingRight(10->px), borderRight(1->px, solid, black)])
let spin = renderer =>
- renderKeyframes(.
+ renderKeyframes(
renderer,
[(0, [transform(rotate(deg(0.)))]), (100, [transform(rotate(deg(360.)))])],
)
let scaleAnimation = renderer =>
- renderKeyframes(.
+ renderKeyframes(
renderer,
[(0, [transform(scale(0.3, 0.3))]), (100, [transform(scale(1.0, 1.0))])],
)
-let redBox = style(. [
+let redBox = style([
background(red),
borderBottom(5->px, solid, black),
width(50->px),
@@ -22,13 +22,13 @@ let redBox = style(. [
margin(10->px),
])
-let miniBox = style(. [border(2->px, solid, black), width(15->px), height(15->px), margin(1->px)])
+let miniBox = style([border(2->px, solid, black), width(15->px), height(15->px), margin(1->px)])
-let mergedStyles = merge(. [
- style(. [padding(0->px), fontSize(1->px)]),
- style(. [padding(20->px), fontSize(24->px), color(blue)]),
- style(. [media(. "(max-width: 768px)", [padding(10->px)])]),
- style(. [media(. "(max-width: 768px)", [fontSize(16->px), color(red)])]),
+let mergedStyles = merge([
+ style([padding(0->px), fontSize(1->px)]),
+ style([padding(20->px), fontSize(24->px), color(blue)]),
+ style([media("(max-width: 768px)", [padding(10->px)])]),
+ style([media("(max-width: 768px)", [fontSize(16->px), color(red)])]),
])
let differentHeightLengths = css =>
@@ -46,15 +46,15 @@ let differentHeightLengths = css =>
1.0->vmax,
1.0->vmin,
zero,
- ]->Belt.Array.map(x => {
- let className = css(. merge2(. redBox, style(. [height(x)])))
+ ]->Array.map(x => {
+ let className = css(merge2(redBox, style([height(x)])))
})
@react.component
let make = () => {
let {css, renderer, _} = CssReact.useFela()
- let cx = (baseStyle, rules) => css(. merge2(. baseStyle, style(. rules)))
+ let cx = (baseStyle, rules) => css(merge2(baseStyle, style(rules)))
let spinAnimationName = spin(renderer)
@@ -227,7 +227,7 @@ let make = () => {
("whitesmoke", whitesmoke),
("yellow", yellow),
("yellowgreen", yellowgreen),
- ]->Belt.Array.map(((name, value)) =>
+ ]->Array.map(((name, value)) =>
),
)}
@@ -346,18 +346,19 @@ let make = () => {
pct),
height(500->px),
display(grid),
gridTemplateColumns([150->px, auto, 150->px]),
gridTemplateRows([60->px, auto]),
]),
- )}>
+ )}
+ >
{
]),
)}
/>
-
+
{
gridTemplateColumns([50->px, auto]),
gridTemplateRows([40->px, auto]),
]),
- )}>
-
-
-
+ )}
+ >
+
+
+
{
)}
/>
-
-
+
+
{"grid auto direction row 1"->React.string}
-
+
{"grid auto direction row 2"->React.string}
px, #repeat(#num(2), 60->px)])]),
- )}>
-
+ className={css(
+ style([display(#grid), gridTemplateColumns([100->px, #repeat(#num(2), 60->px)])]),
+ )}
+ >
+
{"Grid track repeat"->React.string}
-
{"two times"->React.string}
-
{"three times"->React.string}
+
{"two times"->React.string}
+
{"three times"->React.string}
-
px)]))}>
-
+
px)]))}>
+
{"Grid auto columns (100px)"->React.string}
-
{"100px"->React.string}
-
{"100px"->React.string}
+
{"100px"->React.string}
+
{"100px"->React.string}
*", [marginBottom(10->px), width(100.->pct)]),
+ selector("& > *", [marginBottom(10->px), width(100.->pct)]),
]),
- )}>
+ )}
+ >
+ )}
+ >
-
+ )}
+ >
+
px), width(50->px)])} />
-
+
-
+ )}
+ >
+
px), width(50->px)])} />
-
+
-
+ )}
+ >
+
px), width(50->px)])} />
-
+
-
+ )}
+ >
+
px), width(50->px)])} />
-
+
@@ -672,20 +682,20 @@ let make = () => {
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
{
pt),
@@ -785,14 +795,16 @@ let make = () => {
wordSpacing(20->px),
wordWrap(breakWord),
]),
- )}>
+ )}
+ >
{"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."->React.string}
- pct)]))}> {"Named Font weights"->React.string}
+ pct)]))}> {"Named Font weights"->React.string}
px), borderRight(1->px, solid, black)]),
- )}>
+ className={css(
+ style([fontWeight(thin), paddingRight(10->px), borderRight(1->px, solid, black)]),
+ )}
+ >
{"thin"->React.string}
@@ -860,8 +872,8 @@ let make = () => {
{"inherit"->React.string}
{
/>
{"unset"->React.string}
{
/>
-
+
{"This is a bunch of text split into columns
using the CSS `column-count` property. The text
is equally distributed over the columns."->React.string}
@@ -892,19 +904,19 @@ let make = () => {
- px), overflow(scroll), resize(horizontal)]))}>
+
px), overflow(scroll), resize(horizontal)]))}>
{"Resizable div (horizontal)"->React.string}
-
px), overflow(scroll), resize(vertical)]))}>
+
px), overflow(scroll), resize(vertical)]))}>
{"Resizable div (vertical)"->React.string}
{
border(1->px, solid, black),
]),
]),
- )}>
+ )}
+ >
{"none"->React.string}
{
border(1->px, solid, black),
]),
]),
- )}>
+ )}
+ >
{"normal"->React.string}
- px)]))}>
+
px),
after([
@@ -967,12 +982,13 @@ let make = () => {
border(1->px, solid, black),
]),
]),
- )}>
+ )}
+ >
{"empty content"->React.string}
px),
paddingLeft(20->px),
@@ -986,48 +1002,53 @@ let make = () => {
border(1->px, solid, black),
]),
]),
- )}>
+ )}
+ >
{"external "->React.string}
px /* for test */),
counterReset(Types.CounterReset.reset("foo", ~value=1)),
before([contentRule(Types.Counter.counter("foo")), border(1->px, solid, black)]),
]),
- )}>
+ )}
+ >
{"counter"->React.string}
px)]),
- )}>
+ className={css(
+ style([counterReset(Types.CounterReset.reset("foo", ~value=1)), marginLeft(20->px)]),
+ )}
+ >
px, solid, black),
]),
]),
- )}>
+ )}
+ >
{"counters"->React.string}
px),
before([contentRule(#attr("class")), border(1->px, solid, black)]),
]),
- )}>
+ )}
+ >
{"attr"->React.string}
px),
before([
contentRule(linearGradient(deg(45.), [(zero, red), (100.->pct, blue)])),
@@ -1037,27 +1058,30 @@ let make = () => {
width(18->px),
]),
]),
- )}>
+ )}
+ >
{"linear gradient"->React.string}
px),
before([
contentRules([#openQuote, #text("foo"), #closeQuote]),
border(1->px, solid, black),
]),
]),
- )}>
+ )}
+ >
{"contents (quotes)"->React.string}
- {"Render a green square --> "->React.string}
+ {"Render a green square --> "->React.string}
+
- {"Merged"->React.string}
+ {"Merged"->React.string}
px)])])} />
@@ -1084,34 +1108,36 @@ let make = () => {
],
)}
/>
-
-
+
+
+
+
-
-
{"1"->React.string}
-
{"2"->React.string}
-
{"3"->React.string}
-
{"4"->React.string}
+
+
{"1"->React.string}
+
{"2"->React.string}
+
{"3"->React.string}
+
{"4"->React.string}
-
-
{"1"->React.string}
-
{"2"->React.string}
-
{"3"->React.string}
-
{"4"->React.string}
+
+
{"1"->React.string}
+
{"2"->React.string}
+
{"3"->React.string}
+
{"4"->React.string}
-
-
{"1"->React.string}
-
{"2"->React.string}
-
{"3"->React.string}
-
{"4"->React.string}
+
+
{"1"->React.string}
+
{"2"->React.string}
+
{"3"->React.string}
+
{"4"->React.string}
diff --git a/dev-server-fela/src/Section.res b/dev-server-fela/src/Section.res
index 04b282e..db0fd34 100644
--- a/dev-server-fela/src/Section.res
+++ b/dev-server-fela/src/Section.res
@@ -9,11 +9,8 @@ module Styles = {
(),
)
- let section = style(. [
- selector(.
- "& > h1",
- [fontFamily(#custom(arialNarrow)), fontWeight(#num(300)), marginTop(#zero)],
- ),
+ let section = style([
+ selector("& > h1", [fontFamily(#custom(arialNarrow)), fontWeight(#num(300)), marginTop(#zero)]),
position(#relative),
background(hex("f5f5f5")),
margin(px(20)),
@@ -25,14 +22,15 @@ module Styles = {
]),
])
- let rowLayout = style(. [display(#flex), flexDirection(#row), flexWrap(#wrap)])
+ let rowLayout = style([display(#flex), flexDirection(#row), flexWrap(#wrap)])
}
@react.component
let make = (~name, ~children) => {
let {css, _} = CssReact.useFela()
-
- {name->React.string} children
+
+ {name->React.string}
+ children
}
diff --git a/yarn.lock b/yarn.lock
index 3c721d8..7e71eec 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1025,13 +1025,55 @@ __metadata:
languageName: node
linkType: hard
-"@rescript/react@npm:^0.10.0":
- version: 0.10.3
- resolution: "@rescript/react@npm:0.10.3"
+"@rescript/darwin-arm64@npm:12.2.0":
+ version: 12.2.0
+ resolution: "@rescript/darwin-arm64@npm:12.2.0"
+ conditions: os=darwin & cpu=arm64
+ languageName: node
+ linkType: hard
+
+"@rescript/darwin-x64@npm:12.2.0":
+ version: 12.2.0
+ resolution: "@rescript/darwin-x64@npm:12.2.0"
+ conditions: os=darwin & cpu=x64
+ languageName: node
+ linkType: hard
+
+"@rescript/linux-arm64@npm:12.2.0":
+ version: 12.2.0
+ resolution: "@rescript/linux-arm64@npm:12.2.0"
+ conditions: os=linux & cpu=arm64
+ languageName: node
+ linkType: hard
+
+"@rescript/linux-x64@npm:12.2.0":
+ version: 12.2.0
+ resolution: "@rescript/linux-x64@npm:12.2.0"
+ conditions: os=linux & cpu=x64
+ languageName: node
+ linkType: hard
+
+"@rescript/react@npm:^0.14.0":
+ version: 0.14.1
+ resolution: "@rescript/react@npm:0.14.1"
peerDependencies:
- react: ">=16.8.1"
- react-dom: ">=16.8.1"
- checksum: 10/feb9ab6114bcc6ea3a8e0893cfb7685455c3cff01e86b527396ad37696a42d93760a96eb501525389004b4dbad429d3376f5bafa4301d463689f5d01dc436b92
+ react: ">=19.1.0"
+ react-dom: ">=19.1.0"
+ checksum: 10/071053c681913a78e93c1985ab94bb27dc9ebb71b7dada61286ae48ae2d922b23e6d8f5366002ce60df7e05b6e6305e0ac038108620ee1c6e6770a00b88c42db
+ languageName: node
+ linkType: hard
+
+"@rescript/runtime@npm:12.2.0":
+ version: 12.2.0
+ resolution: "@rescript/runtime@npm:12.2.0"
+ checksum: 10/285c40966d7b4c38e9cc3a4e0752e0e1d0c5558e6a3593248516523a7b2fb608f27f87bf7523062d098422f03c7a7c4d257985a31093a44993628e894ea96521
+ languageName: node
+ linkType: hard
+
+"@rescript/win32-x64@npm:12.2.0":
+ version: 12.2.0
+ resolution: "@rescript/win32-x64@npm:12.2.0"
+ conditions: os=win32 & cpu=x64
languageName: node
linkType: hard
@@ -2041,11 +2083,11 @@ __metadata:
resolution: "bs-css-dom@workspace:bs-css-dom"
dependencies:
bs-css: "npm:18.1.1"
- rescript: "npm:^9.0.0"
+ rescript: "npm:^12.0.0"
peerDependencies:
- "@rescript/react": ^0.10.0
- react: ^17.0.0
- react-dom: ^17.0.0
+ "@rescript/react": ^0.14.0
+ react: ^19.0.0
+ react-dom: ^19.0.0
languageName: unknown
linkType: soft
@@ -2056,7 +2098,7 @@ __metadata:
"@emotion/cache": "npm:^11.0.0"
"@emotion/css": "npm:^11.0.0"
bs-css: "npm:18.1.1"
- rescript: "npm:^9.0.0"
+ rescript: "npm:^12.0.0"
languageName: unknown
linkType: soft
@@ -2065,10 +2107,10 @@ __metadata:
resolution: "bs-css-fela@workspace:bs-css-fela"
dependencies:
bs-css: "npm:18.1.1"
- fela: "npm:^11.0.0"
- react: "npm:^17.0.0"
- react-fela: "npm:^11.0.0"
- rescript: "npm:^9.0.0"
+ fela: "npm:^12.2.0"
+ react: "npm:^19.0.0"
+ react-fela: "npm:^12.2.0"
+ rescript: "npm:^12.0.0"
languageName: unknown
linkType: soft
@@ -2077,7 +2119,7 @@ __metadata:
resolution: "bs-css@workspace:bs-css"
dependencies:
jest: "npm:^30.0.0"
- rescript: "npm:^9.0.0"
+ rescript: "npm:^12.0.0"
languageName: unknown
linkType: soft
@@ -2532,16 +2574,16 @@ __metadata:
version: 0.0.0-use.local
resolution: "dev-server-dom@workspace:dev-server-dom"
dependencies:
- "@rescript/react": "npm:^0.10.0"
+ "@rescript/react": "npm:^0.14.0"
"@rspack/cli": "npm:^1.4.0"
"@rspack/core": "npm:^1.4.0"
"@rspack/plugin-react-refresh": "npm:^1.4.0"
bs-css: "npm:^18.0.0"
bs-css-dom: "npm:^6.0.0"
- react: "npm:^17.0.0"
- react-dom: "npm:^17.0.0"
- react-refresh: "npm:^0.17.0"
- rescript: "npm:^9.0.0"
+ react: "npm:^19.0.0"
+ react-dom: "npm:^19.0.0"
+ react-refresh: "npm:^0.18.0"
+ rescript: "npm:^12.0.0"
languageName: unknown
linkType: soft
@@ -2549,16 +2591,16 @@ __metadata:
version: 0.0.0-use.local
resolution: "dev-server-emotion@workspace:dev-server-emotion"
dependencies:
- "@rescript/react": "npm:^0.10.0"
+ "@rescript/react": "npm:^0.14.0"
"@rspack/cli": "npm:^1.4.0"
"@rspack/core": "npm:^1.4.0"
"@rspack/plugin-react-refresh": "npm:^1.4.0"
bs-css: "npm:^18.0.0"
bs-css-emotion: "npm:^7.0.0"
- react: "npm:^17.0.0"
- react-dom: "npm:^17.0.0"
- react-refresh: "npm:^0.17.0"
- rescript: "npm:^9.0.0"
+ react: "npm:^19.0.0"
+ react-dom: "npm:^19.0.0"
+ react-refresh: "npm:^0.18.0"
+ rescript: "npm:^12.0.0"
languageName: unknown
linkType: soft
@@ -2566,15 +2608,15 @@ __metadata:
version: 0.0.0-use.local
resolution: "dev-server-fela@workspace:dev-server-fela"
dependencies:
- "@rescript/react": "npm:^0.10.0"
+ "@rescript/react": "npm:^0.14.0"
bs-css: "npm:^18.0.0"
bs-css-fela: "npm:^5.0.0"
esbuild: "npm:^0.9.0"
- fela: "npm:^11.0.0"
- react: "npm:^17.0.0"
- react-dom: "npm:^17.0.0"
- react-fela: "npm:^11.0.0"
- rescript: "npm:^9.0.0"
+ fela: "npm:^12.2.0"
+ react: "npm:^19.0.0"
+ react-dom: "npm:^19.0.0"
+ react-fela: "npm:^12.2.0"
+ rescript: "npm:^12.0.0"
languageName: unknown
linkType: soft
@@ -2935,67 +2977,67 @@ __metadata:
languageName: node
linkType: hard
-"fela-bindings@npm:^11.7.0":
- version: 11.7.0
- resolution: "fela-bindings@npm:11.7.0"
+"fela-bindings@npm:^12.2.1":
+ version: 12.2.1
+ resolution: "fela-bindings@npm:12.2.1"
dependencies:
fast-loops: "npm:^1.0.0"
- fela-dom: "npm:^11.7.0"
- fela-tools: "npm:^11.7.0"
- react-addons-shallow-compare: "npm:^15.6.2"
+ fela-dom: "npm:^12.2.1"
+ fela-tools: "npm:^12.2.1"
+ react-addons-shallow-compare: "npm:^15.6.3"
shallow-equal: "npm:^1.0.0"
peerDependencies:
fela: "*"
- checksum: 10/eeb538370ff2e34e7f023bc0d5adc20ac10db03fed5d223a9ba2f02a8d27faa4a2c298c39058e449d13e4ada6cd1b85de74ce050c15b35921f9493017f6353e0
+ checksum: 10/950598a3cc4db84e12b6f5dfbb544b7b508b3e1ac7fa379b83d4878067b0fd10793d3405d069e1e32646887dec0016a2e77d2a373af186d0af93cb86152d27a3
languageName: node
linkType: hard
-"fela-dom@npm:^11.7.0":
- version: 11.7.0
- resolution: "fela-dom@npm:11.7.0"
+"fela-dom@npm:^12.2.1":
+ version: 12.2.1
+ resolution: "fela-dom@npm:12.2.1"
dependencies:
css-in-js-utils: "npm:^3.0.0"
fast-loops: "npm:^1.0.1"
- fela-utils: "npm:^11.7.0"
+ fela-utils: "npm:^12.2.1"
sort-css-media-queries: "npm:^1.4.3"
- checksum: 10/ea5668c7b05878e5346a7a904ea4458e8d24841bcf55fb3bac79cde6808ed5dde4c34dce61ef6c92ccf015a23e007289ea9dbca01e118d190b72f720551ac26c
+ checksum: 10/f6ffc67c1213fefb5560337c44d16afdb337890310cf36e2e4c215b85f0c6abc9979e668713eb4c8048168b6d4c8e676e3a28f9f13f5b2c3312156baccf2f5c2
languageName: node
linkType: hard
-"fela-tools@npm:^11.7.0":
- version: 11.7.0
- resolution: "fela-tools@npm:11.7.0"
+"fela-tools@npm:^12.2.1":
+ version: 12.2.1
+ resolution: "fela-tools@npm:12.2.1"
dependencies:
css-in-js-utils: "npm:^3.0.0"
fast-loops: "npm:^1.0.0"
- fela: "npm:^11.7.0"
- fela-utils: "npm:^11.7.0"
+ fela: "npm:^12.2.1"
+ fela-utils: "npm:^12.2.1"
peerDependencies:
- fela: ^11.2.0
- checksum: 10/311afc8133f9dec18705f202c1c390ec1d2d3a172443196e598f954d2aa734c7713d691182fe9e72366f65185ae7e9ca443aa2d8dfc7cf80fe689b26b805fb09
+ fela: ">=11"
+ checksum: 10/9d65dc39c1cae0d3bb3b51d3b7096e40f48bc1120440cc0cac51db401ad7c00ab2f38e6069fb57aeab8478647c9f7175cde51de8e61df1adbeadd3a1deb6aa2e
languageName: node
linkType: hard
-"fela-utils@npm:^11.7.0":
- version: 11.7.0
- resolution: "fela-utils@npm:11.7.0"
+"fela-utils@npm:^12.2.1":
+ version: 12.2.1
+ resolution: "fela-utils@npm:12.2.1"
dependencies:
css-in-js-utils: "npm:^3.0.0"
fast-loops: "npm:^1.0.0"
- checksum: 10/2a29397d9cc804269f1b21b50d5465e9027e6cc2176ff3583d9839eb5580b0878ea3af0f3f2e9e5a59fb70c0318f72c3c44d1878b313b4358724495976f7558c
+ checksum: 10/dbea11d9c10d899cc78057875cb7b6cb6db986b19577768b6839b276c38fd396d3987d59f488df21d16b9b6c3fd6ce8c55e173b2025a9b53d1eb96569e6e9bbb
languageName: node
linkType: hard
-"fela@npm:^11.0.0, fela@npm:^11.7.0":
- version: 11.7.0
- resolution: "fela@npm:11.7.0"
+"fela@npm:^12.2.0, fela@npm:^12.2.1":
+ version: 12.2.1
+ resolution: "fela@npm:12.2.1"
dependencies:
css-in-js-utils: "npm:^3.0.0"
csstype: "npm:^3.0.5"
fast-loops: "npm:^1.0.0"
- fela-utils: "npm:^11.7.0"
+ fela-utils: "npm:^12.2.1"
isobject: "npm:^3.0.1"
- checksum: 10/a5fa9f9b8c19768d61e0ab10628665f26067c9a41c5751c0652be8467b1a5c93512f7de2289ecdfbf172216b23f3bac6a24eb9a7d32a08566547cc987faf166f
+ checksum: 10/945e285cf561b878beea8dddd993144ba8b719a6c6db05d148a87f533dcea6103021a2e8e6190d124f5f52039fe3dc208b1d8bcdcdcf6e67ee5701a1a59e5111
languageName: node
linkType: hard
@@ -4249,7 +4291,7 @@ __metadata:
languageName: node
linkType: hard
-"loose-envify@npm:^1.1.0, loose-envify@npm:^1.4.0":
+"loose-envify@npm:^1.4.0":
version: 1.4.0
resolution: "loose-envify@npm:1.4.0"
dependencies:
@@ -5000,7 +5042,7 @@ __metadata:
languageName: node
linkType: hard
-"react-addons-shallow-compare@npm:^15.6.2":
+"react-addons-shallow-compare@npm:^15.6.3":
version: 15.6.3
resolution: "react-addons-shallow-compare@npm:15.6.3"
dependencies:
@@ -5009,30 +5051,28 @@ __metadata:
languageName: node
linkType: hard
-"react-dom@npm:^17.0.0":
- version: 17.0.2
- resolution: "react-dom@npm:17.0.2"
+"react-dom@npm:^19.0.0":
+ version: 19.2.4
+ resolution: "react-dom@npm:19.2.4"
dependencies:
- loose-envify: "npm:^1.1.0"
- object-assign: "npm:^4.1.1"
- scheduler: "npm:^0.20.2"
+ scheduler: "npm:^0.27.0"
peerDependencies:
- react: 17.0.2
- checksum: 10/0b3836131a64da8b1c2c852cc28b09c21a738c33c7a8d6021ac20d5619d753c8ee5fff8f97c95f2fc33053e44c2cbce9657453e21c55900164e6e0c3e955e826
+ react: ^19.2.4
+ checksum: 10/ec17721a8cb131bc33480a9f738bc5bbfe4bd11b11cf69f3f473605346578a329ad26ceef6ef0761ea67a4b455803407dd7ed4ba3d8a5abd2cee8c32d221e498
languageName: node
linkType: hard
-"react-fela@npm:^11.0.0":
- version: 11.7.0
- resolution: "react-fela@npm:11.7.0"
+"react-fela@npm:^12.2.0":
+ version: 12.2.1
+ resolution: "react-fela@npm:12.2.1"
dependencies:
- fela-bindings: "npm:^11.7.0"
- fela-dom: "npm:^11.7.0"
+ fela-bindings: "npm:^12.2.1"
+ fela-dom: "npm:^12.2.1"
prop-types: "npm:^15.5.8"
peerDependencies:
- fela: ">= 11.3.1"
- react: ">= 16.3.0"
- checksum: 10/7135e2f17aa1f1c8a18b36b0b0ffd41ae82f8697aadfac1abcfbaf104bb35858bacd411b5f7ec6dd1d6d5d90dcdc8df4bab2d096eecbf6f0262d27f103df9e1b
+ fela: ">=11.3"
+ react: "*"
+ checksum: 10/a5542617959f7c6646ae58066010eeff709a0ac595b399d16b65b2592bb9d8a313e4152a896d4cd94dee8bf6c04a6762208883cd1a56490d3819224951fd8649
languageName: node
linkType: hard
@@ -5050,20 +5090,17 @@ __metadata:
languageName: node
linkType: hard
-"react-refresh@npm:^0.17.0":
- version: 0.17.0
- resolution: "react-refresh@npm:0.17.0"
- checksum: 10/5e94f07d43bb1cfdc9b0c6e0c8c73e754005489950dcff1edb53aa8451d1d69a47b740b195c7c80fb4eb511c56a3585dc55eddd83f0097fb5e015116a1460467
+"react-refresh@npm:^0.18.0":
+ version: 0.18.0
+ resolution: "react-refresh@npm:0.18.0"
+ checksum: 10/504c331c19776bf8320c23bad7f80b3a28de03301ed7523b0dd21d3f02bf2b53bbdd5aa52469b187bc90f358614b2ba303c088a0765c95f4f0a68c43a7d67b1d
languageName: node
linkType: hard
-"react@npm:^17.0.0":
- version: 17.0.2
- resolution: "react@npm:17.0.2"
- dependencies:
- loose-envify: "npm:^1.1.0"
- object-assign: "npm:^4.1.1"
- checksum: 10/ece60c31c1d266d132783aaaffa185d2e4c9b4db144f853933ec690cee1e0600c8929a1dd0a9e79323eea8e2df636c9a06d40f6cfdc9f797f65225433e67f707
+"react@npm:^19.0.0":
+ version: 19.2.4
+ resolution: "react@npm:19.2.4"
+ checksum: 10/18179fe217f67eb2d0bc61cd04e7ad3c282ea09a1dface7eacd71816f62609f4bbf566c447c704335284deb8397b00bca084e0cd60e6f437279a7498e2d0bfe0
languageName: node
linkType: hard
@@ -5132,15 +5169,34 @@ __metadata:
languageName: node
linkType: hard
-"rescript@npm:^9.0.0":
- version: 9.1.4
- resolution: "rescript@npm:9.1.4"
+"rescript@npm:^12.0.0":
+ version: 12.2.0
+ resolution: "rescript@npm:12.2.0"
+ dependencies:
+ "@rescript/darwin-arm64": "npm:12.2.0"
+ "@rescript/darwin-x64": "npm:12.2.0"
+ "@rescript/linux-arm64": "npm:12.2.0"
+ "@rescript/linux-x64": "npm:12.2.0"
+ "@rescript/runtime": "npm:12.2.0"
+ "@rescript/win32-x64": "npm:12.2.0"
+ dependenciesMeta:
+ "@rescript/darwin-arm64":
+ optional: true
+ "@rescript/darwin-x64":
+ optional: true
+ "@rescript/linux-arm64":
+ optional: true
+ "@rescript/linux-x64":
+ optional: true
+ "@rescript/win32-x64":
+ optional: true
bin:
- bsc: bsc
- bsrefmt: bsrefmt
- bstracing: lib/bstracing
- rescript: rescript
- checksum: 10/6db107c46be77368c99561d904791ced0b2e1dcf58110455314531e66f3ae6a96e157e4d7fc844ae5293735ab9cba9af8ab3351e2bdf0525693ace7a566acb14
+ bsc: cli/bsc.js
+ bstracing: cli/bstracing.js
+ rescript: cli/rescript.js
+ rescript-legacy: cli/rescript-legacy.js
+ rescript-tools: cli/rescript-tools.js
+ checksum: 10/cf2d1646c1b0fb9d34b4d2cfc2a9180c506829a35bf9b7bdabc129844461decad71723759d1753eebf4bdb8fc92c0f90ce1c62114c6ae7aa8a16c589454c0b25
languageName: node
linkType: hard
@@ -5241,13 +5297,10 @@ __metadata:
languageName: node
linkType: hard
-"scheduler@npm:^0.20.2":
- version: 0.20.2
- resolution: "scheduler@npm:0.20.2"
- dependencies:
- loose-envify: "npm:^1.1.0"
- object-assign: "npm:^4.1.1"
- checksum: 10/898917fa475386953d998add9107c04bf2c335eee86172833995dee126d12a68bee3c29edbd61fa0bcbcb8ee511c422eaab23b86b02f95aab26ecfaed8df5e64
+"scheduler@npm:^0.27.0":
+ version: 0.27.0
+ resolution: "scheduler@npm:0.27.0"
+ checksum: 10/eab3c3a8373195173e59c147224fc30dabe6dd453f248f5e610e8458512a5a2ee3a06465dc400ebfe6d35c9f5b7f3bb6b2e41c88c86fd177c25a73e7286a1e06
languageName: node
linkType: hard