Skip to content

allow svg tag <use> #23

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

Open
wants to merge 2 commits 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
10 changes: 9 additions & 1 deletion src/tink/domspec/Attributes.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package tink.domspec;

import tink.domspec.Style;

typedef GlobalAttr<Style> = {
@:global @:html('class') @:optional var className(default, never):ClassName;
@:global @:optional var id(default, never):String;
Expand Down Expand Up @@ -360,7 +361,9 @@ typedef EmbedAttr = {
}

// svg attr reference: https://github.com/dumistoklus/svg-xsd-schema/blob/master/svg.xsd
typedef SvgAttr = {>GlobalAttr<Style>,
typedef SvgAttr = {
>GlobalAttr<Style>,
>tink.svgspec.PresentationAttributes,
@:optional var width(default, never):String;
@:optional var height(default, never):String;
@:optional var viewBox(default, never):String;// TODO: consider validating constant strings via typedef with @:fromHxx
Expand Down Expand Up @@ -388,3 +391,8 @@ typedef EllipseAttr = {
> GlobalAttr<SvgStyle>,
> tink.svgspec.Attributes.EllipseAttr,
}

typedef UseAttr = {
> GlobalAttr<SvgStyle>,
> tink.svgspec.Attributes.UseAttr,
}
1 change: 1 addition & 0 deletions src/tink/domspec/Tags.hx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ typedef Tags = {
@:element(js.html.svg.CircleElement) var circle:CircleAttr;
@:element(js.html.svg.RectElement) var rect:RectAttr;
@:element(js.html.svg.EllipseElement) var ellipse:EllipseAttr;
@:element(js.html.svg.UseElement) var use:UseAttr;
}
var opaque:{
var textarea:TextAreaAttr;//right?
Expand Down