Skip to content

Commit

Permalink
fix(addon-docs): ColorPalette style (#9643)
Browse files Browse the repository at this point in the history
fix(addon-docs): ColorPalette style
  • Loading branch information
ndelangen authored Jan 27, 2020
2 parents 3f4bf9e + e5229cd commit d401a25
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/components/src/blocks/ColorPalette.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,15 @@ const SwatchLabel = styled.div(({ theme }) => ({
? transparentize(0.4, theme.color.defaultText)
: transparentize(0.6, theme.color.defaultText),

small: {
'> div': {
display: 'inline-block',
overflow: 'hidden',
maxWidth: '100%',
},

span: {
display: 'block',
marginTop: 2,
},
}));

Expand Down Expand Up @@ -128,8 +135,10 @@ function renderSwatch(color: string) {
function renderSwatchLabel(color: string, colorDescription?: string) {
return (
<SwatchLabel key={color} title={color}>
{color}
{colorDescription && <small>{colorDescription}</small>}
<div>
{color}
{colorDescription && <span>{colorDescription}</span>}
</div>
</SwatchLabel>
);
}
Expand Down

0 comments on commit d401a25

Please sign in to comment.