A non-invasive, at-home test for neonatal jaundice can facilitate early jaundice detection in infants, improving clinical outcomes for neonates with severe jaundice and helping to prevent the development of kernicterus, a type of brain damage whose symptoms include hearing loss, impairment of cognitive capacity, and death. Here a photonic sensor that utilizes color changes induced by analyte infiltration into a chemically functionalized inverse opal structure is developed. The sensor is calibrated to detect differences in urinary surface tension due to increased bile salt concentration in urine, which is symptomatic of abnormal liver function and linked to jaundice. The correlation between neonatal urinary surface tension and excess serum bilirubin, the physiologic cause of neonatal jaundice, is explored. It is shown that these non-invasive sensors can improve the preliminary diagnosis of neonatal jaundice, reducing the number of invasive blood tests and hospital visits necessary for healthy infants while ensuring that jaundiced infants are treated in a timely manner. The use of inverse opal sensors to measure bulk property changes in bodily fluids can be extended to the detection of several other conditions, making this technology a versatile platform for convenient point-of-care diagnosis.