ant-design-colors icon indicating copy to clipboard operation
ant-design-colors copied to clipboard

grey doesn't match the documentation

Open samking opened this issue 5 years ago • 8 comments

When I try to use grey from this library, it outputs:

[
  '#a6a6a6',
  '#999999',
  '#8c8c8c',
  '#808080',
  '#737373',
  '#666666',
  '#404040',
  '#1a1a1a',
  '#000000',
  '#000000',
  primary: '#666666'
]

However, the spec / documentation (https://ant.design/docs/spec/colors) indicates that grey should be:

[                                                                             
'#ffffff',                                                                          
'#fafafa',                                                                          
'#f5f5f5',                                                                          
'#e8e8e8',                                                                          
'#d9d9d9',                                                                          
'#bfbfbf',                                                                          
'#8c8c8c',                                                                          
'#595959',                                                                          
'#262626',                                                                          
'#000000',                                                                          
]  

This issue is easy enough to workaround, but I thought a fix might help out a lot of folks. Thanks!

samking avatar Nov 14 '19 21:11 samking

Note that the spec now has an expanded grey palette with 13 values:

#ffffff
#fafafa
#f5f5f5
#f0f0f0
#d9d9d9
#bfbfbf
#8c8c8c
#595959
#434343
#262626
#1f1f1f
#141414
#000000

https://ant.design/docs/spec/colors#Neutral-Color-Palette

This was discussed in the 4.0 announcement here: https://zhuanlan.zhihu.com/p/112470365

There's a lot of talk about how the dark colors have to be considered differently (versus simply flipping the order of the light colors), but it's only shown applied to the primary colors, so it's not clear what the presetDarkPalettes.grey export should look like.

carmanchris31 avatar Jun 30 '20 03:06 carmanchris31

@afc163 @ycjcl868 Any thoughts on this issue? I would be keen to see the alignment with the official doc :)

hustKiwi avatar Sep 20 '20 06:09 hustKiwi

Is there any workaround on this issue? The greys colors are completely off.

ZDerekh avatar Dec 17 '20 13:12 ZDerekh

Also having the issue

scottrotton avatar Mar 23 '21 03:03 scottrotton

Same, any updates ?

bencerf avatar Jun 18 '21 23:06 bencerf

I, too, would like this to have a neater solution.

shifraHolzer avatar Jun 30 '21 23:06 shifraHolzer

Seems like should be fixed in scope of https://github.com/ant-design/ant-design-colors/pull/82. But for some reason it's ignored

destimon avatar Feb 22 '23 09:02 destimon

I wanted to use the Layout Background and found this solution:

const t = useTranslations();
const { useToken } = theme;
<div
style={{
          background: token.colorBgLayout,
        }} />

Morten-Moeller avatar Nov 23 '23 09:11 Morten-Moeller