A barometric pressure (vacuum) sensor could do this. YouBaro sensors measure absolute pressure, so you could measure the vacuum and thus estimate the height of the liquid in the straw from it if you wanted to do a fancy animation of some sort.
Related: Low cost barometric pressure sensor
Difficulty: keeping the sensor port clean.