Skip to content

Commit

Permalink
chore: update color explorer swatches to be easier to interpret (micr…
Browse files Browse the repository at this point in the history
…osoft#1744)

* plumbing new swatch

* cleanup

* wire radio buttons

* fixing overflow

* adding checkbox input

* fixing foreground contrast calculation

* updating per comments
  • Loading branch information
nicholasrice authored May 20, 2019
1 parent 64d0f93 commit 354a851
Show file tree
Hide file tree
Showing 9 changed files with 608 additions and 506 deletions.
28 changes: 16 additions & 12 deletions packages/fast-color-explorer/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,7 @@ class App extends React.Component<AppProps, {}> {
<Row fill={true}>
<Canvas>
<Container jssStyleSheet={this.containerStyleOverrides}>
<Row fill={true}>
<AutoSizer
onResize={
/* this lambda is intentional - it forces the pure component to re-render */ (): void => {}
}
>
{this.renderColorBlockList}
</AutoSizer>
</Row>
<Row>
<Row height={20} minHeight={20}>
<Gradient
colors={palette(PaletteType.neutral)(
this.props.designSystem
Expand All @@ -54,14 +45,23 @@ class App extends React.Component<AppProps, {}> {
scrollToItem={this.handleGradientScroll}
/>
</Row>
<Row>
<Row height={20} minHeight={20}>
<Gradient
colors={palette(PaletteType.accent)(
this.props.designSystem
)}
createAnchors={false}
/>
</Row>
<Row fill={true}>
<AutoSizer
onResize={
/* this lambda is intentional - it forces the pure component to re-render */ (): void => {}
}
>
{this.renderColorBlockList}
</AutoSizer>
</Row>
</Container>
</Canvas>
<Background value={DarkModeBackgrounds.L4}>
Expand Down Expand Up @@ -104,7 +104,11 @@ class App extends React.Component<AppProps, {}> {

return (
<div style={props.style} key={color}>
<ColorBlocks {...{ backgroundColor: color, index: props.index } as any} />
<Background value={color} style={{ minHeight: "100%" }}>
<ColorBlocks
{...{ backgroundColor: color, index: props.index } as any}
/>
</Background>
</div>
);
};
Expand Down
Loading

0 comments on commit 354a851

Please sign in to comment.