diff --git a/d2target/d2target.go b/d2target/d2target.go index 1c6ce1893..413547dca 100644 --- a/d2target/d2target.go +++ b/d2target/d2target.go @@ -163,16 +163,6 @@ type Shape struct { func (s Shape) CSSStyle() string { out := "" - if s.Type == ShapeSQLTable || s.Type == ShapeClass { - // Fill is used for header fill in these types - // This fill property is just background of rows - out += fmt.Sprintf(`fill:%s;`, s.Stroke) - // Stroke (border) of these shapes should match the header fill - out += fmt.Sprintf(`stroke:%s;`, s.Fill) - } else { - out += fmt.Sprintf(`fill:%s;`, s.Fill) - out += fmt.Sprintf(`stroke:%s;`, s.Stroke) - } out += fmt.Sprintf(`opacity:%f;`, s.Opacity) out += fmt.Sprintf(`stroke-width:%d;`, s.StrokeWidth) if s.StrokeDash != 0 { @@ -278,7 +268,6 @@ func BaseConnection() *Connection { func (c Connection) CSSStyle() string { out := "" - out += fmt.Sprintf(`stroke:%s;`, c.Stroke) out += fmt.Sprintf(`opacity:%f;`, c.Opacity) out += fmt.Sprintf(`stroke-width:%d;`, c.StrokeWidth) strokeDash := c.StrokeDash diff --git a/lib/svg/style/common.go b/lib/svg/style/common.go index 6ff9fe302..d3ed1fbfd 100644 --- a/lib/svg/style/common.go +++ b/lib/svg/style/common.go @@ -1,25 +1,9 @@ package style import ( - "fmt" - "oss.terrastruct.com/d2/d2target" - "oss.terrastruct.com/d2/lib/svg" ) -func ShapeStyle(shape d2target.Shape) string { - out := "" - - out += fmt.Sprintf(`opacity:%f;`, shape.Opacity) - out += fmt.Sprintf(`stroke-width:%d;`, shape.StrokeWidth) - if shape.StrokeDash != 0 { - dashSize, gapSize := svg.GetStrokeDashAttributes(float64(shape.StrokeWidth), shape.StrokeDash) - out += fmt.Sprintf(`stroke-dasharray:%f,%f;`, dashSize, gapSize) - } - - return out -} - func ShapeTheme(shape d2target.Shape) (fill, stroke string) { if shape.Type == d2target.ShapeSQLTable || shape.Type == d2target.ShapeClass { // Fill is used for header fill in these types @@ -34,19 +18,6 @@ func ShapeTheme(shape d2target.Shape) (fill, stroke string) { return fill, stroke } -func ConnectionStyle(connection d2target.Connection) string { - out := "" - - out += fmt.Sprintf(`opacity:%f;`, connection.Opacity) - out += fmt.Sprintf(`stroke-width:%d;`, connection.StrokeWidth) - if connection.StrokeDash != 0 { - dashSize, gapSize := svg.GetStrokeDashAttributes(float64(connection.StrokeWidth), connection.StrokeDash) - out += fmt.Sprintf(`stroke-dasharray:%f,%f;`, dashSize, gapSize) - } - - return out -} - func ConnectionTheme(connection d2target.Connection) (stroke string) { return connection.Stroke }