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.

lessVarsFilePath doesn't work

See original GitHub issue

Issue

I’m trying to use next-plugin-antd-less according to the documentation, but my antd variables don’t work.

I’m trying to use lessVarsFilePath property (everything according to the documentation), but it just doesn’t work.

How to reproduce:

Please see this repo https://github.com/Webbrother/next-plugin-antd-less-issue

yarn then yarn dev

I have variable in vatiables.less:

@primary-color: #ff0000; // <- this is a red color

I expect to see the red (my custom override color) button on the page, but I see the default color (blue).

How can I fix it?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
SolidZOROcommented, Aug 20, 2021

@Webbrother

// src/styles/variables.less
@import '~antd/lib/style/themes/default.less';   // <------ add this

//@primary-color: red;
@primary-color: #ff0000; // change antd primary-color

seemore, https://github.com/SolidZORO/next-plugin-antd-less/issues/36

1reaction
coolbeatz71commented, Aug 29, 2021

Having the same issue, what I did as a workaround for the moment is created a js file exporting an object with the variables I want to override and importing it to next.config.js and setting the variables overrides in the modifyVars option just to keep the next.config.js file a little cleaner

This solution is good. But not ideal for complex cases like reusing antd default variables. for example:

@text-color: fade(@black, 65%);
Read more comments on GitHub >

github_iconTop Results From Across the Web

Python won't accept file path when executed - Stack Overflow
It looks like the reason your code is not working is because you're executing the code from another directory where load_data.py is not, ......
Read more >
go:embed <path to file in parent directory> doesn't work #46056
assets.go contains package assets loaded with //go:embed directive. I'd like to add README.md file to assets.go, but //go:embed ...
Read more >
Going to directory using bash variables doesn't work when ...
Short answer: see BashFAQ #050 ("I'm trying to put a command in a variable, but the complex cases always fail!"). Long answer: when...
Read more >
Using a file path variable when executing a shell script
Hi, I'm experimenting with executing a Python script file via KM and, after reading a few forum posts, I thought I could use...
Read more >
File path formats on Windows systems | Microsoft Learn
In this article, learn about file path formats on Windows systems, such as traditional DOS paths, DOS device paths, and universal naming ...
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