If you need the field to be read-only on the record's standard page layout, I can see an argument for using @SFAdmin's answer.
But if you're building a Lightning Web Component anyway -- i.e. you are already taking the plunge and doing custom code instead of configuration for the UI where you want the Description field to be read-only -- implementing this in LWC is pretty straightforward. You just set the disabled
(or if you prefer, read-only
) attribute on the Description field to a getter that returns whether the class is "Vard".
HTML Template
<template>
<lightning-input
label="Description"
data-field="description"
value={description}
disabled={classIsVard}
onchange={handleChange}
></lightning-input>
<lightning-input
label="Class"
data-field="classField"
value={classField}
onchange={handleChange}
></lightning-input>
</template>
JavaScript Controller
import { LightningElement, track, api } from 'lwc';
export default class App extends LightningElement {
@track description;
@track classField;
handleChange(event) {
this[event.target.dataset.field] = event.target.value;
}
get classIsVard() {
return this.classField === 'Vard';
}
}