Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

๐Ÿ›[BUG] Dark mode is removed from Pro Layout #6056

Closed
arifszn opened this issue Oct 11, 2022 · 4 comments
Closed

๐Ÿ›[BUG] Dark mode is removed from Pro Layout #6056

arifszn opened this issue Oct 11, 2022 · 4 comments

Comments

@arifszn
Copy link

arifszn commented Oct 11, 2022

ๆ้—ฎๅ‰ๅ…ˆ็œ‹็œ‹๏ผš

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

๐Ÿ› bug ๆ่ฟฐ

navTheme and headerTheme props are removed in version 7.x.x. No explanation for removing is there on the changelog. Also, can't find any alternative to enable the dark mode.

An undocumented prop type navTheme is available but it only adds a drop shadow.

<ProLayout navTheme="realDark">HELLO</ProLayout>

image

In this commit it's removed.

Version: "@ant-design/pro-layout": "^7.1.4"

๐Ÿ“ท ๅค็Žฐๆญฅ้ชค

๐Ÿž ๆœŸๆœ›็ป“ๆžœ

๐Ÿ’ป ๅค็Žฐไปฃ็ 

ยฉ ็‰ˆๆœฌไฟกๆฏ

  • ProComponents ็‰ˆๆœฌ: [e.g. 4.0.0]
  • umi ็‰ˆๆœฌ
  • ๆต่งˆๅ™จ็Žฏๅขƒ
  • ๅผ€ๅ‘็Žฏๅขƒ [e.g. mac OS]

๐Ÿš‘ ๅ…ถไป–ไฟกๆฏ

@hejinguo
Copy link

navTheme ๅˆ ้™คไบ†๏ผŸ

@arifszn
Copy link
Author

arifszn commented Oct 11, 2022

Looks like it from this commit .

Still, there is a prop definion for navTheme but it only adds a drop shadow. In the actual documentation, it is removed also.

image

@chenshuai2144
Copy link
Contributor

chenshuai2144 commented Oct 14, 2022

We recommend using the token method to configure, we have a related demo

https://procomponents.ant.design/components/layout#%E7%BB%8F%E5%85%B8%E5%AF%BC%E8%88%AA%E6%A0%B7%E5%BC%8F

@arifszn
Copy link
Author

arifszn commented Oct 14, 2022

@chenshuai2144, i see the token can be the alternative for the darkmode. But the problem is it is not dynamic anymore.

const [darkMode, setDarkMode] = useState(false);

<ProLayout
   token={{
     bgLayout: darkMode ? '#000' : '#f0f2f5',
   }}

Even I changed the darMode state, the bg color remained the same when it was first rendered.

The previous navTheme and headerTheme were dynamic.

<ProLayout
   navTheme={darkMode ? 'dark' : 'light'}
   headerTheme={darkMode ? 'dark' : 'light'}

Should I create a separate ticket?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants