Replies: 2 comments
-
And the .tsx file was correct like so:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
I recommend you to use css modules with less, which can improve your development efficiency with the css modules vscode extension. import styles from "./index.module.less";
const App = () => <div className={styles.main} ></div>; .main {
color: red;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am working with a project that uses the npm package called less and less-loader. I have read through the documentation, but I am still not following how it works exactly.
Taking a look at a sample in the project, there is a Lists.tsx file that imports a less file but it does it in a way that is not familiar to me:
import {b} from './Lists.less;
That b is not coming from the Lists.less file itself, its coming from a styles.d.ts file:
The way this is all applied in this project is something like this:
<div className={b()}></div>
With the less file having something like:
But when I try to apply the same pattern to another file, in console I get:
The corresponding less file I manually created looks like so:
Super unclear what is supposed to be happening here for the styling to take place as I also notice the project does not pass strings into the b(), it just passes the b() into a className={} and it knows how to apply the style.
Beta Was this translation helpful? Give feedback.
All reactions