Merge pull request #1872 from GavinNishizawa/update-markdown-coloring
fix style.fill for markdown
This commit is contained in:
commit
3faa50ccd8
7 changed files with 572 additions and 569 deletions
|
|
@ -12,3 +12,4 @@
|
||||||
- Fixes styles in connections not overriding styles set by globs [#1857](https://github.com/terrastruct/d2/pull/1857)
|
- Fixes styles in connections not overriding styles set by globs [#1857](https://github.com/terrastruct/d2/pull/1857)
|
||||||
- Fixes `null` being set on a nested shape not working in certain cases when connections also pointed to that shape [#1830](https://github.com/terrastruct/d2/pull/1830)
|
- Fixes `null` being set on a nested shape not working in certain cases when connections also pointed to that shape [#1830](https://github.com/terrastruct/d2/pull/1830)
|
||||||
- Fixes edge case of bad import syntax crashing using d2 as a library [#1829](https://github.com/terrastruct/d2/pull/1829)
|
- Fixes edge case of bad import syntax crashing using d2 as a library [#1829](https://github.com/terrastruct/d2/pull/1829)
|
||||||
|
- Fixes `style.fill` not applying to markdown [#1872](https://github.com/terrastruct/d2/pull/1872)
|
||||||
|
|
|
||||||
|
|
@ -1370,7 +1370,9 @@ func drawShape(writer, appendixWriter io.Writer, diagramHash string, targetShape
|
||||||
if targetShape.FontSize != textmeasure.MarkdownFontSize {
|
if targetShape.FontSize != textmeasure.MarkdownFontSize {
|
||||||
styles = append(styles, fmt.Sprintf("font-size:%vpx", targetShape.FontSize))
|
styles = append(styles, fmt.Sprintf("font-size:%vpx", targetShape.FontSize))
|
||||||
}
|
}
|
||||||
|
if targetShape.Fill != "" && targetShape.Fill != "transparent" {
|
||||||
|
styles = append(styles, fmt.Sprintf(`background-color:%s`, targetShape.Fill))
|
||||||
|
}
|
||||||
if !color.IsThemeColor(targetShape.Color) {
|
if !color.IsThemeColor(targetShape.Color) {
|
||||||
styles = append(styles, fmt.Sprintf(`color:%s`, targetShape.Color))
|
styles = append(styles, fmt.Sprintf(`color:%s`, targetShape.Color))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1925,7 +1925,7 @@ a line of text and an
|
||||||
|
|
||||||
walk into a bar.
|
walk into a bar.
|
||||||
| {
|
| {
|
||||||
style.stroke: darkorange
|
style.font-color: darkorange
|
||||||
}
|
}
|
||||||
|
|
||||||
container -> no container
|
container -> no container
|
||||||
|
|
@ -1935,7 +1935,7 @@ they did it in style
|
||||||
|
|
|
|
||||||
|
|
||||||
no container.style: {
|
no container.style: {
|
||||||
stroke: red
|
font-color: red
|
||||||
fill: "#CEEDEE"
|
fill: "#CEEDEE"
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
|
|
||||||
8
e2etests/testdata/stable/markdown_stroke_fill/dagre/board.exp.json
generated
vendored
8
e2etests/testdata/stable/markdown_stroke_fill/dagre/board.exp.json
generated
vendored
|
|
@ -58,7 +58,7 @@
|
||||||
"strokeWidth": 2,
|
"strokeWidth": 2,
|
||||||
"borderRadius": 0,
|
"borderRadius": 0,
|
||||||
"fill": "transparent",
|
"fill": "transparent",
|
||||||
"stroke": "darkorange",
|
"stroke": "N1",
|
||||||
"shadow": false,
|
"shadow": false,
|
||||||
"3d": false,
|
"3d": false,
|
||||||
"multiple": false,
|
"multiple": false,
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontFamily": "DEFAULT",
|
"fontFamily": "DEFAULT",
|
||||||
"language": "markdown",
|
"language": "markdown",
|
||||||
"color": "N1",
|
"color": "darkorange",
|
||||||
"italic": false,
|
"italic": false,
|
||||||
"bold": false,
|
"bold": false,
|
||||||
"underline": false,
|
"underline": false,
|
||||||
|
|
@ -98,7 +98,7 @@
|
||||||
"strokeWidth": 2,
|
"strokeWidth": 2,
|
||||||
"borderRadius": 0,
|
"borderRadius": 0,
|
||||||
"fill": "#CEEDEE",
|
"fill": "#CEEDEE",
|
||||||
"stroke": "red",
|
"stroke": "N1",
|
||||||
"shadow": false,
|
"shadow": false,
|
||||||
"3d": false,
|
"3d": false,
|
||||||
"multiple": false,
|
"multiple": false,
|
||||||
|
|
@ -115,7 +115,7 @@
|
||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontFamily": "DEFAULT",
|
"fontFamily": "DEFAULT",
|
||||||
"language": "markdown",
|
"language": "markdown",
|
||||||
"color": "N1",
|
"color": "red",
|
||||||
"italic": false,
|
"italic": false,
|
||||||
"bold": false,
|
"bold": false,
|
||||||
"underline": false,
|
"underline": false,
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
8
e2etests/testdata/stable/markdown_stroke_fill/elk/board.exp.json
generated
vendored
8
e2etests/testdata/stable/markdown_stroke_fill/elk/board.exp.json
generated
vendored
|
|
@ -58,7 +58,7 @@
|
||||||
"strokeWidth": 2,
|
"strokeWidth": 2,
|
||||||
"borderRadius": 0,
|
"borderRadius": 0,
|
||||||
"fill": "transparent",
|
"fill": "transparent",
|
||||||
"stroke": "darkorange",
|
"stroke": "N1",
|
||||||
"shadow": false,
|
"shadow": false,
|
||||||
"3d": false,
|
"3d": false,
|
||||||
"multiple": false,
|
"multiple": false,
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontFamily": "DEFAULT",
|
"fontFamily": "DEFAULT",
|
||||||
"language": "markdown",
|
"language": "markdown",
|
||||||
"color": "N1",
|
"color": "darkorange",
|
||||||
"italic": false,
|
"italic": false,
|
||||||
"bold": false,
|
"bold": false,
|
||||||
"underline": false,
|
"underline": false,
|
||||||
|
|
@ -98,7 +98,7 @@
|
||||||
"strokeWidth": 2,
|
"strokeWidth": 2,
|
||||||
"borderRadius": 0,
|
"borderRadius": 0,
|
||||||
"fill": "#CEEDEE",
|
"fill": "#CEEDEE",
|
||||||
"stroke": "red",
|
"stroke": "N1",
|
||||||
"shadow": false,
|
"shadow": false,
|
||||||
"3d": false,
|
"3d": false,
|
||||||
"multiple": false,
|
"multiple": false,
|
||||||
|
|
@ -115,7 +115,7 @@
|
||||||
"fontSize": 16,
|
"fontSize": 16,
|
||||||
"fontFamily": "DEFAULT",
|
"fontFamily": "DEFAULT",
|
||||||
"language": "markdown",
|
"language": "markdown",
|
||||||
"color": "N1",
|
"color": "red",
|
||||||
"italic": false,
|
"italic": false,
|
||||||
"bold": false,
|
"bold": false,
|
||||||
"underline": false,
|
"underline": false,
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Loading…
Reference in a new issue