Andy, one of my previous statements was incorrect Angular supports many css preprocessors including less. Now that I know this here is one possible solution to your problem. You can generate a component like 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 (just 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>
Then you can use the component using
<app-voltage-meter [voltage]='12'></app-voltage-meter>
I got this working using the Angular cli to generate the project assigning it the less preprocessor
ng new less-test --style=less
That would allow you to use the less code you have in your jsfiddle example.
Apologize again for my erroneous statement earlier today and thanks to seven-phases-max for pointing out my error.
Edit: For an existing project follow this article just replace scss with the preprocessor you are using.
Angular-cli from css to scss