question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove hardcoded colors from the components styles and use less variables instead

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

What problem does this feature solve?

It would help leverage Ant Design’s theming capabilities.

For instance, creating a dark themed application using Ant Design is currently impossible without a few hacks, since many components redefine colors that go well with a light theme.

It would become easy.

What does the proposed API look like?

The API wouldn’t change.

The change is internal, it would consist in removing all colors definitions from the components less files and use variables instead:

For instance, background-color: #fff would become background-color: @component-background (or equivalent).

If you agree with my point and would like a hand, I am happy to open a PR.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
afc163commented, Jul 31, 2018

@Nouzbe You can send the PR~

0reactions
IssueHuntBotcommented, Dec 18, 2018

@afc163 has rewarded $184.80 to @amedora. See it on IssueHunt

  • 💰 Total deposit: $264.00
  • 🎉 Repository reward(20%): $52.80
  • 🔧 Service fee(10%): $26.40
Read more comments on GitHub >

github_iconTop Results From Across the Web

[OutSystems UI Web Style Guide Preview] Remove hard ...
[OutSystems UI Web Style Guide Preview] Remove hard-coded values of css variables from colors, typography, spaces, borders. Question.
Read more >
CSS Variables for React Devs - Josh W Comeau
CSS Variables are *really* cool, and they're incredibly powerful when it comes to React! This tutorial shows how we can use them with...
Read more >
React - How to replace the hover color of an Ant-Design ...
I use CSS variables instead of LESS variables because the LESS variables are hardcoded after the compilation and cannot be changed. I succeed...
Read more >
Retrofitting Theming Into A Legacy App Using LESS CSS And ...
Ben Nadel shares his approach for retrofitting a legacy application with CSS theming using CSS custom properties and LESS CSS variables.
Read more >
The Power of Composition with CSS Variables
Duplicate styles, no CSS variables, hardcoded colors, you name it! ... reading Use CSS variable instead of React Context from Kent C Dodds....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found