Open chipsenkbeil opened 7 years ago
I was trying to do the following, which almost works:
object MyStylesheet extends CascadingStyleSheet {
import scalatags.Text.styles2.{content => afterContent}
val someClass = cls(
&.pseudoExtend(":after")(
display := "inline-block",
afterContent := "\\f107",
opacity := 0.5,
color := "#102429",
fontSize := "inherit"
)
)
}
However, the content block gets converted into content: \f107;
when I invoke styleSheetText
. Without the quotes, it ends up breaking in the browser. If I try to insert quotes into the string, they get escaped into "e;
.
Looks like I can get around the problem by embedding single quotes.
afterContent := "'\\f107'"
They're not really supported right now, but I'd love a patch to make them work
You've got pseudo-selectors. Are psuedo-elements (https://developer.mozilla.org/en-US/docs/Web/CSS/pseudo-elements) supported in any form? Wanted to add
::after
to an element.I see mention of
::after
here: https://github.com/lihaoyi/scalatags/blob/master/scalatags/shared/src/main/scala/scalatags/generic/Styles.scala#L575