Skip to content

Conversation

deterdw
Copy link

@deterdw deterdw commented May 30, 2015

This simple change creates a SVGOnlyAttrs trait that contains all the attributes that are unique to SVG (in the sense of not being members of the Attrs trait). The existing SVGAttrs trait is then formed by extending this trait with the few overlapping members.

In this way SVGAttrs remains fully backwards-compatible, but we are able to define a single object to hold all attributes, e.g. (where ST is scalatags.Text):

object * extends ST.Cap with ST.Attrs with ST.SvgOnlyAttrs

with is useful when working with SVG embedded in HTML. (One can alias all tags as <, all styles as ^ and all attributes as *, for example.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant