Skip to content

Commit

Permalink
fix(www): /guidelines/color modal title color for dark mode (#19147)
Browse files Browse the repository at this point in the history
* fix(www): /guidelines/color modal title color

* chore(www): Remove utils/guidelines/theme
  • Loading branch information
fk authored Oct 30, 2019
1 parent 80db808 commit 589c599
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 40 deletions.
13 changes: 10 additions & 3 deletions www/src/components/guidelines/color/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,17 @@ const modalContent = (palette, color) => {
</Box>
</Column>
<Column bg="white">
<Text as="p" fontFamily="monospace" fontWeight="bold" mr={3} mb={4}>
<Text
as="p"
color="grey.80"
fontFamily="monospace"
fontWeight="bold"
mr={3}
mb={4}
>
colors.{color}[{colorNumber}] {c.name && c.name}
</Text>
<Text as="span" fontWeight="body" ml="auto">
<Text as="span" color="grey.80" fontWeight="body" ml="auto">
{c.contrast.colorOnWhite.toFixed(2)} /{` `}
{getA11yLabel(c.a11y)}
</Text>
Expand All @@ -190,7 +197,7 @@ const ColorModal = ({ palette, color, handleModalClose }) => {
return (
<>
<Flex alignItems="baseline" p={{ xxs: 6, md: 8 }}>
<Heading mr={4} mt={0}>
<Heading color="black" mr={4} mt={0}>
{palette[color].name}
</Heading>
<CloseButton
Expand Down
4 changes: 2 additions & 2 deletions www/src/utils/guidelines/color.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { rgb as wcag } from "wcag-contrast"
import hexRgb from "hex-rgb"
import { normal } from "color-blend"

import theme from "./theme"
import { colors } from "../../gatsby-plugin-theme-ui"

// adapted from https://github.com/jxnblk/colorable 🙏
const minimums = {
Expand Down Expand Up @@ -78,7 +78,7 @@ export const colorable = function(hex) {
}

result.a11y = {
...a11y(hex, theme.colors.white),
...a11y(hex, colors.white),
}

return result
Expand Down
35 changes: 0 additions & 35 deletions www/src/utils/guidelines/theme.js

This file was deleted.

0 comments on commit 589c599

Please sign in to comment.