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

Distinguish SVG attributes that do not overlap with HTML attributes #90

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
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ trait Bundle[Builder, Output <: FragT, FragT] extends Aliases[Builder, Output, F
val svgTags: SvgTags

/**
* SVG only attributes
* SVG attributes
*/
val svgAttrs: SvgAttrs
}
Expand All @@ -87,6 +87,7 @@ trait Aliases[Builder, Output <: FragT, FragT]{
type Styles = generic.Styles[Builder, Output, FragT]
type Styles2 = generic.Styles2[Builder, Output, FragT]
type SvgTags = generic.SvgTags[Builder, Output, FragT]
type SvgOnlyAttrs = generic.SvgOnlyAttrs[Builder, Output, FragT]
type SvgAttrs = generic.SvgAttrs[Builder, Output, FragT]
type Util = generic.Util[Builder, Output, FragT]
type AttrPair = generic.AttrPair[Builder, FragT]
Expand Down
129 changes: 66 additions & 63 deletions scalatags/shared/src/main/scala/scalatags/generic/SvgAttrs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ package generic

import acyclic.file


trait SvgAttrs[Builder, Output <: FragT, FragT] extends Util[Builder, Output, FragT] {
/**
* A list of SVG Attributes not also found in Attrs
*/
trait SvgOnlyAttrs[Builder, Output <: FragT, FragT] extends Util[Builder, Output, FragT] {

/**
* This attribute defines the distance from the origin to the top of accent characters,
Expand Down Expand Up @@ -191,23 +193,6 @@ trait SvgAttrs[Builder, Output <: FragT, FragT] extends Util[Builder, Output, Fr
val calcMode = "calcMode".attr


/**
* Assigns a class name or set of class names to an element. You may assign the same
* class name or names to any number of elements. If you specify multiple class names,
* they must be separated by whitespace characters.
* The class name of an element has two key roles:
* -As a style sheet selector, for use when an author wants to assign style
* information to a set of elements.
* -For general usage by the browser.
* The class can be used to style SVG content using CSS.
*
* Value <list-of-class-names>
*
* MDN
*/
val `class` = "class".attr


/**
* The clip attribute has the same parameter values as defined for the css clip property.
* Unitless values, which indicate current user coordinates, are permitted on the coordinate
Expand Down Expand Up @@ -669,8 +654,6 @@ trait SvgAttrs[Builder, Output <: FragT, FragT] extends Util[Builder, Output, Fr
*/
val imageRendering = "imageRendering".attr

val id = "id".attr

/**
*
*
Expand Down Expand Up @@ -874,24 +857,6 @@ trait SvgAttrs[Builder, Output <: FragT, FragT] extends Util[Builder, Output, Fr
val mask = "mak".attr



/**
*
*
* MDN
*/
val max = "max".attr



/**
*
*
* MDN
*/
val min = "min".attr


/**
*
*
Expand Down Expand Up @@ -1287,15 +1252,6 @@ trait SvgAttrs[Builder, Output <: FragT, FragT] extends Util[Builder, Output, Fr
val strokeWidth = "stroke-width".attr


/**
*
*
* MDN
*/
val style = "style".attr



/**
*
*
Expand Down Expand Up @@ -1360,14 +1316,6 @@ trait SvgAttrs[Builder, Output <: FragT, FragT] extends Util[Builder, Output, Fr
val transform = "transform".attr


/*
*
*
* MDN
*/
val `type`= "type".attr


/*
*
*
Expand Down Expand Up @@ -1479,50 +1427,105 @@ trait SvgAttrs[Builder, Output <: FragT, FragT] extends Util[Builder, Output, Fr
val xmlSpace = "xml:space".attr


/**
/*
*
*
* MDN
*/
val xmlns = "xmlns".attr
val y = "y".attr


/*
*
*
* MDN
*/
val y = "y".attr
val y1 = "y1".attr


/*
*
*
* MDN
*/
val y1 = "y1".attr
val y2 = "y2".attr


/*
*
*
* MDN
*/
val y2 = "y2".attr
val yChannelSelector = "yChannelSelector".attr


/*
*
*
* MDN
*/
val yChannelSelector = "yChannelSelector".attr
val z = "z".attr
}

/**
* All SVG Attributes
*/
trait SvgAttrs[Builder, Output <: FragT, FragT] extends SvgOnlyAttrs[Builder, Output, FragT] {
/**
* Assigns a class name or set of class names to an element. You may assign the same
* class name or names to any number of elements. If you specify multiple class names,
* they must be separated by whitespace characters.
* The class name of an element has two key roles:
* -As a style sheet selector, for use when an author wants to assign style
* information to a set of elements.
* -For general usage by the browser.
* The class can be used to style SVG content using CSS.
*
* Value <list-of-class-names>
*
* MDN
*/
val `class` = "class".attr

val id = "id".attr


/**
*
*
* MDN
*/
val max = "max".attr


/**
*
*
* MDN
*/
val min = "min".attr


/**
*
*
* MDN
*/
val style = "style".attr


/*
*
*
* MDN
*/
val z = "z".attr
val `type`= "type".attr


/**
*
*
* MDN
*/
val xmlns = "xmlns".attr
}