site: add instruction about yellow color

This commit is contained in:
afc163 2017-12-27 20:43:15 +08:00
parent 5a15b243ae
commit 823d10ac96
3 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ After hard working of designers and programmers, we got a great [color palette g
Ant Design's default theme consists of eight basic colors, each of which is derived from the above algorithm.
> Note: In these shallow-to-deep palettes, the 6th color cell [generally satisfies WCAG 2.0](https://leaverou.github.io/contrast-ratio/)'s 4.5:1 minimum contrast ratio (AA level), and is used as the default for the palette.
> Note: In these shallow-to-deep palettes, the 6th color cell [generally satisfies WCAG 2.0](https://leaverou.github.io/contrast-ratio/)'s 4.5:1 minimum contrast ratio (AA level), and is used as the default for the paletteYellow color don't follow WCAG in white color because it is designed to be used with dark font/background).
`````__react
import ColorPalettes from '../../site/theme/template/Color/ColorPalettes';

View File

@ -19,7 +19,7 @@ Ant Design PC 端的色板由 10 个由浅至深的色彩单元格组成,我
Ant Design 的色板由 8 种基本色彩组成,每种基本色(第 6 格)又按上述算法衍生出 10 种渐变色。
> 注:在由浅至深的色板里,第 6 格色彩单元格普遍满足 [WCAG 2.0](http://leaverou.github.io/contrast-ratio/) 的 4.5:1 最小对比度AA 级),我们将其定义为色板的默认品牌色。
> 注:在由浅至深的色板里,第 6 格色彩单元格普遍满足 [WCAG 2.0](http://leaverou.github.io/contrast-ratio/) 的 4.5:1 最小对比度AA 级),我们将其定义为色板的默认品牌色。(黄色用于搭配黑色字体/背景,故不满足和白色的对比度)
`````__react
import ColorPalettes from '../../site/theme/template/Color/ColorPalettes';

View File

@ -44,7 +44,7 @@ class Palette extends Component {
ref={(node) => { this.colorNodes[`${name}-${i}`] = node; }}
className={`main-color-item palatte-${name}-${i}`}
style={{
color: i > 5 ? '#fff' : 'unset',
color: (name === 'yellow' ? i > 6 : i > 5) ? '#fff' : 'unset',
fontWeight: i === 6 ? 'bold' : 'normal',
}}
title="click to copy color"