Skip to content

Commit d7f6ed3

Browse files
committed
Add classList to Svg.Attributes
1 parent 8d8ef66 commit d7f6ed3

File tree

1 file changed

+31
-22
lines changed

1 file changed

+31
-22
lines changed

src/Svg/Attributes.elm

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ module Svg.Attributes exposing
22
( accentHeight, accelerate, accumulate, additive, alphabetic, allowReorder
33
, amplitude, arabicForm, ascent, attributeName, attributeType, autoReverse
44
, azimuth, baseFrequency, baseProfile, bbox, begin, bias, by, calcMode
5-
, capHeight, class, clipPathUnits, contentScriptType, contentStyleType, cx, cy
6-
, d, decelerate, descent, diffuseConstant, divisor, dur, dx, dy, edgeMode
7-
, elevation, end, exponent, externalResourcesRequired, filterRes, filterUnits
8-
, format, from, fx, fy, g1, g2, glyphName, glyphRef, gradientTransform
9-
, gradientUnits, hanging, height, horizAdvX, horizOriginX, horizOriginY, id
10-
, ideographic, in_, in2, intercept, k, k1, k2, k3, k4, kernelMatrix
11-
, kernelUnitLength, keyPoints, keySplines, keyTimes, lang, lengthAdjust
12-
, limitingConeAngle, local, markerHeight, markerUnits, markerWidth
13-
, maskContentUnits, maskUnits, mathematical, max, media, method, min, mode
14-
, name, numOctaves, offset, operator, order, orient, orientation, origin
15-
, overlinePosition, overlineThickness, panose1, path, pathLength
5+
, capHeight, class, classList, clipPathUnits, contentScriptType
6+
, contentStyleType, cx, cy , d, decelerate, descent, diffuseConstant, divisor
7+
, dur, dx, dy, edgeMode , elevation, end, exponent, externalResourcesRequired
8+
, filterRes, filterUnits, format, from, fx, fy, g1, g2, glyphName, glyphRef
9+
, gradientTransform, gradientUnits, hanging, height, horizAdvX, horizOriginX
10+
, horizOriginY, id, ideographic, in_, in2, intercept, k, k1, k2, k3, k4
11+
, kernelMatrix, kernelUnitLength, keyPoints, keySplines, keyTimes, lang
12+
, lengthAdjust, limitingConeAngle, local, markerHeight, markerUnits
13+
, markerWidth, maskContentUnits, maskUnits, mathematical, max, media, method
14+
, min, mode, name, numOctaves, offset, operator, order, orient, orientation
15+
, origin, overlinePosition, overlineThickness, panose1, path, pathLength
1616
, patternContentUnits, patternTransform, patternUnits, pointOrder, points
1717
, pointsAtX, pointsAtY, pointsAtZ, preserveAlpha, preserveAspectRatio
1818
, primitiveUnits, r, radius, refX, refY, renderingIntent, repeatCount
@@ -48,17 +48,17 @@ module Svg.Attributes exposing
4848
@docs accentHeight, accelerate, accumulate, additive, alphabetic, allowReorder,
4949
amplitude, arabicForm, ascent, attributeName, attributeType, autoReverse,
5050
azimuth, baseFrequency, baseProfile, bbox, begin, bias, by, calcMode,
51-
capHeight, class, clipPathUnits, contentScriptType, contentStyleType, cx, cy,
52-
d, decelerate, descent, diffuseConstant, divisor, dur, dx, dy, edgeMode,
53-
elevation, end, exponent, externalResourcesRequired, filterRes, filterUnits,
54-
format, from, fx, fy, g1, g2, glyphName, glyphRef, gradientTransform,
55-
gradientUnits, hanging, height, horizAdvX, horizOriginX, horizOriginY, id,
56-
ideographic, in_, in2, intercept, k, k1, k2, k3, k4, kernelMatrix,
57-
kernelUnitLength, keyPoints, keySplines, keyTimes, lang, lengthAdjust,
58-
limitingConeAngle, local, markerHeight, markerUnits, markerWidth,
59-
maskContentUnits, maskUnits, mathematical, max, media, method, min, mode,
60-
name, numOctaves, offset, operator, order, orient, orientation, origin,
61-
overlinePosition, overlineThickness, panose1, path, pathLength,
51+
capHeight, class, classList, clipPathUnits, contentScriptType
52+
contentStyleType, cx, cy , d, decelerate, descent, diffuseConstant, divisor,
53+
dur, dx, dy, edgeMode , elevation, end, exponent, externalResourcesRequired,
54+
filterRes, filterUnits, format, from, fx, fy, g1, g2, glyphName, glyphRef,
55+
gradientTransform, gradientUnits, hanging, height, horizAdvX, horizOriginX,
56+
horizOriginY, id, ideographic, in_, in2, intercept, k, k1, k2, k3, k4,
57+
kernelMatrix, kernelUnitLength, keyPoints, keySplines, keyTimes, lang,
58+
lengthAdjust, limitingConeAngle, local, markerHeight, markerUnits,
59+
markerWidth, maskContentUnits, maskUnits, mathematical, max, media, method,
60+
min, mode, name, numOctaves, offset, operator, order, orient, orientation,
61+
origin, overlinePosition, overlineThickness, panose1, path, pathLength,
6262
patternContentUnits, patternTransform, patternUnits, pointOrder, points,
6363
pointsAtX, pointsAtY, pointsAtZ, preserveAlpha, preserveAspectRatio,
6464
primitiveUnits, r, radius, refX, refY, renderingIntent, repeatCount,
@@ -230,6 +230,15 @@ class : String -> Attribute msg
230230
class =
231231
Elm.Kernel.Svg.attribute "class"
232232

233+
{-|-}
234+
classList : List ( String, Bool ) -> Svg.Attribute msg
235+
classList list =
236+
list
237+
|> List.filter Tuple.second
238+
|> List.map Tuple.first
239+
|> String.join " "
240+
|> class
241+
233242

234243
{-|-}
235244
clipPathUnits : String -> Attribute msg

0 commit comments

Comments
 (0)