Can't we read the css property directly to determine state instead of keeping a variable?