Running Angular version 7.0.0 will generate a folder structure typical for "ng new".
Below is the content of my styles.less file:
@personal-black: #0000;
This snippet shows the content of my app.component.less file:
#personal-style-scheme {
color: @personal-black;
}
<h1 id="personal-style-scheme">
Welcome to {{ title }}!
</h1>
An error occurs stating:
Failed to compile.
./src/app/app.component.less Module build failed (from ./node_modules/less-loader/dist/cjs.js): #personal-style-scheme { color: @personal-black; ^ Variable @personal-black is undefined in C:\Users\Sameer\Documents\my-app\src\app\app.component.less (line 2, column 11)
The issue arises when trying to access the less variable @personal-black in the component's less file.
Angular.json File Configuration:
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
// Other project configuration details included here...
}