Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Support text overflow #135

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion core/shared/src/main/scala/scalacss/internal/Attrs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2164,7 +2164,12 @@ object Attrs {
*
* @see <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/text-overflow">MDN</a>
*/
final def textOverflow = Attr.real("text-overflow", Transform keys CanIUse.textOverflow)
object textOverflow extends TypedAttrBase {
override val attr = Attr.real("text-overflow")
def ellipsis = av(L.ellipsis)
def clip = av(L.clip)
def fade = av(L.fade)
}

/**
* The text-rendering CSS property provides information to the rendering engine about what to optimize for when rendering text. The browser makes trade-offs among speed, legibility, and geometric precision. The text-rendering property is an SVG property that is not defined in any CSS standard. However, Gecko and WebKit browsers let you apply this property to HTML and XML content on Windows, Mac OS X and Linux.
Expand Down
1 change: 1 addition & 0 deletions core/shared/src/main/scala/scalacss/internal/Values.scala
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ object Literal extends TypedLiteralAliases {
def expanded : Value = "expanded"
def extraCondensed : Value = "extra-condensed"
def extraExpanded : Value = "extra-expanded"
def fade : Value = "fade"
def fill : Value = "fill"
def fillAvailable : Value = "fill-available"
def firstBaseline : Value = "first baseline"
Expand Down
9 changes: 9 additions & 0 deletions core/shared/src/test/scala/scalacss/internal/AttrTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ object AttrTest extends TestSuite {
test(gridTemplateAreas("a b"), """ "a b" """)
test(gridTemplateAreas("a b", "c d"), """ "a b" "c d" """)
}

'pointerEvents {
def test(av: AV, exp: String): Unit = assertEq(av.value, exp.trim)
test(pointerEvents.auto, "auto")
Expand All @@ -167,6 +168,7 @@ object AttrTest extends TestSuite {
test(pointerEvents.initial, "initial")
test(pointerEvents.unset, "unset")
}

'justifyContent {
def test(av: AV, exp: String): Unit = assertEq(av.value, exp.trim)
test(justifyContent.center , "center")
Expand All @@ -189,5 +191,12 @@ object AttrTest extends TestSuite {
test(justifyContent.initial , "initial")
test(justifyContent.unset , "unset")
}

'textOverflow {
def test(av: AV, exp: String): Unit = assertEq(av.value, exp)
test(textOverflow.ellipsis , "ellipsis")
test(textOverflow.clip , "clip")
test(textOverflow.fade , "fade")
}
}
}
1 change: 1 addition & 0 deletions doc/history/0.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
# 0.5.6
* New CSS attributes:
* `pointer-events`
* `text-overflow`
* New CSS values:
* `justify-content: start|end|left|right|baseline|first baseline|last baseline|space-evenly|stretch|safe center|unsafe center`

Expand Down