diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a3934e24..3fb3db0b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -14,9 +14,9 @@ jobs:
matrix:
include:
- java: 16
- scala: 2
- - java: 8
scala: 3
+ - java: 8
+ scala: 2
steps:
- name: Git checkout
diff --git a/.gitignore b/.gitignore
index ab7bdcc5..b1d764b4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,3 +18,4 @@ doc/_book
project/sjsincoptbench.sbt
project/metals.sbt
.bsp
+/package-lock.json
diff --git a/bench/react-with/src/demo.scala b/bench/react-with/src/demo.scala
index 75f5006a..54717d6c 100644
--- a/bench/react-with/src/demo.scala
+++ b/bench/react-with/src/demo.scala
@@ -56,10 +56,10 @@ object Demo {
)
)
}
-
+ import scalacss.internal.mutable.Mutex.mutex
val TodoApp = ScalaComponent.builder[Unit]
.initialState(State(Nil, ""))
- .renderBackend[Backend]
+ .render_C()
.build
}
diff --git a/bin/generate-aliases b/bin/generate-aliases
index b26bff0c..555da05c 100755
--- a/bin/generate-aliases
+++ b/bin/generate-aliases
@@ -1,4 +1,4 @@
-#!/bin/env scala
+#!/bin/bash scala
val infile = "core/shared/src/main/scala/scalacss/internal/Attrs.scala"
val outfile = "core/shared/src/main/scala/scalacss/internal/generated.scala"
diff --git a/build.sbt b/build.sbt
index 38ca004a..250cede0 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,12 +1,14 @@
-name := "ScalaCSS"
+import javax.print.attribute.DateTimeSyntax
+name := "ScalaCSS"
+scalaVersion := "3.8.4"
ThisBuild / homepage := Some(url("https://github.com/japgolly/scalacss"))
ThisBuild / licenses += ("Apache-2.0", url("http://opensource.org/licenses/Apache-2.0"))
-ThisBuild / organization := "com.github.japgolly.scalacss"
+ThisBuild / organization := "com.github.gmixa.scalacss"
ThisBuild / shellPrompt := ((s: State) => Project.extract(s).currentRef.project + "> ")
ThisBuild / startYear := Some(2015)
ThisBuild / versionScheme := Some("early-semver")
-
+Test / fork := false
// Mutability & NameGen causes occasional test failures
ThisBuild / parallelExecution := false
diff --git a/core/js/src/main/scala-3/scalacss/internal/ModeMacros.scala b/core/js/src/main/scala-3/scalacss/internal/ModeMacros.scala
index 539835ff..6d1d9868 100644
--- a/core/js/src/main/scala-3/scalacss/internal/ModeMacros.scala
+++ b/core/js/src/main/scala-3/scalacss/internal/ModeMacros.scala
@@ -28,28 +28,24 @@ object ModeMacros {
def fail(msg: String): Nothing =
report.throwError(msg)
- type S = Exports with mutable.Settings
- val expr: Expr[S] =
- readConfig("scalacss.mode") match {
+ readConfig("scalacss.mode") match {
- case None =>
- '{
- if (_root_.scala.scalajs.LinkingInfo.developmentMode)
- _root_.scalacss.DevDefaults
- else
- _root_.scalacss.ProdDefaults
- }
+ case None =>
+ '{
+ if (_root_.scala.scalajs.LinkingInfo.developmentMode)
+ _root_.scalacss.DevDefaults
+ else
+ _root_.scalacss.ProdDefaults
+ }
- case Some("dev") =>
- '{ scalacss.DevDefaults }
+ case Some("dev") =>
+ '{ scalacss.DevDefaults }
- case Some("prod") =>
- '{ scalacss.ProdDefaults }
+ case Some("prod") =>
+ '{ scalacss.ProdDefaults }
- case Some(x) =>
- fail(s"Unrecognise option for scalacss.mode: $x. Legal values are 'dev' and 'prod'.")
- }
-
- Inlined(None, Nil, expr.asTerm).asExprOf[S]
+ case Some(x) =>
+ fail(s"Unrecognise option for scalacss.mode: $x. Legal values are 'dev' and 'prod'.")
+ }
}
}
diff --git a/core/shared/src/main/scala/scalacss/internal/generated.scala b/core/shared/src/main/scala/scalacss/internal/generated.scala
index e510e5ec..a5abd7cd 100644
--- a/core/shared/src/main/scala/scalacss/internal/generated.scala
+++ b/core/shared/src/main/scala/scalacss/internal/generated.scala
@@ -970,6 +970,12 @@ abstract class AttrAliasesAndValueTRules extends ValueT.Rules {
* @see MDN
*/
@inline final def justifyContent = Attrs.justifyContent
+ /**
+ * The CSS justify-items property defines the default justify-self for all items of the box, giving them all a default way of justifying each box along the appropriate axis.
+ *
+ * @see MDN
+ */
+ @inline final def justifyItems = Attrs.justifyItems
/**
* The CSS justify-self property sets the way a box is justified inside its alignment container along the appropriate axis.
*
diff --git a/core/shared/src/test/scala/scalacss/full/DefaultsTest.scala b/core/shared/src/test/scala/scalacss/full/DefaultsTest.scala
index 0c0028eb..1139cd23 100644
--- a/core/shared/src/test/scala/scalacss/full/DefaultsTest.scala
+++ b/core/shared/src/test/scala/scalacss/full/DefaultsTest.scala
@@ -4,11 +4,13 @@ import japgolly.microlibs.testutil.TestUtil._
import scalacss._
import utest._
+import scala.language.postfixOps
+
object DefaultsTest extends TestSuite {
override def tests = Tests {
- "dev" - Dev .test()
- "prod" - Prod.test()
+ test("dev") - Dev .test()
+ test("prod") - Prod.test()
}
class SharedStyles(implicit reg: StyleSheet.Register) extends StyleSheet.Inline {
diff --git a/core/shared/src/test/scala/scalacss/full/InlineTest.scala b/core/shared/src/test/scala/scalacss/full/InlineTest.scala
index 4752b344..854f0c36 100644
--- a/core/shared/src/test/scala/scalacss/full/InlineTest.scala
+++ b/core/shared/src/test/scala/scalacss/full/InlineTest.scala
@@ -3,6 +3,8 @@ package scalacss.full
import scala.concurrent.duration._
import scalacss.DevDefaults._
+import scala.language.postfixOps
+
//object CopyDefaultsForInline extends Defaults
//import CopyDefaultsForInline._
@@ -300,7 +302,7 @@ object InlineTest extends utest.TestSuite {
def norm(css: String) = css.trim
override def tests = Tests {
- "css1" - assertMultiline(norm(MyInline.render), norm(
+ test("css1") - assertMultiline(norm(MyInline.render), norm(
"""
|.manual {
| margin: 12px;
@@ -393,7 +395,7 @@ object InlineTest extends utest.TestSuite {
|}
""".stripMargin))
- "css2" - assertMultiline(norm(MyInline2.render), norm(
+ test("css2") - assertMultiline(norm(MyInline2.render), norm(
"""
|.MyInline2-sb2 {
| margin-top: inherit;
@@ -472,7 +474,7 @@ object InlineTest extends utest.TestSuite {
|}
""".stripMargin))
- "css3" - assertMultiline(norm(MyInline3.render), norm(
+ test("css3") - assertMultiline(norm(MyInline3.render), norm(
"""
|.MyInline3-dup1b {
| word-break: break-all;
@@ -533,55 +535,55 @@ object InlineTest extends utest.TestSuite {
|}
""".stripMargin))
- "classnames" - {
- "manual" - assertEq(MyInline.noMacrosOrClassnameHintHere.htmlClass, "manual")
+ test("classnames") - {
+ test("manual") - assertEq(MyInline.noMacrosOrClassnameHintHere.htmlClass, "manual")
- "manualF" - {
+ test("manualF") - {
assertEq(MyInline3.innerObject.mybool(true).htmlClass, "blah-t")
assertEq(MyInline3.innerObject.mybool(false).htmlClass, "blah-f")
}
- "everythingOk" - {
+ test("everythingOk") - {
assertEq(MyInline2.everythingOk(true) .htmlClass, "MyInline2-everythingOk-t")
assertEq(MyInline2.everythingOk(false).htmlClass, "MyInline2-everythingOk-f")
}
- "indent" - {
+ test("indent") - {
assertEq(MyInline2.indent(2).htmlClass, "MyInline2-indent-2")
assertEq(MyInline2.indent(3).htmlClass, "MyInline2-indent-3")
assertEq(MyInline2.indent(4).htmlClass, "MyInline2-indent-4")
}
- "opbool" - {
+ test("opbool") - {
assertEq(MyInline2.opbool(None) .htmlClass, "MyInline2-opbool-1")
assertEq(MyInline2.opbool(Some(true)) .htmlClass, "MyInline2-opbool-2")
assertEq(MyInline2.opbool(Some(false)).htmlClass, "MyInline2-opbool-3")
}
- "sb1" - assertEq(MyInline2.sb1.htmlClass, "btn btn-default")
- "sb2" - assertEq(MyInline2.sb2.htmlClass, "MyInline2-sb2 btn btn-default")
+ test("sb1") - assertEq(MyInline2.sb1.htmlClass, "btn btn-default")
+ test("sb2") - assertEq(MyInline2.sb2.htmlClass, "MyInline2-sb2 btn btn-default")
- "empty" - assertEq(MyInline.empty.htmlClass, "MyInline-0001")
+ test("empty") - assertEq(MyInline.empty.htmlClass, "MyInline-0001")
- "wth" - assertEq(MyInline2.`what the hell??`.htmlClass, "MyInline2-what_the_hell__")
+ test("wth") - assertEq(MyInline2.`what the hell??`.htmlClass, "MyInline2-what_the_hell__")
- "dup1" - {
+ test("dup1") - {
assertEq(MyInline3.dup1a.htmlClass, "MyInline3-dup1b")
assertEq(MyInline3.dup1b.htmlClass, "MyInline3-dup1b-2")
}
- "dup2" - {
+ test("dup2") - {
assertEq(MyInline3.dup2a.htmlClass, "MyInline3-dup2c")
assertEq(MyInline3.dup2b.htmlClass, "MyInline3-dup2c-2")
assertEq(MyInline3.dup2c.htmlClass, "MyInline3-dup2c-3")
}
- "innerObject_1" - assertEq(MyInline3.innerObject.depth1.htmlClass, "MyInline3-innerObject-depth1")
- "innerObject_2" - assertEq(MyInline3.innerObject.andAgain.depth2.htmlClass, "MyInline3-innerObject-andAgain-depth2")
+ test("innerObject_1") - assertEq(MyInline3.innerObject.depth1.htmlClass, "MyInline3-innerObject-depth1")
+ test("innerObject_2") - assertEq(MyInline3.innerObject.andAgain.depth2.htmlClass, "MyInline3-innerObject-andAgain-depth2")
}
- "keyframes" - assertMultiline(norm(MyInlineWithKeyframes.render), norm("""
+ test("keyframes") - assertMultiline(norm(MyInlineWithKeyframes.render), norm("""
|@keyframes MyInlineWithKeyframes-kf1 {
| 0% {
| height: 100px;
@@ -648,7 +650,7 @@ object InlineTest extends utest.TestSuite {
|}
""".stripMargin))
- "complexCond" - assertMultiline(norm(MyInlineComplexCond.render), norm(
+ test("complexCond") - assertMultiline(norm(MyInlineComplexCond.render), norm(
""".manual {
| margin: 12px;
| padding: 0.5ex;
@@ -721,7 +723,7 @@ object InlineTest extends utest.TestSuite {
|}
""".stripMargin))
- "fontFaces" - assertMultiline(norm(MyInlineWithFontFace.render), norm("""
+ test("fontFaces") - assertMultiline(norm(MyInlineWithFontFace.render), norm("""
|@font-face {
| font-family: myFont;
| src: url(font.woff);
diff --git a/core/shared/src/test/scala/scalacss/full/ProdRenderInlineTest.scala b/core/shared/src/test/scala/scalacss/full/ProdRenderInlineTest.scala
index 9905dcad..1e50aca2 100644
--- a/core/shared/src/test/scala/scalacss/full/ProdRenderInlineTest.scala
+++ b/core/shared/src/test/scala/scalacss/full/ProdRenderInlineTest.scala
@@ -6,7 +6,7 @@ object ProdRenderInlineTest extends utest.TestSuite {
import japgolly.microlibs.testutil.TestUtil._
import utest._
- def test(_actual: String, _expect: String): Unit = {
+ def test2(_actual: String, _expect: String): Unit = {
def norm(css: String) = css.trim
val actual = norm(_actual)
val expect = norm(_expect)
@@ -20,11 +20,11 @@ object ProdRenderInlineTest extends utest.TestSuite {
}
override def tests = Tests {
- "css1" - test(MyInline .render, """.manual{margin:12px;padding:0.5ex;cursor:pointer;-moz-text-decoration-line:underline overline;text-decoration-line:underline overline;background-image:-moz-radial-gradient(5em circle at top left, yellow, blue);background-image:-o-radial-gradient(5em circle at top left, yellow, blue);background-image:-webkit-radial-gradient(5em circle at top left, yellow, blue);background-image:radial-gradient(5em circle at top left, yellow, blue);-ms-grid-template-areas:"main side";grid-template-areas:"main side"}.manual:hover{font-weight:normal;line-height:1em;padding:0;cursor:-moz-zoom-in;cursor:-o-zoom-in;cursor:-webkit-zoom-in;cursor:zoom-in}.manual:not(:first-child):visited{-moz-animation-delay:60s,50ms;-o-animation-delay:60s,50ms;-webkit-animation-delay:60s,50ms;animation-delay:60s,50ms;font-weight:bold;font:inherit}.manual nav.debug{background-color:#f88;color:black !important}.manual nav.debug h1{line-height:97.5%;font-size:150%}blockquote:before, blockquote:after{content:'';content:none}.DEBUG{border-color:#080}.MyInline-condMixinP:hover{display:block;color:red}@media not handheld and (orientation:landscape) and (color){.manual{padding-left:500px;padding-right:500px}}@media tv and (min-device-aspect-ratio:3/4), all and (resolution:300dpi){.manual{margin-top:10em;margin-bottom:10em}}@media (max-width:100px){.MyInline-medianess{color:brown}.MyInline-medianess span{background-color:yellow}.MyInline-condMixinP:hover{margin:auto}.MyInline-condMixinQ{display:block;margin:auto}.MyInline-condMixinQ:hover{color:red}}""")
- "css2" - test(MyInline2 .render, ".MyInline2-sb2{margin-top:inherit}.MyInline2-everythingOk-t{background-color:green;max-width:80ex}.MyInline2-everythingOk-f{background-color:red;max-width:80ex}.MyInline2-indent-2{padding-left:8ex;color:blue}.MyInline2-indent-3{padding-left:12ex;color:red;margin-top:1em}.MyInline2-indent-4{padding-left:16ex;margin-top:1em}.MyInline2-opbool-1{color:black}.MyInline2-opbool-2{color:green}.MyInline2-opbool-3{color:red}.MyInline2-what_the_hell__{visibility:hidden}@media (min-width:0){.MyInline2-mediaOrdering{margin:1px}}@media (min-width:576px){.MyInline2-mediaOrdering{margin:2px}}@media (min-width:768px){.MyInline2-mediaOrdering{margin:3px}}@media (min-width:992px){.MyInline2-mediaOrdering{margin:4px}}@media (min-width:1200px){.MyInline2-mediaOrdering{margin:5px}}")
- "css3" - test(MyInline3 .render, """.MyInline3-dup1b{word-break:break-all}.MyInline3-dup1b-2{word-break:keep-all}.MyInline3-dup2c{vertical-align:top}.MyInline3-dup2c-2{vertical-align:middle}.MyInline3-dup2c-3{vertical-align:bottom}.MyInline3-attr01{background-repeat:no-repeat}.MyInline3-attr02{background-repeat:round}.MyInline3-attr03{background-repeat:repeat space}.MyInline3-attr04{initial-letter:3}.MyInline3-attr05{initial-letter:3.2 5}.blah-t{background-color:green;max-width:80ex}.blah-f{background-color:red;max-width:80ex}.MyInline3-innerObject-depth1{border-collapse:collapse}.MyInline3-innerObject-andAgain-depth2{border-collapse:separate}""")
- "keyframes" - test(MyInlineWithKeyframes.render, """@keyframes MyInlineWithKeyframes-kf1{0%{height:100px;width:30px}20.5%{height:150px;width:30px}25.5%{height:150px;width:30px}30.5%{height:150px;width:30px}35.5%{height:150px;width:30px}100%{height:200px;width:60px}}.MyInlineWithKeyframes-s{height:100px;width:30px}.MyInlineWithKeyframes-animation{-moz-animation-name:MyInlineWithKeyframes-kf1;-o-animation-name:MyInlineWithKeyframes-kf1;-webkit-animation-name:MyInlineWithKeyframes-kf1;animation-name:MyInlineWithKeyframes-kf1;-moz-animation-duration:5s;-o-animation-duration:5s;-webkit-animation-duration:5s;animation-duration:5s;-moz-animation-direction:alternate;-o-animation-direction:alternate;-webkit-animation-direction:alternate;animation-direction:alternate;-moz-animation-iteration-count:5;-o-animation-iteration-count:5;-webkit-animation-iteration-count:5;animation-iteration-count:5;-moz-animation-play-state:running;-o-animation-play-state:running;-webkit-animation-play-state:running;animation-play-state:running;-moz-animation-timing-function:ease;-o-animation-timing-function:ease;-webkit-animation-timing-function:ease;animation-timing-function:ease}""")
- "complexCond" - test(MyInlineComplexCond .render, ".manual{margin:12px;padding:0.5ex}.manual:hover{cursor:-moz-zoom-in;cursor:-o-zoom-in;cursor:-webkit-zoom-in;cursor:zoom-in}.manual:nth-child(5){cursor:-moz-zoom-in;cursor:-o-zoom-in;cursor:-webkit-zoom-in;cursor:zoom-in}.manual[some-attribute=\"true\"]::after{padding:5px}.manual:hover .child{margin:5px}.manual:hover .child:hover{display:block}.manual .child2:hover{margin:15px}.manual:nth-child(5) .row{margin:5px}.manual:nth-child(5) .row:nth-child(9){display:block}.manual .row2:nth-child(15){margin:15px}@media (max-width:150px){.manual:hover{margin:0}.manual:nth-child(5){margin:0}}@media (max-width:100px){.manual:hover .child{margin:2px}.manual .child2:hover{margin:10px}.manual:nth-child(5) .row{margin:2px}.manual .row2:nth-child(15){margin:10px}}")
- "fontFaces" - test(MyInlineWithFontFace .render, "@font-face {font-family:myFont;src:url(font.woff);font-stretch:expanded;font-style:italic;unicode-range:U+0-5}@font-face {font-family:myFont2;src:url(font2.woff);font-style:oblique;font-weight:200}@font-face {font-family:myFont3;src:local(HelveticaNeue),url(font2.woff);font-stretch:ultra-condensed;font-weight:200}@font-face {font-family:myFont3;src:local(HelveticaNeue),url(font2.woff)}@font-face {font-family:MyInlineWithFontFace-0001;src:local(HelveticaNeue),url(font2.woff)}@font-face {font-family:MyInlineWithFontFace-0002;src:local(HelveticaNeue),url(font.woff)}.MyInlineWithFontFace-myFontText{font-family:myFont}.MyInlineWithFontFace-myFontText2{font-family:myFont3}.MyInlineWithFontFace-myFontText3{font-family:MyInlineWithFontFace-0002}")
+ test("css1") - test2(MyInline .render, """.manual{margin:12px;padding:0.5ex;cursor:pointer;-moz-text-decoration-line:underline overline;text-decoration-line:underline overline;background-image:-moz-radial-gradient(5em circle at top left, yellow, blue);background-image:-o-radial-gradient(5em circle at top left, yellow, blue);background-image:-webkit-radial-gradient(5em circle at top left, yellow, blue);background-image:radial-gradient(5em circle at top left, yellow, blue);-ms-grid-template-areas:"main side";grid-template-areas:"main side"}.manual:hover{font-weight:normal;line-height:1em;padding:0;cursor:-moz-zoom-in;cursor:-o-zoom-in;cursor:-webkit-zoom-in;cursor:zoom-in}.manual:not(:first-child):visited{-moz-animation-delay:60s,50ms;-o-animation-delay:60s,50ms;-webkit-animation-delay:60s,50ms;animation-delay:60s,50ms;font-weight:bold;font:inherit}.manual nav.debug{background-color:#f88;color:black !important}.manual nav.debug h1{line-height:97.5%;font-size:150%}blockquote:before, blockquote:after{content:'';content:none}.DEBUG{border-color:#080}.MyInline-condMixinP:hover{display:block;color:red}@media not handheld and (orientation:landscape) and (color){.manual{padding-left:500px;padding-right:500px}}@media tv and (min-device-aspect-ratio:3/4), all and (resolution:300dpi){.manual{margin-top:10em;margin-bottom:10em}}@media (max-width:100px){.MyInline-medianess{color:brown}.MyInline-medianess span{background-color:yellow}.MyInline-condMixinP:hover{margin:auto}.MyInline-condMixinQ{display:block;margin:auto}.MyInline-condMixinQ:hover{color:red}}""")
+ test("css2") - test2(MyInline2 .render, ".MyInline2-sb2{margin-top:inherit}.MyInline2-everythingOk-t{background-color:green;max-width:80ex}.MyInline2-everythingOk-f{background-color:red;max-width:80ex}.MyInline2-indent-2{padding-left:8ex;color:blue}.MyInline2-indent-3{padding-left:12ex;color:red;margin-top:1em}.MyInline2-indent-4{padding-left:16ex;margin-top:1em}.MyInline2-opbool-1{color:black}.MyInline2-opbool-2{color:green}.MyInline2-opbool-3{color:red}.MyInline2-what_the_hell__{visibility:hidden}@media (min-width:0){.MyInline2-mediaOrdering{margin:1px}}@media (min-width:576px){.MyInline2-mediaOrdering{margin:2px}}@media (min-width:768px){.MyInline2-mediaOrdering{margin:3px}}@media (min-width:992px){.MyInline2-mediaOrdering{margin:4px}}@media (min-width:1200px){.MyInline2-mediaOrdering{margin:5px}}")
+ test("css3") - test2(MyInline3 .render, """.MyInline3-dup1b{word-break:break-all}.MyInline3-dup1b-2{word-break:keep-all}.MyInline3-dup2c{vertical-align:top}.MyInline3-dup2c-2{vertical-align:middle}.MyInline3-dup2c-3{vertical-align:bottom}.MyInline3-attr01{background-repeat:no-repeat}.MyInline3-attr02{background-repeat:round}.MyInline3-attr03{background-repeat:repeat space}.MyInline3-attr04{initial-letter:3}.MyInline3-attr05{initial-letter:3.2 5}.blah-t{background-color:green;max-width:80ex}.blah-f{background-color:red;max-width:80ex}.MyInline3-innerObject-depth1{border-collapse:collapse}.MyInline3-innerObject-andAgain-depth2{border-collapse:separate}""")
+ test("keyframes") - test2(MyInlineWithKeyframes.render, """@keyframes MyInlineWithKeyframes-kf1{0%{height:100px;width:30px}20.5%{height:150px;width:30px}25.5%{height:150px;width:30px}30.5%{height:150px;width:30px}35.5%{height:150px;width:30px}100%{height:200px;width:60px}}.MyInlineWithKeyframes-s{height:100px;width:30px}.MyInlineWithKeyframes-animation{-moz-animation-name:MyInlineWithKeyframes-kf1;-o-animation-name:MyInlineWithKeyframes-kf1;-webkit-animation-name:MyInlineWithKeyframes-kf1;animation-name:MyInlineWithKeyframes-kf1;-moz-animation-duration:5s;-o-animation-duration:5s;-webkit-animation-duration:5s;animation-duration:5s;-moz-animation-direction:alternate;-o-animation-direction:alternate;-webkit-animation-direction:alternate;animation-direction:alternate;-moz-animation-iteration-count:5;-o-animation-iteration-count:5;-webkit-animation-iteration-count:5;animation-iteration-count:5;-moz-animation-play-state:running;-o-animation-play-state:running;-webkit-animation-play-state:running;animation-play-state:running;-moz-animation-timing-function:ease;-o-animation-timing-function:ease;-webkit-animation-timing-function:ease;animation-timing-function:ease}""")
+ test("complexCond") - test2(MyInlineComplexCond .render, ".manual{margin:12px;padding:0.5ex}.manual:hover{cursor:-moz-zoom-in;cursor:-o-zoom-in;cursor:-webkit-zoom-in;cursor:zoom-in}.manual:nth-child(5){cursor:-moz-zoom-in;cursor:-o-zoom-in;cursor:-webkit-zoom-in;cursor:zoom-in}.manual[some-attribute=\"true\"]::after{padding:5px}.manual:hover .child{margin:5px}.manual:hover .child:hover{display:block}.manual .child2:hover{margin:15px}.manual:nth-child(5) .row{margin:5px}.manual:nth-child(5) .row:nth-child(9){display:block}.manual .row2:nth-child(15){margin:15px}@media (max-width:150px){.manual:hover{margin:0}.manual:nth-child(5){margin:0}}@media (max-width:100px){.manual:hover .child{margin:2px}.manual .child2:hover{margin:10px}.manual:nth-child(5) .row{margin:2px}.manual .row2:nth-child(15){margin:10px}}")
+ test("fontFaces") - test2(MyInlineWithFontFace .render, "@font-face {font-family:myFont;src:url(font.woff);font-stretch:expanded;font-style:italic;unicode-range:U+0-5}@font-face {font-family:myFont2;src:url(font2.woff);font-style:oblique;font-weight:200}@font-face {font-family:myFont3;src:local(HelveticaNeue),url(font2.woff);font-stretch:ultra-condensed;font-weight:200}@font-face {font-family:myFont3;src:local(HelveticaNeue),url(font2.woff)}@font-face {font-family:MyInlineWithFontFace-0001;src:local(HelveticaNeue),url(font2.woff)}@font-face {font-family:MyInlineWithFontFace-0002;src:local(HelveticaNeue),url(font.woff)}.MyInlineWithFontFace-myFontText{font-family:myFont}.MyInlineWithFontFace-myFontText2{font-family:myFont3}.MyInlineWithFontFace-myFontText3{font-family:MyInlineWithFontFace-0002}")
}
}
\ No newline at end of file
diff --git a/core/shared/src/test/scala/scalacss/internal/AttrTest.scala b/core/shared/src/test/scala/scalacss/internal/AttrTest.scala
index 7e2e7f22..1d64fb73 100644
--- a/core/shared/src/test/scala/scalacss/internal/AttrTest.scala
+++ b/core/shared/src/test/scala/scalacss/internal/AttrTest.scala
@@ -43,11 +43,11 @@ object AttrTest extends TestSuite {
}
override def tests = Tests {
- "laws1" - laws1.mustBeProvedBy(builtInAttrs)
- "laws2" - laws2.mustBeProvedBy(builtInAttrPairs)
+ test("laws1") - laws1.mustBeProvedBy(builtInAttrs)
+ test("laws2") - laws2.mustBeProvedBy(builtInAttrPairs)
// 'laws3 - Attr.laws3.mustBeSatisfiedBy(builtInAttrTriplets)
- "overlap" - {
+ test("overlap") - {
def test(e: AttrCmp, a: Attr, b: Attr): Unit =
assertEq(s"$a cmp $b", e, a cmp b)
test(Unrelated, padding, margin)
@@ -62,34 +62,34 @@ object AttrTest extends TestSuite {
test(Unrelated, borderLeft, borderRight)
}
- "keyPrefixes" - {
+ test("keyPrefixes") - {
def test(a: Attr, exp: String*): Unit = testGen(CssKV.key)(a, "x", exp: _*)
test(textAlign, "text-align")
test(borderRadius, "border-radius", "-moz-border-radius")
test(flexWrap, "flex-wrap", "-moz-flex-wrap", "-ms-flex-wrap", "-o-flex-wrap", "-webkit-flex-wrap")
}
- "valuePrefixes" - {
+ test("valuePrefixes") - {
def test(av: AV, exp: String*): Unit = testGen(CssKV.value)(av.attr, av.value, exp: _*)
test(textAlign.left, "left")
test(cursor.pointer, "pointer")
test(cursor.zoomIn, "-moz-zoom-in", "-o-zoom-in", "-webkit-zoom-in", "zoom-in")
}
- "content" - {
- "e" - assertEq(content.string("").value, "''")
- "s" - assertEq(content.string("abc 123").value, "'abc 123'")
- "q" - assertEq(content.string("""ok " ' \ Δ cool""").value, """'ok " \0027 \005C \0394 cool'""")
- "u" - assertEq(content.url("http://www.example.com/test.png").value, "url('http://www.example.com/test.png')")
+ test("content") - {
+ test("e") - assertEq(content.string("").value, "''")
+ test("s") - assertEq(content.string("abc 123").value, "'abc 123'")
+ test("q") - assertEq(content.string("""ok " ' \ Δ cool""").value, """'ok " \0027 \005C \0394 cool'""")
+ test("u") - assertEq(content.url("http://www.example.com/test.png").value, "url('http://www.example.com/test.png')")
}
- "border" - {
+ test("border") - {
assertEq(border(length).value, "3px")
assertEq(border(length, style).value, "3px dashed")
assertEq(border(length, style, colour).value, "3px dashed green")
}
- "textIndent" - {
+ test("textIndent" ) - {
def test(av: AV, exp: String): Unit = assertEq(av.value, exp)
import Literal.Typed._
test(textIndent(length) , "3px")
@@ -98,7 +98,7 @@ object AttrTest extends TestSuite {
test(textIndent(length, hanging, eachLine), "3px hanging each-line")
}
- "backgroundClip" - {
+ test("backgroundClip" ) - {
def test(av: AV, exp: String): Unit = assertEq(av.value, exp)
test(backgroundClip.paddingBox , "padding-box")
test(backgroundClip.borderBox , "border-box")
@@ -107,14 +107,14 @@ object AttrTest extends TestSuite {
test(backgroundClip.contentBox.paddingBox.av.important, "content-box padding-box !important")
}
- "borderRadius" - {
+ test("borderRadius" ) - {
def test(av: AV, exp: String): Unit = assertEq(av.value, exp)
test(borderRadius(px(3)), "3px")
test(borderRadius(px(3))(px(5)), "3px / 5px")
test(borderRadius(px(1), px(2), px(3), px(4))(px(9), px(8), px(7), px(6)), "1px 2px 3px 4px / 9px 8px 7px 6px")
}
- "PrefixApplyWords" - {
+ test("PrefixApplyWords" ) - {
val pa = CanIUse2.PrefixApply.keywords("abc", "def")
def test(i: String, eo: String = null): Unit = {
val o = pa(i).fold(i)(_(CanIUse.Prefix.o))
@@ -137,39 +137,39 @@ object AttrTest extends TestSuite {
test("def(12)", "-o-def(12)")
}
- "envDepPrefixes1" - {
- def test(name: String)(exp: String*): Unit = {
+ test("envDepPrefixes1" ) - {
+ def test2(name: String)(exp: String*): Unit = {
val env = Env.empty.copy(platform = Env.Platform.empty(None).copy(name = Some(name)))
val a = cursor.zoomIn(env).map(_.value).sorted
assertEq(a, exp.toVector.sorted)
}
- "chrome" - test("Chrome") ("-webkit-zoom-in", "zoom-in")
- "firefox" - test("Firefox")("-moz-zoom-in", "zoom-in")
- "opera" - test("Opera") ("-o-zoom-in", "-webkit-zoom-in", "zoom-in")
- "ie" - test("IE") (/*"-ms-zoom-in", Unsupported */ "zoom-in")
- "safari" - test("Safari") ("-webkit-zoom-in", "zoom-in")
+ test("chrome") - test2("Chrome") ("-webkit-zoom-in", "zoom-in")
+ test("firefox") - test2("Firefox")("-moz-zoom-in", "zoom-in")
+ test("opera") - test2("Opera") ("-o-zoom-in", "-webkit-zoom-in", "zoom-in")
+ test("ie") - test2("IE") (/*"-ms-zoom-in", Unsupported */ "zoom-in")
+ test("safari") - test2("Safari") ("-webkit-zoom-in", "zoom-in")
}
- "envDepPrefixes2" - {
- def test(name: String)(exp: String*): Unit = {
+ test("envDepPrefixes2" ) - {
+ def test2(name: String)(exp: String*): Unit = {
val env = Env.empty.copy(platform = Env.Platform.empty(None).copy(name = Some(name)))
val a = AV(flex, "")(env).map(_.key).sorted
assertEq(a, exp.toVector.sorted)
}
- "chrome" - test("Chrome") ("-webkit-flex", "flex")
- "firefox" - test("Firefox")("-moz-flex", "flex")
- "opera" - test("Opera") ("-o-flex", "-webkit-flex", "flex")
- "ie" - test("IE") ("-ms-flex", "flex")
- "safari" - test("Safari") ("-webkit-flex", "flex")
+ test("chrome") - test2("Chrome") ("-webkit-flex", "flex")
+ test("firefox") - test2("Firefox")("-moz-flex", "flex")
+ test("opera") - test2("Opera") ("-o-flex", "-webkit-flex", "flex")
+ test("ie") - test2("IE") ("-ms-flex", "flex")
+ test("safari") - test2("Safari") ("-webkit-flex", "flex")
}
- "gridTemplateAreas" - {
+ test("gridTemplateAreas" ) - {
def test(av: AV, exp: String): Unit = assertEq(av.value, exp.trim)
test(gridTemplateAreas("a b"), """ "a b" """)
test(gridTemplateAreas("a b", "c d"), """ "a b" "c d" """)
}
- "rowGap" - {
+ test("rowGap" ) - {
def test(av: AV, exp: String): Unit = assertEq(av.value, exp.trim)
test(rowGap.normal, "normal")
test(rowGap(Literal.Typed.normal), "normal")
@@ -178,14 +178,14 @@ object AttrTest extends TestSuite {
test(rowGap(length), "3px")
}
- "gap" - {
+ test("gap" ) - {
def test(av: AV, exp: String): Unit = assertEq(av.value, exp.trim)
test(gap.normal, "normal")
test(gap(Literal.Typed.normal, Literal.Typed.`0`), "normal 0")
test(gap(pct, length), "5% 3px")
}
- "pointerEvents" - {
+ test("pointerEvents") - {
def test(av: AV, exp: String): Unit = assertEq(av.value, exp.trim)
test(pointerEvents.auto, "auto")
test(pointerEvents.none, "none")
@@ -193,7 +193,7 @@ object AttrTest extends TestSuite {
test(pointerEvents.initial, "initial")
test(pointerEvents.unset, "unset")
}
- "justifyContent" - {
+ test("justifyContent" ) - {
def test(av: AV, exp: String): Unit = assertEq(av.value, exp.trim)
test(justifyContent.center , "center")
test(justifyContent.start , "start")
@@ -212,7 +212,7 @@ object AttrTest extends TestSuite {
test(justifyContent.initial , "initial")
test(justifyContent.unset , "unset")
}
- "userSelect" - {
+ test("userSelect" ) - {
def test(av: AV, exp: String): Unit = assertEq(av.value, exp.trim)
test(userSelect.auto, "auto")
test(userSelect.text, "text")
diff --git a/core/shared/src/test/scala/scalacss/internal/ColorTest.scala b/core/shared/src/test/scala/scalacss/internal/ColorTest.scala
index 9b60dc85..11f5015f 100644
--- a/core/shared/src/test/scala/scalacss/internal/ColorTest.scala
+++ b/core/shared/src/test/scala/scalacss/internal/ColorTest.scala
@@ -10,67 +10,67 @@ object ColorTest extends TestSuite {
override def tests = Tests {
- "valid" - {
- def test(c: Color, expect: String) =
+ test("valid") - {
+ def test2(c: Color, expect: String) =
assertEq(c.value, expect)
- "hex3" - test(c"#f09" , "#f09")
- "hex4" - test(c"#f0a9" , "#f0a9")
- "hex6" - test(c"#abc105" , "#abc105")
- "hex8" - test(c"#abc105f3", "#abc105f3")
+ test("hex3") - test2(c"#f09" , "#f09")
+ test("hex4") - test2(c"#f0a9" , "#f0a9")
+ test("hex6") - test2(c"#abc105" , "#abc105")
+ test("hex8") - test2(c"#abc105f3", "#abc105f3")
- "rgbI" - test(c"rgb(0,128,255)", "rgb(0,128,255)")
- "rgbP" - test(c"rgb(0%,50%,100%)", "rgb(0%,50%,100%)")
- "rgba" - test(c"rgba(255,128,0,0)", "rgba(255,128,0,0)")
- "hsl" - test(c"hsl(359,0%,100%)", "hsl(359,0%,100%)")
- "hsla" - test(c"hsla(0,100%,0%,1)", "hsla(0,100%,0%,1)")
+ test("rgbI") - test2(c"rgb(0,128,255)", "rgb(0,128,255)")
+ test("rgbP") - test2(c"rgb(0%,50%,100%)", "rgb(0%,50%,100%)")
+ test("rgba") - test2(c"rgba(255,128,0,0)", "rgba(255,128,0,0)")
+ test("hsl") - test2(c"hsl(359,0%,100%)", "hsl(359,0%,100%)")
+ test("hsla") - test2(c"hsla(0,100%,0%,1)", "hsla(0,100%,0%,1)")
- "hexU" - test(c"#ABC", "#abc")
- "rgbU" - test(c"RGB(0,128,255)", "rgb(0,128,255)")
+ test("hexU") - test2(c"#ABC", "#abc")
+ test("rgbU") - test2(c"RGB(0,128,255)", "rgb(0,128,255)")
- "whitespace" - test(c" rgba ( 255 , 128 , 0 , 0 ) ", "rgba(255,128,0,0)")
+ test("whitespace") - test(c" rgba ( 255 , 128 , 0 , 0 ) ", "rgba(255,128,0,0)")
- "alphaDec0" - test(c"hsla(0,100%,0%,0.918)", "hsla(0,100%,0%,0.918)")
- "alphaDecZ" - test(c"hsla(0,100%,0%,.543)", "hsla(0,100%,0%,.543)")
+ test("alphaDec0") - test(c"hsla(0,100%,0%,0.918)", "hsla(0,100%,0%,0.918)")
+ test("alphaDecZ") - test(c"hsla(0,100%,0%,.543)", "hsla(0,100%,0%,.543)")
}
- "invalid" - {
+ test("invalid") - {
@nowarn("cat=unused")
def assertFailure(e: CompileError) = ()
def assertErrorContains(e: CompileError, frag: String): Unit =
assertContains(e.msg, frag)
- "hex" - {
- def test(e: CompileError): Unit = assertErrorContains(e, "Hex notation must be")
- "0" - test(compileError(""" c"#" """))
- "1" - test(compileError(""" c"#f" """))
- "2" - test(compileError(""" c"#00" """))
- "5" - test(compileError(""" c"#12345" """))
- "7" - test(compileError(""" c"#1234567" """))
- "9" - test(compileError(""" c"#123456789" """))
- "g" - test(compileError(""" c"#00g" """))
- "G" - test(compileError(""" c"#G00" """))
+ test("hex") - {
+ def test2(e: CompileError): Unit = assertErrorContains(e, "Hex notation must be")
+ test("0") - test2(assertCompileError(""" c"#" """))
+ test("1") - test2(assertCompileError(""" c"#f" """))
+ test("2") - test2(assertCompileError(""" c"#00" """))
+ test("5") - test2(assertCompileError(""" c"#12345" """))
+ test("7") - test2(assertCompileError(""" c"#1234567" """))
+ test("9") - test2(assertCompileError(""" c"#123456789" """))
+ test("g") - test2(assertCompileError(""" c"#00g" """))
+ test("G") - test2(assertCompileError(""" c"#G00" """))
}
- "empty" - assertFailure(compileError( """ c"" """))
- "blank" - assertFailure(compileError( """ c" " """))
- "badFn" - assertFailure(compileError( """ c"rbg(0,0,0)" """))
- "two" - assertFailure(compileError( """ c"#fed #fed" """))
+ test("empty") - assertFailure(assertCompileError( """ c"" """))
+ test("blank") - assertFailure(assertCompileError( """ c" " """))
+ test("badFn") - assertFailure(assertCompileError( """ c"rbg(0,0,0)" """))
+ test("two") - assertFailure(assertCompileError( """ c"#fed #fed" """))
- "numbers" - {
- "r-1" - assertErrorContains(compileError(""" c"rgb(-1,0,0)" """), "Invalid red value")
- "r256" - assertErrorContains(compileError(""" c"rgb(256,0,0)" """), "Invalid red value")
- "g256" - assertErrorContains(compileError(""" c"rgb(0,256,0)" """), "Invalid green value")
- "b256" - assertErrorContains(compileError(""" c"rgb(0,0,256)" """), "Invalid blue value")
- "a2" - assertErrorContains(compileError(""" c"rgba(0,0,0,2)" """), "Invalid alpha value")
- "a1.1" - assertErrorContains(compileError(""" c"rgba(0,0,0,1.1)" """), "Invalid alpha value")
- "r101%" - assertErrorContains(compileError(""" c"rgb(101%,0%,0%)" """), "Invalid red value")
- "g101%" - assertErrorContains(compileError(""" c"rgb(0%,101%,0%)" """), "Invalid green value")
- "b101%" - assertErrorContains(compileError(""" c"rgb(0%,0%,101%)" """), "Invalid blue value")
- "dbl" - assertFailure (compileError(""" c"rgb(2.5,0,0)" """))
- "str" - assertFailure (compileError(""" c"rgb(x,0,0)" """))
- "empty" - assertFailure (compileError(""" c"rgb(0,,0)" """))
- "mixed" - assertFailure (compileError(""" c"rbg(0,0%,0)" """))
+ test("numbers") - {
+ test("r-1") - assertErrorContains(assertCompileError(""" c"rgb(-1,0,0)" """), "Invalid red value")
+ test("r256") - assertErrorContains(assertCompileError(""" c"rgb(256,0,0)" """), "Invalid red value")
+ test("g256") - assertErrorContains(assertCompileError(""" c"rgb(0,256,0)" """), "Invalid green value")
+ test("b256") - assertErrorContains(assertCompileError(""" c"rgb(0,0,256)" """), "Invalid blue value")
+ test("a2") - assertErrorContains(assertCompileError(""" c"rgba(0,0,0,2)" """), "Invalid alpha value")
+ test("a1.1") - assertErrorContains(assertCompileError(""" c"rgba(0,0,0,1.1)" """), "Invalid alpha value")
+ test("r101%") - assertErrorContains(assertCompileError(""" c"rgb(101%,0%,0%)" """), "Invalid red value")
+ test("g101%") - assertErrorContains(assertCompileError(""" c"rgb(0%,101%,0%)" """), "Invalid green value")
+ test("b101%") - assertErrorContains(assertCompileError(""" c"rgb(0%,0%,101%)" """), "Invalid blue value")
+ test("dbl") - assertFailure (assertCompileError(""" c"rgb(2.5,0,0)" """))
+ test("str") - assertFailure (assertCompileError(""" c"rgb(x,0,0)" """))
+ test("empty") - assertFailure (assertCompileError(""" c"rgb(0,,0)" """))
+ test("mixed") - assertFailure (assertCompileError(""" c"rbg(0,0%,0)" """))
}
}
}
diff --git a/core/shared/src/test/scala/scalacss/internal/ComposeTest.scala b/core/shared/src/test/scala/scalacss/internal/ComposeTest.scala
index 5cdcf888..4a24f80e 100644
--- a/core/shared/src/test/scala/scalacss/internal/ComposeTest.scala
+++ b/core/shared/src/test/scala/scalacss/internal/ComposeTest.scala
@@ -80,35 +80,35 @@ object ComposeTest extends TestSuite {
}
override def tests = Tests {
- "props" - propTest.mustSatisfyE(_.all) //(defaultPropSettings.setSampleSize(2000))
- "issue25" - Issue25.test()
+ test("props") - propTest.mustSatisfyE(_.all) //(defaultPropSettings.setSampleSize(2000))
+ test("issue25") - Issue25.test()
- "values" - {
+ test("values") - {
import Dsl._
implicit def c: Compose = Compose.safe
- def test(s: StyleS)(avs: AV*)(ws: String*): Unit = {
+ def test2(s: StyleS)(avs: AV*)(ws: String*): Unit = {
assertEq(s.data(Cond.empty).avIterator.toVector, avs.toVector)
assertEq(s.warnings.map(_.msg), ws.toVector)
}
- "idempotency" - {
+ test("idempotency") - {
val a = style(display.block)
- test(a compose a)(AV(display, "block"))()
+ test2(a compose a)(AV(display, "block"))()
}
- "sameKey" -
- test(style(display.block) compose style(display.inline))(
+ test("sameKey") -
+ test2(style(display.block) compose style(display.inline))(
AV(display, "block"), AV(display, "inline")
)("{display: inline} conflicts with {display: block}")
- "marginN1" -
- test(style(margin.auto) compose style(marginLeft.`0`))(
+ test("marginN1") -
+ test2(style(margin.auto) compose style(marginLeft.`0`))(
AV(margin, "auto"), AV(marginLeft, "0")
)("{margin-left: 0} conflicts with {margin: auto}")
- "margin1N" -
- test(style(marginLeft.`0`) compose style(margin.auto))(
+ test("margin1N") -
+ test2(style(marginLeft.`0`) compose style(margin.auto))(
AV(marginLeft, "0"), AV(margin, "auto")
)("{margin: auto} conflicts with {margin-left: 0}")
diff --git a/core/shared/src/test/scala/scalacss/internal/CondTest.scala b/core/shared/src/test/scala/scalacss/internal/CondTest.scala
index 62480ebd..a7a6a476 100644
--- a/core/shared/src/test/scala/scalacss/internal/CondTest.scala
+++ b/core/shared/src/test/scala/scalacss/internal/CondTest.scala
@@ -1,19 +1,20 @@
package scalacss.internal
import japgolly.microlibs.testutil.TestUtil._
-import utest._
+import utest.{TestSuite, Tests, test}
+import utest.{assertThrows => assertThrows2}
object CondTest extends TestSuite {
override def tests = Tests {
- "pseudo" - {
+ test("pseudo") - {
import Pseudo._
- "not" - {
+ test("not") - {
assertEq(Not("div").cssValue, ":not(div)")
assertEq(Not(Link).cssValue, ":not(:link)")
}
- "attrSelectors" - {
+ test("attrSelectors") - {
assertEq(AttrExists("custom-attr").cssValue, "[custom-attr]")
assertEq(Attr("custom-attr", "bla").cssValue, "[custom-attr=\"bla\"]")
assertEq(AttrContains("custom-attr", "bla").cssValue, "[custom-attr~=\"bla\"]")
@@ -21,7 +22,7 @@ object CondTest extends TestSuite {
assertEq(AttrEndsWith("custom-attr", "bla").cssValue, "[custom-attr$=\"bla\"]")
}
- "elementClassOrder" - {
+ test("elementClassOrder") - {
assertEq(Before.&(Hover).attrExists("custom-attr").cssValue, "[custom-attr]:hover::before")
assertEq(Hover.attr("custom-attr", "bla").&(Before).cssValue, "[custom-attr=\"bla\"]:hover::before")
assertEq(AttrEndsWith("custom-attr", "bla").&(Hover).&(Before).cssValue, "[custom-attr$=\"bla\"]:hover::before")
@@ -34,20 +35,20 @@ object CondTest extends TestSuite {
assertEq(Hover.&(Before).cssValue, ":hover::before")
}
- "brokenNthChildQueries" - {
- intercept[IllegalArgumentException] { Before.&(Hover).nthChild("2n+k").cssValue }
- intercept[IllegalArgumentException] { Before.&(Hover).nthChild("2x+1").cssValue }
- intercept[IllegalArgumentException] { Before.&(Hover).nthChild("2n+-1").cssValue }
- intercept[IllegalArgumentException] { Before.&(Hover).nthChild("--2n+1").cssValue }
- intercept[IllegalArgumentException] { Before.&(Hover).nthChild("2n+1+3").cssValue }
- intercept[IllegalArgumentException] { Before.&(Hover).nthChild("2-n+1").cssValue }
- intercept[IllegalArgumentException] { Before.&(Hover).nthChild("2*n+1").cssValue }
- intercept[IllegalArgumentException] { Before.&(Hover).nthChild("2n*1").cssValue }
- intercept[IllegalArgumentException] { Before.&(Hover).nthChild("n/3").cssValue }
- intercept[IllegalArgumentException] { Before.&(Hover).nthChild("1+4").cssValue }
- intercept[IllegalArgumentException] { Before.&(Hover).nthChild("nn").cssValue }
- intercept[IllegalArgumentException] { Before.&(Hover).nthChild("-").cssValue }
- intercept[IllegalArgumentException] { Before.&(Hover).nthChild("+").cssValue }
+ test("brokenNthChildQueries") - {
+ assertThrows2[IllegalArgumentException] { Before.&(Hover).nthChild("2n+k").cssValue }
+ assertThrows2[IllegalArgumentException] { Before.&(Hover).nthChild("2x+1").cssValue }
+ assertThrows2[IllegalArgumentException] { Before.&(Hover).nthChild("2n+-1").cssValue }
+ assertThrows2[IllegalArgumentException] { Before.&(Hover).nthChild("--2n+1").cssValue }
+ assertThrows2[IllegalArgumentException] { Before.&(Hover).nthChild("2n+1+3").cssValue }
+ assertThrows2[IllegalArgumentException] { Before.&(Hover).nthChild("2-n+1").cssValue }
+ assertThrows2[IllegalArgumentException] { Before.&(Hover).nthChild("2*n+1").cssValue }
+ assertThrows2[IllegalArgumentException] { Before.&(Hover).nthChild("2n*1").cssValue }
+ assertThrows2[IllegalArgumentException] { Before.&(Hover).nthChild("n/3").cssValue }
+ assertThrows2[IllegalArgumentException] { Before.&(Hover).nthChild("1+4").cssValue }
+ assertThrows2[IllegalArgumentException] { Before.&(Hover).nthChild("nn").cssValue }
+ assertThrows2[IllegalArgumentException] { Before.&(Hover).nthChild("-").cssValue }
+ assertThrows2[IllegalArgumentException] { Before.&(Hover).nthChild("+").cssValue }
}
}
}
diff --git a/core/shared/src/test/scala/scalacss/internal/StyleTest.scala b/core/shared/src/test/scala/scalacss/internal/StyleTest.scala
index f769ab95..2a6d2882 100644
--- a/core/shared/src/test/scala/scalacss/internal/StyleTest.scala
+++ b/core/shared/src/test/scala/scalacss/internal/StyleTest.scala
@@ -8,8 +8,8 @@ object StyleTest extends TestSuite {
override def tests = Tests {
- "styleA" - {
- "addOperator" - {
+ test("styleA") - {
+ test("addOperator") - {
import Dsl._
val s1 = StyleA(ClassName("s1"), Vector("c1", "c2", "c3").map(ClassName.apply), style(backgroundColor.blue))
@@ -37,4 +37,5 @@ object StyleTest extends TestSuite {
}
}
}
+
}
diff --git a/core/shared/src/test/scala/scalacss/internal/UsageTest.scala b/core/shared/src/test/scala/scalacss/internal/UsageTest.scala
index 15644db0..11410f35 100644
--- a/core/shared/src/test/scala/scalacss/internal/UsageTest.scala
+++ b/core/shared/src/test/scala/scalacss/internal/UsageTest.scala
@@ -38,7 +38,7 @@ object UsageTest extends TestSuite {
)
override def tests = Tests {
- "maintest" - {
+ test("maintest") - {
val css = StringRenderer defaultPretty Css.style(".a1", s1)(Env.empty)
// println(css)
assertEq(css.trim,
diff --git a/core/shared/src/test/scala/scalacss/internal/ValueTTest.scala b/core/shared/src/test/scala/scalacss/internal/ValueTTest.scala
index 06bfba59..153f94e0 100644
--- a/core/shared/src/test/scala/scalacss/internal/ValueTTest.scala
+++ b/core/shared/src/test/scala/scalacss/internal/ValueTTest.scala
@@ -6,6 +6,8 @@ import scalacss.internal.ValueT.Rules._
import scalacss.internal.ValueT._
import utest._
+import scala.language.postfixOps
+
object ValueTTest extends TestSuite {
val len = Length(12, LengthUnit.px)
@@ -16,9 +18,9 @@ object ValueTTest extends TestSuite {
override def tests = Tests {
- "valueClasses" - {
+ test("valueClasses") - {
@nowarn("cat=unused")
- def test[C <: ValueClass](v: ValueT[C]): Unit = ()
+ def test2[C <: ValueClass](v: ValueT[C]): Unit = ()
// def test[C <: ValueClass] = new {
// def apply[A](v: A)(implicit ev: A => ValueT[C]): Unit = ()
// }
@@ -29,179 +31,179 @@ object ValueTTest extends TestSuite {
// def apply[From](f: From)(implicit r: From ==> C): Unit = ()
// }
- "Len" - {
- test[Len](inherit)
- compileError("test[Len](1)")
- compileError("test[Len](1.5)")
- test[Len](len)
- compileError("test[Len](%%)")
- compileError("test[Len](Literal.Typed.thick)")
- compileError("test[Len](Literal.Typed.dashed)")
- compileError("test[Len](Color.black)")
- compileError("test[Len](Literal.Typed.auto)")
- compileError("test[Len](Literal.rtl)")
- compileError("test[Len](sec)")
- compileError("test[Len](ms)")
+ test("Len") - {
+ test2[Len](inherit)
+ assertCompileError("test2[Len](1)")
+ assertCompileError("test2[Len](1.5)")
+ test2[Len](len)
+ assertCompileError("test2[Len](%%)")
+ assertCompileError("test2[Len](Literal.Typed.thick)")
+ assertCompileError("test2[Len](Literal.Typed.dashed)")
+ assertCompileError("test2[Len](Color.black)")
+ assertCompileError("test2[Len](Literal.Typed.auto)")
+ assertCompileError("test2[Len](Literal.rtl)")
+ assertCompileError("test2[Len](sec)")
+ assertCompileError("test2[Len](ms)")
()
}
- "Pct" - {
- test[Pct](inherit)
- compileError("test[Pct](1)")
- compileError("test[Pct](1.5)")
- compileError("test[Pct](len)")
- test[Pct](%%)
- compileError("test[Pct](Literal.Typed.thick)")
- compileError("test[Pct](Literal.Typed.dashed)")
- compileError("test[Pct](Color.black)")
- compileError("test[Pct](Literal.Typed.auto)")
- compileError("test[Pct](Literal.rtl)")
- compileError("test[Pct](sec)")
- compileError("test[Pct](ms)")
+ test("Pct") - {
+ test2[Pct](inherit)
+ assertCompileError("test2[Pct](1)")
+ assertCompileError("test2[Pct](1.5)")
+ assertCompileError("test2[Pct](len)")
+ test2[Pct](%%)
+ assertCompileError("test2[Pct](Literal.Typed.thick)")
+ assertCompileError("test2[Pct](Literal.Typed.dashed)")
+ assertCompileError("test2[Pct](Color.black)")
+ assertCompileError("test2[Pct](Literal.Typed.auto)")
+ assertCompileError("test2[Pct](Literal.rtl)")
+ assertCompileError("test2[Pct](sec)")
+ assertCompileError("test2[Pct](ms)")
()
}
- "Integer" - {
- test[Integer](inherit)
- test[Integer](1)
- compileError("test[Integer](1.5)")
- compileError("test[Integer](len)")
- compileError("test[Integer](%%)")
- compileError("test[Integer](Literal.Typed.thick)")
- compileError("test[Integer](Literal.Typed.dashed)")
- compileError("test[Integer](Color.black)")
- compileError("test[Integer](Literal.Typed.auto)")
- compileError("test[Integer](Literal.rtl)")
- compileError("test[Integer](sec)")
- compileError("test[Integer](ms)")
+ test("Integer") - {
+ test2[Integer](inherit)
+ test2[Integer](1)
+ assertCompileError("test2[Integer](1.5)")
+ assertCompileError("test2[Integer](len)")
+ assertCompileError("test2[Integer](%%)")
+ assertCompileError("test2[Integer](Literal.Typed.thick)")
+ assertCompileError("test2[Integer](Literal.Typed.dashed)")
+ assertCompileError("test2[Integer](Color.black)")
+ assertCompileError("test2[Integer](Literal.Typed.auto)")
+ assertCompileError("test2[Integer](Literal.rtl)")
+ assertCompileError("test2[Integer](sec)")
+ assertCompileError("test2[Integer](ms)")
()
}
- "Number" - {
- test[Number](inherit)
- test[Number](1)
- test[Number](1.5)
- compileError("test[Number](len)")
- compileError("test[Number](%%)")
- compileError("test[Number](Literal.Typed.thick)")
- compileError("test[Number](Literal.Typed.dashed)")
- compileError("test[Number](Color.black)")
- compileError("test[Number](Literal.Typed.auto)")
- compileError("test[Number](Literal.rtl)")
- compileError("test[Number](sec)")
- compileError("test[Number](ms)")
+ test("Number") - {
+ test2[Number](inherit)
+ test2[Number](1)
+ test2[Number](1.5)
+ assertCompileError("test2[Number](len)")
+ assertCompileError("test2[Number](%%)")
+ assertCompileError("test2[Number](Literal.Typed.thick)")
+ assertCompileError("test2[Number](Literal.Typed.dashed)")
+ assertCompileError("test2[Number](Color.black)")
+ assertCompileError("test2[Number](Literal.Typed.auto)")
+ assertCompileError("test2[Number](Literal.rtl)")
+ assertCompileError("test2[Number](sec)")
+ assertCompileError("test2[Number](ms)")
()
}
- "LenPct" - {
- test[LenPct](inherit)
- compileError("test[LenPct](1)")
- compileError("test[LenPct](1.5)")
- test[LenPct](len)
- test[LenPct](%%)
- compileError("test[LenPct](Literal.Typed.thick)")
- compileError("test[LenPct](Literal.Typed.dashed)")
- compileError("test[LenPct](Color.black)")
- compileError("test[LenPct](Literal.Typed.auto)")
- compileError("test[LenPct](Literal.rtl)")
- compileError("test[LenPct](sec)")
- compileError("test[LenPct](ms)")
+ test("LenPct") - {
+ test2[LenPct](inherit)
+ assertCompileError("test2[LenPct](1)")
+ assertCompileError("test2[LenPct](1.5)")
+ test2[LenPct](len)
+ test2[LenPct](%%)
+ assertCompileError("test2[LenPct](Literal.Typed.thick)")
+ assertCompileError("test2[LenPct](Literal.Typed.dashed)")
+ assertCompileError("test2[LenPct](Color.black)")
+ assertCompileError("test2[LenPct](Literal.Typed.auto)")
+ assertCompileError("test2[LenPct](Literal.rtl)")
+ assertCompileError("test2[LenPct](sec)")
+ assertCompileError("test2[LenPct](ms)")
()
}
- "LenPctAuto" - {
- test[LenPctAuto](inherit)
- compileError("test[LenPctAuto](1)")
- compileError("test[LenPctAuto](1.5)")
- test[LenPctAuto](len)
- test[LenPctAuto](%%)
- compileError("test[LenPctAuto](Literal.Typed.thick)")
- compileError("test[LenPctAuto](Literal.Typed.dashed)")
- compileError("test[LenPctAuto](Color.black)")
- test[LenPctAuto](Literal.Typed.auto)
- compileError("test[LenPctAuto](Literal.rtl)")
- compileError("test[LenPctAuto](sec)")
- compileError("test[LenPctAuto](ms)")
+ test("LenPctAuto") - {
+ test2[LenPctAuto](inherit)
+ assertCompileError("test2[LenPctAuto](1)")
+ assertCompileError("test2[LenPctAuto](1.5)")
+ test2[LenPctAuto](len)
+ test2[LenPctAuto](%%)
+ assertCompileError("test2[LenPctAuto](Literal.Typed.thick)")
+ assertCompileError("test2[LenPctAuto](Literal.Typed.dashed)")
+ assertCompileError("test2[LenPctAuto](Color.black)")
+ test2[LenPctAuto](Literal.Typed.auto)
+ assertCompileError("test2[LenPctAuto](Literal.rtl)")
+ assertCompileError("test2[LenPctAuto](sec)")
+ assertCompileError("test2[LenPctAuto](ms)")
()
}
- "LenPctNum" - {
- test[LenPctNum](inherit)
- test[LenPctNum](1)
- test[LenPctNum](1.5)
- test[LenPctNum](len)
- test[LenPctNum](%%)
- compileError("test[LenPctNum](Literal.Typed.thick)")
- compileError("test[LenPctNum](Literal.Typed.dashed)")
- compileError("test[LenPctNum](Color.black)")
- compileError("test[LenPctNum](Literal.Typed.auto)")
- compileError("test[LenPctNum](Literal.rtl)")
- compileError("test[LenPctNum](sec)")
- compileError("test[LenPctNum](ms)")
+ test("LenPctNum") - {
+ test2[LenPctNum](inherit)
+ test2[LenPctNum](1)
+ test2[LenPctNum](1.5)
+ test2[LenPctNum](len)
+ test2[LenPctNum](%%)
+ assertCompileError("test2[LenPctNum](Literal.Typed.thick)")
+ assertCompileError("test2[LenPctNum](Literal.Typed.dashed)")
+ assertCompileError("test2[LenPctNum](Color.black)")
+ assertCompileError("test2[LenPctNum](Literal.Typed.auto)")
+ assertCompileError("test2[LenPctNum](Literal.rtl)")
+ assertCompileError("test2[LenPctNum](sec)")
+ assertCompileError("test2[LenPctNum](ms)")
()
}
- "BrWidth" - {
- test[BrWidth](inherit)
- compileError("test[BrWidth](1)")
- compileError("test[BrWidth](1.5)")
- test[BrWidth](len)
- compileError("test[BrWidth](%%)")
- test[BrWidth](Literal.Typed.thick)
- compileError("test[BrWidth](Literal.Typed.dashed)")
- compileError("test[BrWidth](Color.black)")
- compileError("test[BrWidth](Literal.Typed.auto)")
- compileError("test[BrWidth](Literal.rtl)")
- compileError("test[BrWidth](sec)")
- compileError("test[BrWidth](ms)")
+ test("BrWidth") - {
+ test2[BrWidth](inherit)
+ assertCompileError("test2[BrWidth](1)")
+ assertCompileError("test2[BrWidth](1.5)")
+ test2[BrWidth](len)
+ assertCompileError("test2[BrWidth](%%)")
+ test2[BrWidth](Literal.Typed.thick)
+ assertCompileError("test2[BrWidth](Literal.Typed.dashed)")
+ assertCompileError("test2[BrWidth](Color.black)")
+ assertCompileError("test2[BrWidth](Literal.Typed.auto)")
+ assertCompileError("test2[BrWidth](Literal.rtl)")
+ assertCompileError("test2[BrWidth](sec)")
+ assertCompileError("test2[BrWidth](ms)")
()
}
- "BrStyle" - {
- test[BrStyle](inherit)
- compileError("test[BrStyle](1)")
- compileError("test[BrStyle](1.5)")
- compileError("test[BrStyle](len)")
- compileError("test[BrStyle](%%)")
- compileError("test[BrStyle](Literal.Typed.thick)")
- test[BrStyle](Literal.Typed.dashed)
- compileError("test[BrStyle](Color.black)")
- compileError("test[BrStyle](Literal.Typed.auto)")
- compileError("test[BrStyle](Literal.rtl)")
- compileError("test[BrStyle](sec)")
- compileError("test[BrStyle](ms)")
+ test("BrStyle") - {
+ test2[BrStyle](inherit)
+ assertCompileError("test2[BrStyle](1)")
+ assertCompileError("test2[BrStyle](1.5)")
+ assertCompileError("test2[BrStyle](len)")
+ assertCompileError("test2[BrStyle](%%)")
+ assertCompileError("test2[BrStyle](Literal.Typed.thick)")
+ test2[BrStyle](Literal.Typed.dashed)
+ assertCompileError("test2[BrStyle](Color.black)")
+ assertCompileError("test2[BrStyle](Literal.Typed.auto)")
+ assertCompileError("test2[BrStyle](Literal.rtl)")
+ assertCompileError("test2[BrStyle](sec)")
+ assertCompileError("test2[BrStyle](ms)")
()
}
- "WidStyCol" - {
- test[WidStyCol](inherit)
- compileError("test[WidStyCol](1)")
- compileError("test[WidStyCol](1.5)")
- test[WidStyCol](len)
- test[WidStyCol](%%)
- test[WidStyCol](Literal.Typed.thick)
- test[WidStyCol](Literal.Typed.dashed)
- test[WidStyCol](Color.black)
- compileError("test[WidStyCol](Literal.Typed.auto)")
- compileError("test[WidStyCol](Literal.rtl)")
- compileError("test[WidStyCol](sec)")
- compileError("test[WidStyCol](ms)")
+ test("WidStyCol") - {
+ test2[WidStyCol](inherit)
+ assertCompileError("test2[WidStyCol](1)")
+ assertCompileError("test2[WidStyCol](1.5)")
+ test2[WidStyCol](len)
+ test2[WidStyCol](%%)
+ test2[WidStyCol](Literal.Typed.thick)
+ test2[WidStyCol](Literal.Typed.dashed)
+ test2[WidStyCol](Color.black)
+ assertCompileError("test2[WidStyCol](Literal.Typed.auto)")
+ assertCompileError("test2[WidStyCol](Literal.rtl)")
+ assertCompileError("test2[WidStyCol](sec)")
+ assertCompileError("test2[WidStyCol](ms)")
()
}
- "Time" - {
- test[Time](inherit)
- compileError("test[Time](1)")
- compileError("test[Time](1.5)")
- compileError("test[Time](len)")
- compileError("test[Time](%%)")
- compileError("test[Time](Literal.Typed.thick)")
- compileError("test[Time](Literal.Typed.dashed)")
- compileError("test[Time](Color.black)")
- compileError("test[Time](Literal.Typed.auto)")
- compileError("test[Time](Literal.rtl)")
- test[Time](sec)
- test[Time](ms)
+ test("Time") - {
+ test2[Time](inherit)
+ assertCompileError("test2[Time](1)")
+ assertCompileError("test2[Time](1.5)")
+ assertCompileError("test2[Time](len)")
+ assertCompileError("test2[Time](%%)")
+ assertCompileError("test2[Time](Literal.Typed.thick)")
+ assertCompileError("test2[Time](Literal.Typed.dashed)")
+ assertCompileError("test2[Time](Color.black)")
+ assertCompileError("test2[Time](Literal.Typed.auto)")
+ assertCompileError("test2[Time](Literal.rtl)")
+ test2[Time](sec)
+ test2[Time](ms)
()
}
diff --git a/core/shared/src/test/scala/scalacss/internal/mutable/GlobalRegistryTest.scala b/core/shared/src/test/scala/scalacss/internal/mutable/GlobalRegistryTest.scala
index 458c846c..8236f6bf 100644
--- a/core/shared/src/test/scala/scalacss/internal/mutable/GlobalRegistryTest.scala
+++ b/core/shared/src/test/scala/scalacss/internal/mutable/GlobalRegistryTest.scala
@@ -31,14 +31,14 @@ object GlobalRegistryTest extends TestSuite {
gr.register(blar)
override def tests = Tests {
- "get" - {
+ test("get") - {
assertEq(gr[S1], Some(s1))
assertEq(gr[BlarrrrStyle], Some(blar))
}
- "missing" - {
+ test("missing") - {
assertEq(gr[S2].isEmpty, true)
}
- "onRegistration" - {
+ test("onRegistration") - {
assertEq(postreg, Vector(s1, blar))
}
}
diff --git a/core/shared/src/test/scala/scalacss/internal/mutable/NameGenTest.scala b/core/shared/src/test/scala/scalacss/internal/mutable/NameGenTest.scala
index 4f39e4d0..f1cf3a3d 100644
--- a/core/shared/src/test/scala/scalacss/internal/mutable/NameGenTest.scala
+++ b/core/shared/src/test/scala/scalacss/internal/mutable/NameGenTest.scala
@@ -8,7 +8,7 @@ import utest._
object NameGenTest extends TestSuite {
override def tests = Tests {
- "nameGenUniqueAndAscii" - {
+ test("nameGenUniqueAndAscii") - {
val classesAmount = 1000
val classNames = (1 to classesAmount).map(_ => NameGen.short().next(ClassNameHint("placeholder"))._1.value)
val uniqueClassNames = classNames.toSet
diff --git a/core/shared/src/test/scala/scalacss/internal/mutable/RegisterTest.scala b/core/shared/src/test/scala/scalacss/internal/mutable/RegisterTest.scala
index f98a5408..45f6402b 100644
--- a/core/shared/src/test/scala/scalacss/internal/mutable/RegisterTest.scala
+++ b/core/shared/src/test/scala/scalacss/internal/mutable/RegisterTest.scala
@@ -38,7 +38,7 @@ object RegisterTest extends TestSuite {
val reg = new Register(NameGen.numbered(), MacroName.Use, ErrorHandler.noisy)
implicit def cnh: ClassNameHint = ClassNameHint("blah")
- "registerS" - {
+ test("registerS") - {
val a1 = reg registerS ss1
val a2 = reg registerS ss2
val a3 = reg registerS ss3
@@ -52,7 +52,7 @@ object RegisterTest extends TestSuite {
assertEq(css.size, 4)
}
- "registerF" - {
+ test("registerF") - {
def test[I](f: I => StyleA, d: List[I]): Unit = {
d.foreach { i =>
assert(f(i) eq f(i))
diff --git a/downstream-tests/build.sbt b/downstream-tests/build.sbt
index 26cfcad3..3f7edf94 100644
--- a/downstream-tests/build.sbt
+++ b/downstream-tests/build.sbt
@@ -111,7 +111,7 @@ lazy val js = project
libraryDependencies ++= {
val ver = version.value.stripSuffix("-SNAPSHOT") + "-SNAPSHOT"
Seq(
- "com.github.japgolly.scalacss" %%% "core" % ver,
+ "com.github.gmixa.scalacss" %%% "core" % ver,
Dep.microlibsCompileTime.value % Test,
Dep.microlibsTestUtil.value % Test,
)
diff --git a/ext-react/src/test/scala/scalacss/ReactTest.scala b/ext-react/src/test/scala/scalacss/ReactTest.scala
index 551aba6f..0d3b4efd 100644
--- a/ext-react/src/test/scala/scalacss/ReactTest.scala
+++ b/ext-react/src/test/scala/scalacss/ReactTest.scala
@@ -6,7 +6,7 @@ import org.scalajs.dom.{HTMLStyleElement, document}
import scalacss.ScalaCssReact._
import scalacss.TestUtil._
import scalacss.internal.mutable.StyleSheetRegistry
-import utest._
+import utest.{TestSuite, Tests, test}
object ReactTest extends TestSuite {
import scalacss.DevDefaults._
@@ -59,29 +59,29 @@ object ReactTest extends TestSuite {
override def tests = Tests {
- "styleReactElement" - {
+ test("styleReactElement") - {
val html = ReactDOMServer.renderToStaticMarkup(MyStyles.render[VdomElement])
assertStyle(html, expectedStyleTag1)
}
- "styleHtmlElement" - {
+ test("styleHtmlElement") - {
val html = MyStyles.render[HTMLStyleElement].outerHTML
assertStyle(html, expectedStyleTag1)
}
- "simple" - {
+ test("simple") - {
val el = <.input(^.`type` := "text", MyStyles.input, ^.defaultValue := "ah")
val html = ReactDOMServer.renderToStaticMarkup(el)
assertEq(html, """""")
}
- "addClassName" - {
+ test("addClassName") - {
val el = <.button(MyStyles.bootstrappy)
val html = ReactDOMServer.renderToStaticMarkup(el)
assertEq(html, """""")
}
- "addToDocumentOnRegistration" - {
+ test("addToDocumentOnRegistration") - {
val registry = new StyleSheetRegistry
registry.register(MyStyles, MyStyles2)
def count = document.head.childElementCount
diff --git a/ext-scalatags/js/src/main/scala/scalacss/ScalatagsJsDom.scala b/ext-scalatags/js/src/main/scala/scalacss/ScalatagsJsDom.scala
index 572921d3..054f6ba2 100644
--- a/ext-scalatags/js/src/main/scala/scalacss/ScalatagsJsDom.scala
+++ b/ext-scalatags/js/src/main/scala/scalacss/ScalatagsJsDom.scala
@@ -20,5 +20,5 @@ trait ScalatagsJsDomImplicits {
class ScalatagsJsDomRenderer(s: Renderer[String]) extends Renderer[TypedTag[HTMLStyleElement]] {
override def apply(css: Css) =
- tags2.style(`type` := "text/css", s(css))
+ tags2.style(`type` := "text/css", s(css)).asInstanceOf[TypedTag[HTMLStyleElement]]
}
diff --git a/ext-scalatags/shared/src/test/scala/scalacss/ScalatagsTest.scala b/ext-scalatags/shared/src/test/scala/scalacss/ScalatagsTest.scala
index dc1e28a9..e985251b 100644
--- a/ext-scalatags/shared/src/test/scala/scalacss/ScalatagsTest.scala
+++ b/ext-scalatags/shared/src/test/scala/scalacss/ScalatagsTest.scala
@@ -5,6 +5,8 @@ import scalacss.ScalatagsCss._
import scalacss.TestUtil._
import utest._
+import scala.language.postfixOps
+
object ScalatagsTest extends TestSuite {
object MyStyles extends StyleSheet.Inline {
@@ -27,7 +29,7 @@ object ScalatagsTest extends TestSuite {
override def tests = Tests {
- "styleTag" - {
+ test("styleTag") - {
val html = MyStyles.render[T].toString()
assertEq(html, """""".stripMargin)
}
- "simple" - {
+ test("simple") - {
val el = input(`type` := "text", MyStyles.input, value := "ah")
val html = el.toString()
assertEq(html, """""")
}
- "addClassName" - {
+ test("addClassName") - {
val el = button(MyStyles.bootstrappy)
val html = el.toString()
assertEq(html, """""")
}
- "multipleStyles" - {
+ test("multipleStyles") - {
val el = input(`type` := "text", MyStyles.input, MyStyles.required, value := "ah")
val html = el.toString()
assertEq(html, """""")
diff --git a/misc/build.sbt b/misc/build.sbt
index 45bcb276..ae813185 100644
--- a/misc/build.sbt
+++ b/misc/build.sbt
@@ -1,7 +1,7 @@
-scalaVersion := "2.12.4"
+scalaVersion := "2.12.19"
-libraryDependencies += "io.argonaut" %% "argonaut-scalaz" % "6.2"
-libraryDependencies += "org.scalaz" %% "scalaz-core" % "7.2.18"
+libraryDependencies += "io.argonaut" %% "argonaut-scalaz" % "6.3.10"
+libraryDependencies += "org.scalaz" %% "scalaz-core" % "7.3.8"
scalacOptions ++= Seq(
"-unchecked", "-deprecation",
diff --git a/misc/experiment/build.sbt b/misc/experiment/build.sbt
index 6ad5d014..7b30af23 100644
--- a/misc/experiment/build.sbt
+++ b/misc/experiment/build.sbt
@@ -1,8 +1,8 @@
-scalaVersion := "2.11.6"
+scalaVersion := "2.13.14"
-libraryDependencies += "org.scalaz" %% "scalaz-effect" % "7.1.1"
+libraryDependencies += "org.scalaz" %% "scalaz-effect" % "7.3.8"
-libraryDependencies += "com.chuusai" %% "shapeless" % "2.1.0"
+libraryDependencies += "com.chuusai" %% "shapeless" % "2.3.12"
scalacOptions ++= Seq(
"-unchecked", "-deprecation",
diff --git a/misc/experiment/project/plugins.sbt b/misc/experiment/project/plugins.sbt
new file mode 100644
index 00000000..0fb7b68c
--- /dev/null
+++ b/misc/experiment/project/plugins.sbt
@@ -0,0 +1 @@
+addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.3")
\ No newline at end of file
diff --git a/misc/project/build.properties b/misc/project/build.properties
index 8b697bbb..ee4c672c 100644
--- a/misc/project/build.properties
+++ b/misc/project/build.properties
@@ -1 +1 @@
-sbt.version=1.1.0
+sbt.version=1.10.1
diff --git a/project/Bench.scala b/project/Bench.scala
index e4746d59..b6853c59 100644
--- a/project/Bench.scala
+++ b/project/Bench.scala
@@ -22,7 +22,7 @@ object BenchBuild {
lazy val bench =
benchModule("bench", identity)
- .configure(commonSettings.jvm)
+ .configure(commonSettings.js)
.aggregate(benchReactWith, benchReactWithout, benchBig)
.settings(
jsSizes := jsSizesTask.value,
diff --git a/project/Build.scala b/project/Build.scala
index c2389a3a..87900f4e 100644
--- a/project/Build.scala
+++ b/project/Build.scala
@@ -44,8 +44,8 @@ object ScalaCssBuild {
val commonSettings = ConfigureBoth(
_.settings(
- scalaVersion := Ver.scala2,
- crossScalaVersions := Seq(Ver.scala2, Ver.scala3),
+ scalaVersion := Ver.scala3,
+ crossScalaVersions := Seq(Ver.scala3, Ver.scala2),
scalacOptions ++= scalacCommonFlags,
scalacOptions ++= scalac2Flags.filter(_ => scalaVersion.value.startsWith("2")),
scalacOptions ++= scalac3Flags.filter(_ => scalaVersion.value.startsWith("3")),
@@ -83,6 +83,7 @@ object ScalaCssBuild {
definesMacros,
utestSettings)
.settings(
+ scalaVersion := "3.8.4",
libraryDependencies ++= Seq(
Dep.univEq.value,
Dep.nyayaGen.value % Test,
@@ -111,7 +112,6 @@ object ScalaCssBuild {
Dep.cats.value % Test,
),
)
- .configure(onlyScala2)
lazy val extReact = project
.in(file("ext-react"))
diff --git a/project/Dependencies.scala b/project/Dependencies.scala
index ccc0d1e1..26015942 100644
--- a/project/Dependencies.scala
+++ b/project/Dependencies.scala
@@ -9,19 +9,19 @@ object Dependencies {
object Ver {
// Exported
- val scala2 = "2.13.6"
- val scala3 = "3.0.1"
- val scalaJsDom = "2.0.0"
- val scalaJsReact = "2.0.0"
- val scalatags = "0.10.0"
- val univEq = "2.0.0"
+ val scala2 = "2.13.18"
+ val scala3 = "3.8.4"
+ val scalaJsDom = "2.8.1"
+ val scalaJsReact = "4.0.0"
+ val scalatags = "0.13.1"
+ val univEq = "2.1.0"
// Internal
- val cats = "2.6.1"
- val microlibs = "4.0.0"
- val nyaya = "1.0.0"
- val reactJs = "17.0.2"
- val utest = "0.7.10"
+ val cats = "2.13.0"
+ val microlibs = "4.2.1"
+ val nyaya = "1.1.0"
+ val reactJs = "17.0.1"
+ val utest = "0.9.5"
}
object Dep {
@@ -38,7 +38,7 @@ object Dependencies {
val scalaJsReactDummy = Def.setting("com.github.japgolly.scalajs-react" %%% "util-dummy-defaults" % Ver.scalaJsReact)
val scalaJsReactTest = Def.setting("com.github.japgolly.scalajs-react" %%% "test" % Ver.scalaJsReact)
val scalaReflect = Def.setting("org.scala-lang" % "scala-reflect" % scalaVersion.value)
- val scalatags = Def.setting("com.lihaoyi" %%% "scalatags" % Ver.scalatags cross CrossVersion.for3Use2_13)
+ val scalatags = Def.setting("com.lihaoyi" %%% "scalatags" % Ver.scalatags)
val univEq = Def.setting("com.github.japgolly.univeq" %%% "univeq" % Ver.univEq)
val utest = Def.setting("com.lihaoyi" %%% "utest" % Ver.utest)
}
diff --git a/project/build.properties b/project/build.properties
index 10fd9eee..7c95fc19 100644
--- a/project/build.properties
+++ b/project/build.properties
@@ -1 +1 @@
-sbt.version=1.5.5
+sbt.version=1.12.13
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 809fbace..876cb7ff 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -1,9 +1,12 @@
-libraryDependencies += "org.scala-js" %% "scalajs-env-jsdom-nodejs" % "1.1.0"
+libraryDependencies += "org.scala-js" %% "scalajs-env-jsdom-nodejs" % "1.1.1"
-addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.31")
-addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.13")
-addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.1.1")
-addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0")
-addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.1")
+addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.14.7")
+addSbtPlugin("com.github.sbt" % "sbt-release" % "1.5.0")
+addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.1")
+addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2")
+addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.22.0")
addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.2")
-addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.10")
+addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.12.2")
+addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.3")
+
+//addSbtPlugin("org.jmotor.sbt" % "sbt-dependency-updates" % "1.2.9")
diff --git a/scalafix.sbt b/scalafix.sbt
index 302b0f47..188c15f1 100644
--- a/scalafix.sbt
+++ b/scalafix.sbt
@@ -7,10 +7,8 @@ ThisBuild / scalacOptions ++= {
ThisBuild / semanticdbEnabled := true
-ThisBuild / semanticdbVersion := "4.4.29"
-
-ThisBuild / scalafixScalaBinaryVersion := "2.13"
+ThisBuild / semanticdbVersion := "4.17.0"
ThisBuild / scalafixDependencies ++= Seq(
- "com.github.liancheng" %% "organize-imports" % "0.5.0"
+ "com.github.liancheng" %% "organize-imports" % "0.6.0"
)
diff --git a/version.sbt b/version.sbt
index dc11afef..67d9433f 100644
--- a/version.sbt
+++ b/version.sbt
@@ -1 +1 @@
-version in ThisBuild := "1.0.1-SNAPSHOT"
+ThisBuild / version := "1.0.1-SNAPSHOT"
diff --git a/yarn.lock b/yarn.lock
index b813c74c..a72f3d55 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -236,6 +236,13 @@ d@1:
dependencies:
es5-ext "^0.10.9"
+d@^1.0.1, d@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/d/-/d-1.0.2.tgz#2aefd554b81981e7dccf72d6842ae725cb17e5de"
+ dependencies:
+ es5-ext "^0.10.64"
+ type "^2.7.2"
+
dashdash@^1.12.0:
version "1.14.1"
resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
@@ -243,8 +250,8 @@ dashdash@^1.12.0:
assert-plus "^1.0.0"
debug@^2.2.0:
- version "2.6.8"
- resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc"
+ version "2.6.9"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
dependencies:
ms "2.0.0"
@@ -283,32 +290,63 @@ editor@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/editor/-/editor-1.0.0.tgz#60c7f87bd62bcc6a894fa8ccd6afb7823a24f742"
-es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14:
- version "0.10.23"
- resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.23.tgz#7578b51be974207a5487821b56538c224e4e7b38"
+es5-ext@^0.10.35, es5-ext@^0.10.62, es5-ext@^0.10.64, es5-ext@^0.10.9, es5-ext@~0.10.14:
+ version "0.10.64"
+ resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.64.tgz#12e4ffb48f1ba2ea777f1fcdd1918ef73ea21714"
dependencies:
- es6-iterator "2"
- es6-symbol "~3.1"
+ es6-iterator "^2.0.3"
+ es6-symbol "^3.1.3"
+ esniff "^2.0.1"
+ next-tick "^1.1.0"
-es6-iterator@2:
- version "2.0.1"
- resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512"
+es6-iterator@^2.0.3:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7"
dependencies:
d "1"
- es5-ext "^0.10.14"
- es6-symbol "^3.1"
+ es5-ext "^0.10.35"
+ es6-symbol "^3.1.1"
-es6-symbol@^3.0.2, es6-symbol@^3.1, es6-symbol@~3.1:
+es6-symbol@^3.0.2:
version "3.1.1"
resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77"
dependencies:
d "1"
es5-ext "~0.10.14"
+es6-symbol@^3.1.1, es6-symbol@^3.1.3:
+ version "3.1.4"
+ resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.4.tgz#f4e7d28013770b4208ecbf3e0bf14d3bcb557b8c"
+ dependencies:
+ d "^1.0.2"
+ ext "^1.7.0"
+
escape-string-regexp@^1.0.2:
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
+esniff@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/esniff/-/esniff-2.0.1.tgz#a4d4b43a5c71c7ec51c51098c1d8a29081f9b308"
+ dependencies:
+ d "^1.0.1"
+ es5-ext "^0.10.62"
+ event-emitter "^0.3.5"
+ type "^2.7.2"
+
+event-emitter@^0.3.5:
+ version "0.3.5"
+ resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39"
+ dependencies:
+ d "1"
+ es5-ext "~0.10.14"
+
+ext@^1.7.0:
+ version "1.7.0"
+ resolved "https://registry.yarnpkg.com/ext/-/ext-1.7.0.tgz#0ea4383c0103d60e70be99e9a7f11027a33c4f5f"
+ dependencies:
+ type "^2.7.2"
+
extend@~3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444"
@@ -566,13 +604,18 @@ is-builtin-module@^1.0.0:
dependencies:
builtin-modules "^1.0.0"
+is-my-ip-valid@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/is-my-ip-valid/-/is-my-ip-valid-1.0.1.tgz#f7220d1146257c98672e6fba097a9f3f2d348442"
+
is-my-json-valid@^2.12.4:
- version "2.16.0"
- resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693"
+ version "2.20.6"
+ resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.20.6.tgz#a9d89e56a36493c77bda1440d69ae0dc46a08387"
dependencies:
generate-function "^2.0.0"
generate-object-property "^1.1.0"
- jsonpointer "^4.0.0"
+ is-my-ip-valid "^1.0.0"
+ jsonpointer "^5.0.0"
xtend "^4.0.0"
is-property@^1.0.0:
@@ -623,9 +666,9 @@ jsonfile@^2.1.0:
optionalDependencies:
graceful-fs "^4.1.6"
-jsonpointer@^4.0.0:
- version "4.0.1"
- resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9"
+jsonpointer@^5.0.0:
+ version "5.0.1"
+ resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-5.0.1.tgz#2110e0af0900fd37467b5907ecd13a7884a1b559"
jsprim@^1.2.2:
version "1.4.0"
@@ -811,6 +854,10 @@ mute-stream@~0.0.4:
version "0.0.7"
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
+next-tick@^1.1.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb"
+
node-gyp@~3.3.0:
version "3.3.1"
resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.3.1.tgz#80f7b6d7c2f9c0495ba42c518a670c99bdf6e4a0"
@@ -1500,6 +1547,10 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0:
version "0.14.5"
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"
+type@^2.7.2:
+ version "2.7.3"
+ resolved "https://registry.yarnpkg.com/type/-/type-2.7.3.tgz#436981652129285cc3ba94f392886c2637ea0486"
+
typedarray@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"