fix origami theme
|
|
@ -62,11 +62,9 @@ func applyTheme(shape *d2target.Shape, obj *d2graph.Object, theme *d2themes.Them
|
||||||
if len(obj.ChildrenArray) > 0 {
|
if len(obj.ChildrenArray) > 0 {
|
||||||
shape.FillPattern = "dots"
|
shape.FillPattern = "dots"
|
||||||
}
|
}
|
||||||
} else if theme.SpecialRules.ContainerPaper {
|
} else if theme.SpecialRules.AllPaper {
|
||||||
if len(obj.ChildrenArray) > 0 {
|
|
||||||
shape.FillPattern = "paper"
|
shape.FillPattern = "paper"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if theme.SpecialRules.Mono {
|
if theme.SpecialRules.Mono {
|
||||||
shape.FontFamily = "mono"
|
shape.FontFamily = "mono"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ type SpecialRules struct {
|
||||||
ContainerDots bool `json:"containerDots"`
|
ContainerDots bool `json:"containerDots"`
|
||||||
CapsLock bool `json:"capsLock"`
|
CapsLock bool `json:"capsLock"`
|
||||||
|
|
||||||
ContainerPaper bool `json:"containerPaper"`
|
AllPaper bool `json:"allPaper"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Theme) IsDark() bool {
|
func (t *Theme) IsDark() bool {
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ var Origami = d2themes.Theme{
|
||||||
SpecialRules: d2themes.SpecialRules{
|
SpecialRules: d2themes.SpecialRules{
|
||||||
NoCornerRadius: true,
|
NoCornerRadius: true,
|
||||||
OuterContainerDoubleBorder: true,
|
OuterContainerDoubleBorder: true,
|
||||||
ContainerPaper: true,
|
AllPaper: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
7
e2etests/testdata/themes/origami/dagre/board.exp.json
generated
vendored
|
|
@ -101,6 +101,7 @@
|
||||||
"strokeWidth": 2,
|
"strokeWidth": 2,
|
||||||
"borderRadius": 0,
|
"borderRadius": 0,
|
||||||
"fill": "AA5",
|
"fill": "AA5",
|
||||||
|
"fillPattern": "paper",
|
||||||
"stroke": "B1",
|
"stroke": "B1",
|
||||||
"shadow": false,
|
"shadow": false,
|
||||||
"3d": false,
|
"3d": false,
|
||||||
|
|
@ -142,6 +143,7 @@
|
||||||
"strokeWidth": 2,
|
"strokeWidth": 2,
|
||||||
"borderRadius": 0,
|
"borderRadius": 0,
|
||||||
"fill": "B6",
|
"fill": "B6",
|
||||||
|
"fillPattern": "paper",
|
||||||
"stroke": "B1",
|
"stroke": "B1",
|
||||||
"shadow": false,
|
"shadow": false,
|
||||||
"3d": false,
|
"3d": false,
|
||||||
|
|
@ -225,6 +227,7 @@
|
||||||
"strokeWidth": 2,
|
"strokeWidth": 2,
|
||||||
"borderRadius": 0,
|
"borderRadius": 0,
|
||||||
"fill": "N5",
|
"fill": "N5",
|
||||||
|
"fillPattern": "paper",
|
||||||
"stroke": "B1",
|
"stroke": "B1",
|
||||||
"shadow": false,
|
"shadow": false,
|
||||||
"3d": false,
|
"3d": false,
|
||||||
|
|
@ -308,6 +311,7 @@
|
||||||
"strokeWidth": 2,
|
"strokeWidth": 2,
|
||||||
"borderRadius": 0,
|
"borderRadius": 0,
|
||||||
"fill": "AA5",
|
"fill": "AA5",
|
||||||
|
"fillPattern": "paper",
|
||||||
"stroke": "B1",
|
"stroke": "B1",
|
||||||
"shadow": false,
|
"shadow": false,
|
||||||
"3d": false,
|
"3d": false,
|
||||||
|
|
@ -349,6 +353,7 @@
|
||||||
"strokeWidth": 2,
|
"strokeWidth": 2,
|
||||||
"borderRadius": 0,
|
"borderRadius": 0,
|
||||||
"fill": "B3",
|
"fill": "B3",
|
||||||
|
"fillPattern": "paper",
|
||||||
"stroke": "B1",
|
"stroke": "B1",
|
||||||
"shadow": false,
|
"shadow": false,
|
||||||
"3d": false,
|
"3d": false,
|
||||||
|
|
@ -390,6 +395,7 @@
|
||||||
"strokeWidth": 2,
|
"strokeWidth": 2,
|
||||||
"borderRadius": 0,
|
"borderRadius": 0,
|
||||||
"fill": "B6",
|
"fill": "B6",
|
||||||
|
"fillPattern": "paper",
|
||||||
"stroke": "B1",
|
"stroke": "B1",
|
||||||
"shadow": false,
|
"shadow": false,
|
||||||
"3d": false,
|
"3d": false,
|
||||||
|
|
@ -431,6 +437,7 @@
|
||||||
"strokeWidth": 2,
|
"strokeWidth": 2,
|
||||||
"borderRadius": 0,
|
"borderRadius": 0,
|
||||||
"fill": "AB4",
|
"fill": "AB4",
|
||||||
|
"fillPattern": "paper",
|
||||||
"stroke": "B1",
|
"stroke": "B1",
|
||||||
"shadow": false,
|
"shadow": false,
|
||||||
"3d": false,
|
"3d": false,
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 453 KiB After Width: | Height: | Size: 455 KiB |
7
e2etests/testdata/themes/origami/elk/board.exp.json
generated
vendored
|
|
@ -101,6 +101,7 @@
|
||||||
"strokeWidth": 2,
|
"strokeWidth": 2,
|
||||||
"borderRadius": 0,
|
"borderRadius": 0,
|
||||||
"fill": "AA5",
|
"fill": "AA5",
|
||||||
|
"fillPattern": "paper",
|
||||||
"stroke": "B1",
|
"stroke": "B1",
|
||||||
"shadow": false,
|
"shadow": false,
|
||||||
"3d": false,
|
"3d": false,
|
||||||
|
|
@ -142,6 +143,7 @@
|
||||||
"strokeWidth": 2,
|
"strokeWidth": 2,
|
||||||
"borderRadius": 0,
|
"borderRadius": 0,
|
||||||
"fill": "B6",
|
"fill": "B6",
|
||||||
|
"fillPattern": "paper",
|
||||||
"stroke": "B1",
|
"stroke": "B1",
|
||||||
"shadow": false,
|
"shadow": false,
|
||||||
"3d": false,
|
"3d": false,
|
||||||
|
|
@ -225,6 +227,7 @@
|
||||||
"strokeWidth": 2,
|
"strokeWidth": 2,
|
||||||
"borderRadius": 0,
|
"borderRadius": 0,
|
||||||
"fill": "N5",
|
"fill": "N5",
|
||||||
|
"fillPattern": "paper",
|
||||||
"stroke": "B1",
|
"stroke": "B1",
|
||||||
"shadow": false,
|
"shadow": false,
|
||||||
"3d": false,
|
"3d": false,
|
||||||
|
|
@ -308,6 +311,7 @@
|
||||||
"strokeWidth": 2,
|
"strokeWidth": 2,
|
||||||
"borderRadius": 0,
|
"borderRadius": 0,
|
||||||
"fill": "AA5",
|
"fill": "AA5",
|
||||||
|
"fillPattern": "paper",
|
||||||
"stroke": "B1",
|
"stroke": "B1",
|
||||||
"shadow": false,
|
"shadow": false,
|
||||||
"3d": false,
|
"3d": false,
|
||||||
|
|
@ -349,6 +353,7 @@
|
||||||
"strokeWidth": 2,
|
"strokeWidth": 2,
|
||||||
"borderRadius": 0,
|
"borderRadius": 0,
|
||||||
"fill": "B3",
|
"fill": "B3",
|
||||||
|
"fillPattern": "paper",
|
||||||
"stroke": "B1",
|
"stroke": "B1",
|
||||||
"shadow": false,
|
"shadow": false,
|
||||||
"3d": false,
|
"3d": false,
|
||||||
|
|
@ -390,6 +395,7 @@
|
||||||
"strokeWidth": 2,
|
"strokeWidth": 2,
|
||||||
"borderRadius": 0,
|
"borderRadius": 0,
|
||||||
"fill": "B6",
|
"fill": "B6",
|
||||||
|
"fillPattern": "paper",
|
||||||
"stroke": "B1",
|
"stroke": "B1",
|
||||||
"shadow": false,
|
"shadow": false,
|
||||||
"3d": false,
|
"3d": false,
|
||||||
|
|
@ -431,6 +437,7 @@
|
||||||
"strokeWidth": 2,
|
"strokeWidth": 2,
|
||||||
"borderRadius": 0,
|
"borderRadius": 0,
|
||||||
"fill": "AB4",
|
"fill": "AB4",
|
||||||
|
"fillPattern": "paper",
|
||||||
"stroke": "B1",
|
"stroke": "B1",
|
||||||
"shadow": false,
|
"shadow": false,
|
||||||
"3d": false,
|
"3d": false,
|
||||||
|
|
|
||||||
166
e2etests/testdata/themes/origami/elk/sketch.exp.svg
vendored
|
Before Width: | Height: | Size: 453 KiB After Width: | Height: | Size: 454 KiB |
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.2.6-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 1396 2005"><svg id="d2-svg" class="d2-592255268" width="1396" height="2005" viewBox="-1 -1 1396 2005"><rect x="-1.000000" y="-1.000000" width="1396.000000" height="2005.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
|
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.3.0-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 1396 2005"><svg id="d2-svg" class="d2-592255268" width="1396" height="2005" viewBox="-1 -1 1396 2005"><rect x="-1.000000" y="-1.000000" width="1396.000000" height="2005.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
|
||||||
.d2-592255268 .text {
|
.d2-592255268 .text {
|
||||||
font-family: "d2-592255268-font-regular";
|
font-family: "d2-592255268-font-regular";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 99 KiB |
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.2.6-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 1731 1846"><svg id="d2-svg" class="d2-1716679499" width="1731" height="1846" viewBox="11 11 1731 1846"><rect x="11.000000" y="11.000000" width="1731.000000" height="1846.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
|
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.3.0-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 1731 1846"><svg id="d2-svg" class="d2-1716679499" width="1731" height="1846" viewBox="11 11 1731 1846"><rect x="11.000000" y="11.000000" width="1731.000000" height="1846.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
|
||||||
.d2-1716679499 .text {
|
.d2-1716679499 .text {
|
||||||
font-family: "d2-1716679499-font-regular";
|
font-family: "d2-1716679499-font-regular";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 99 KiB |
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.2.6-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 594 1502"><svg id="d2-svg" class="d2-3143233166" width="594" height="1502" viewBox="-1 -1 594 1502"><rect x="-1.000000" y="-1.000000" width="594.000000" height="1502.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
|
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.3.0-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 594 1502"><svg id="d2-svg" class="d2-3143233166" width="594" height="1502" viewBox="-1 -1 594 1502"><rect x="-1.000000" y="-1.000000" width="594.000000" height="1502.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
|
||||||
.d2-3143233166 .text-mono {
|
.d2-3143233166 .text-mono {
|
||||||
font-family: "d2-3143233166-font-mono";
|
font-family: "d2-3143233166-font-mono";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.2.6-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 786 1248"><svg id="d2-svg" class="d2-186795793" width="786" height="1248" viewBox="11 11 786 1248"><rect x="11.000000" y="11.000000" width="786.000000" height="1248.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
|
<?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" d2Version="v0.3.0-HEAD" preserveAspectRatio="xMinYMin meet" viewBox="0 0 786 1248"><svg id="d2-svg" class="d2-186795793" width="786" height="1248" viewBox="11 11 786 1248"><rect x="11.000000" y="11.000000" width="786.000000" height="1248.000000" rx="0.000000" class=" fill-N7" stroke-width="0" /><style type="text/css"><![CDATA[
|
||||||
.d2-186795793 .text-mono {
|
.d2-186795793 .text-mono {
|
||||||
font-family: "d2-186795793-font-mono";
|
font-family: "d2-186795793-font-mono";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |