Use the font-size medium keyword:
.measure-element {
font-size: medium;
}This will set the font size to the browser default, typically 16px. Then read the value from JS:
const measureElement = document.querySelector('.measure-element')
let fontSize = parseInt(getComputedStyle(measureElement)).fontSizeIf the default font size is modified, for example to "Very Large" on Chromium, then the return value will be 24px.