From b100969bbc257e19d571648d5a23e624f8371b91 Mon Sep 17 00:00:00 2001 From: Fabio Pinheiro Date: Wed, 15 Nov 2023 23:32:30 +0000 Subject: [PATCH] New: `anywhere` keyword for overflow-wrap style prop (#101) --- .../defs/styles/traits/OverflowWrap.scala | 9 +++++++++ .../raquo/domtypes/defs/styles/StyleTraitDefs.scala | 13 +++++++++++++ 2 files changed, 22 insertions(+) diff --git a/js/src/test/scala/com/thirdparty/defs/styles/traits/OverflowWrap.scala b/js/src/test/scala/com/thirdparty/defs/styles/traits/OverflowWrap.scala index 15e61ba5..82cee825 100644 --- a/js/src/test/scala/com/thirdparty/defs/styles/traits/OverflowWrap.scala +++ b/js/src/test/scala/com/thirdparty/defs/styles/traits/OverflowWrap.scala @@ -13,6 +13,15 @@ trait OverflowWrap extends Normal { this: StyleProp[_] => /** Indicates that lines may only break at normal word break points. */ override lazy val normal: StyleSetter[_] = this := "normal" + /** + * Indicates that normally unbreakable words may be broken at any points + * if there are no otherwise-acceptable break points in the line. + * No hyphenation character is inserted at the break point. Soft wrap + * opportunities introduced by the word break are considered when calculating + * min-content intrinsic sizes. + */ + lazy val anywhere: StyleSetter[_] = this := "anywhere" + /** * Indicates that normally unbreakable words may be broken at arbitrary * points if there are no otherwise acceptable break points in the line. diff --git a/shared/src/main/scala/com/raquo/domtypes/defs/styles/StyleTraitDefs.scala b/shared/src/main/scala/com/raquo/domtypes/defs/styles/StyleTraitDefs.scala index fabb17ac..d6374f85 100644 --- a/shared/src/main/scala/com/raquo/domtypes/defs/styles/StyleTraitDefs.scala +++ b/shared/src/main/scala/com/raquo/domtypes/defs/styles/StyleTraitDefs.scala @@ -2020,6 +2020,19 @@ object StyleTraitDefs { docUrls = Nil, ), + StyleKeywordDef( + scalaName = "anywhere", + domName = "anywhere", + commentLines = List( + "Indicates that normally unbreakable words may be broken at any points", + "if there are no otherwise-acceptable break points in the line.", + "No hyphenation character is inserted at the break point. Soft wrap", + "opportunities introduced by the word break are considered when calculating", + "min-content intrinsic sizes.", + ), + docUrls = Nil, + ), + StyleKeywordDef( scalaName = "breakWord", domName = "break-word",