Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 71084e2

Browse files
Merge pull request #8 from deckgo/fix/fill_color
fix: fill color
2 parents b1e8fd8 + ecf8d53 commit 71084e2

4 files changed

Lines changed: 13 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 1.0.4 (2021-04-05)
2+
3+
### Fix
4+
5+
- default fill color (such as "black")
6+
17
# 1.0.3 (2021-04-05)
28

39
### Features

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "figma-deckdeckgo-plugin",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"description": "Export Figma frames to DeckDeckGo",
55
"main": "dist/plugin.js",
66
"scripts": {

src/utils/text.utils.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@ export const applyStyle = ({section, text, svgWidth}: {section: HTMLElement; tex
2929
section.style.wordSpacing = text.getAttribute('word-spacing') || '';
3030
section.style.writingMode = text.getAttribute('writing-mode') || '';
3131

32-
section.style.color = text.getAttribute('fill') || '';
32+
// We want to avoid a textual color (such as "black") and always get the rgb values
33+
const color: string = text.getAttribute('fill') ? window.getComputedStyle(text)?.fill : '';
34+
section.style.color = color || '';
35+
3336
section.style.opacity = text.getAttribute('fill-opacity') || '';
3437

35-
section.style.webkitTextStrokeColor = text.getAttribute('stroke-width') || '';
38+
section.style.webkitTextStrokeWidth = text.getAttribute('stroke-width') || '';
3639
section.style.webkitTextStrokeColor = text.getAttribute('stroke') || '';
3740
};
3841

0 commit comments

Comments
 (0)