From 1c9e4c1328de4e9a9666f4e63934bf38b1534562 Mon Sep 17 00:00:00 2001 From: Adam Boro Date: Wed, 18 Jul 2018 11:39:23 +0200 Subject: [PATCH] addon-info: fix copy button styling The copy button in Story Source was shrunk when the source was too wide to fit on screen (https://monosnap.com/file/0k7rzJAxlBV9XiFLGeJnnUKs12dipg). --- .../info/src/__snapshots__/index.test.js.snap | 6 +++ .../src/components/markdown/pre/copyButton.js | 1 + .../__snapshots__/index.stories.storyshot | 4 +- .../addon-info.stories.storyshot | 48 +++++++++---------- 4 files changed, 33 insertions(+), 26 deletions(-) diff --git a/addons/info/src/__snapshots__/index.test.js.snap b/addons/info/src/__snapshots__/index.test.js.snap index e935cd48a7a3..cd708d7a0a65 100644 --- a/addons/info/src/__snapshots__/index.test.js.snap +++ b/addons/info/src/__snapshots__/index.test.js.snap @@ -33,6 +33,9 @@ exports[`addon Info should render and external markdown 1`] = ` -webkit-align-self: flex-start; -ms-flex-item-align: start; align-self: flex-start; + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; } .emotion-1:hover { @@ -1335,6 +1338,9 @@ exports[`addon Info should render and markdown 1`] = ` -webkit-align-self: flex-start; -ms-flex-item-align: start; align-self: flex-start; + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; } .emotion-1:hover { diff --git a/addons/info/src/components/markdown/pre/copyButton.js b/addons/info/src/components/markdown/pre/copyButton.js index fa84c05a0ce4..ff11d7a60d0f 100644 --- a/addons/info/src/components/markdown/pre/copyButton.js +++ b/addons/info/src/components/markdown/pre/copyButton.js @@ -12,6 +12,7 @@ const Button = styled('button')( fontSize: 13, padding: '3px 10px', alignSelf: 'flex-start', + flexShrink: 0, ':hover': { backgroundColor: '#f4f7fa', diff --git a/examples/cra-kitchen-sink/src/stories/__snapshots__/index.stories.storyshot b/examples/cra-kitchen-sink/src/stories/__snapshots__/index.stories.storyshot index 587f57a8dae6..cedc3dd0594c 100644 --- a/examples/cra-kitchen-sink/src/stories/__snapshots__/index.stories.storyshot +++ b/examples/cra-kitchen-sink/src/stories/__snapshots__/index.stories.storyshot @@ -181,7 +181,7 @@ exports[`Storyshots Button addons composition 1`] = `