Andy, I have discovered that Angular actually supports many css preprocessors, including less. With this newfound knowledge, I can offer you a potential solution to your problem. You can create a component as shown below.
-voltage-meter.component.ts
import { Component, OnInit, ViewEncapsulation, Input } from '@angular/core';
@Component({
selector: 'app-voltage-meter',
templateUrl: './voltage-meter.component.html',
styleUrls: ['./voltage-meter.component.less'],
encapsulation: ViewEncapsulation.None
})
export class VoltageMeterComponent implements OnInit {
@Input() voltage: number;
constructor() { }
ngOnInit() {
console.log(this.voltage);
}
}
-voltage-meter.component.less (simply paste your less code in this file)
-voltage-meter.component.html
<div class="radial-progress" attr.data-progress='{{voltage}}'>
<div class="circle">
<div class="mask full">
<div class="fill"></div>
</div>
<div class="mask half">
<div class="fill"></div>
<div class="fill fix"></div>
</div>
<div class="shadow"></div>
</div>
<div class="inset">
<div class="voltage"><div class="voltage-in-use">Voltage in use</div></div>
</div>
</div>
You can then use the component like so:
<app-voltage-meter [voltage]='12'></app-voltage-meter>
I was able to make this work by using the Angular CLI to generate the project and assigning it the less preprocessor.
ng new less-test --style=less
This will allow you to incorporate the less code from your jsfiddle example.
I apologize once again for my earlier mistake and thank you to seven-phases-max for pointing out the error.
Edit: For an existing project, refer to this article and replace scss with the preprocessor you are utilizing.
Angular-cli from css to scss