From 35efa7cdb01e0c5a0bb7788aa2e0b1cb45821647 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sun, 27 Jan 2019 11:14:49 -0500 Subject: [PATCH] Adding theme support for Text rendering component --- src/rendering/Text/index.js | 5 +++-- src/rendering/Text/style.js | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/rendering/Text/index.js b/src/rendering/Text/index.js index 8f5d6d1..a674555 100644 --- a/src/rendering/Text/index.js +++ b/src/rendering/Text/index.js @@ -5,9 +5,9 @@ import { getBBox } from 'layout'; import * as style from './style'; -const Text = ({ transform, quoted, children }) => { +const Text = ({ transform, quoted, theme, children }) => { const textProps = { - style: style.text, + style: { ...style.text, ...style[theme] }, transform }; @@ -22,6 +22,7 @@ const Text = ({ transform, quoted, children }) => { Text.propTypes = { quoted: PropTypes.bool, + theme: PropTypes.string, transform: PropTypes.string, children: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.node), diff --git a/src/rendering/Text/style.js b/src/rendering/Text/style.js index 514c0a3..3c21a3e 100644 --- a/src/rendering/Text/style.js +++ b/src/rendering/Text/style.js @@ -1,8 +1,11 @@ -import { fontSize, fontFamily, grey } from 'rendering/style'; +import { fontSize, fontFamily, white, grey } from 'rendering/style'; export const text = { fontSize, fontFamily }; +export const anchor = { + fill: white +}; export const quote = { fill: grey };