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

Typography element inside Layout.Header|Layout.Sider with default less|css is unreadable. #30796

Open
1 task done
IzaacJ opened this issue May 31, 2021 · 0 comments
Open
1 task done
Labels

Comments

@IzaacJ
Copy link

IzaacJ commented May 31, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  • Import 'antd/dist/antd.css'
  • Import Layout (Header, Sider, Content, Footer) and Typography (Title, Text)
  • Add a Title or Text element to a Header or Sider

What is expected?

Readable text

What is actually happening?

Unreadable text

Environment Info
antd 4.16.1
React 17.0.2
System Ubuntu 20.04
Browser Firefox 88.0.1

I'd suggest something like the example below for pretty much all components, with @text-color replaced with appropriate variables in special components (ie info|warning|error components). Any user-defined styles would still override them, but antd would still push a decent experience OOB.

color: if(boolean(luma($background) > 50%)  and boolean(luma(@text-color) < 25%), @text-color, contrast($background));

Note: Pretty new to less (and antd), which is why I'm not doing a pull request or anything. Might have missed something in the docs while trying to figure this out the past few days through simple css overrides and even by customizing the theme.

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

No branches or pull requests

1 participant