From c8129e14cc612b5fcf54345454208e8bc7c1e7b8 Mon Sep 17 00:00:00 2001 From: Blake Stephens Date: Sun, 16 Oct 2016 07:42:26 -0700 Subject: [PATCH] Support background-images (#15) * Removed the specificity of `backgroundColor` for a more inclusive `background` Signed-off-by: Blake Stephens * Updated styles type definition too Oops. Not too familiar with typescript Signed-off-by: Blake Stephens * Updated test too Thanks Travis. Signed-off-by: Blake Stephens --- addons/background/src/__tests__/index.tsx | 2 +- addons/background/src/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/background/src/__tests__/index.tsx b/addons/background/src/__tests__/index.tsx index d9efa600a5fc..36472a10329e 100644 --- a/addons/background/src/__tests__/index.tsx +++ b/addons/background/src/__tests__/index.tsx @@ -24,7 +24,7 @@ describe("Background Decorator", () => { const SpiedChannel = new EventEmitter(); const backgroundDecorator = shallow(); - expect(backgroundDecorator.html().match(/background-color:transparent/gmi).length).toBe(1); + expect(backgroundDecorator.html().match(/background:transparent/gmi).length).toBe(1); }); it("should set internal state when background event called", () => { diff --git a/addons/background/src/index.tsx b/addons/background/src/index.tsx index 6da539705054..571b788d88f8 100644 --- a/addons/background/src/index.tsx +++ b/addons/background/src/index.tsx @@ -13,7 +13,7 @@ const style = { transition: "background 0.25s ease-in-out", backgroundPosition: "center", backgroundSize: "cover", - backgroundColor: "transparent", + background: "transparent", }, }; @@ -57,7 +57,7 @@ export class BackgroundDecorator extends React.Component { render() { const styles = style.wrapper; - styles.backgroundColor = this.state.background; + styles.background = this.state.background; return
{this.story}
; } }