Provided herein are polymeric compositions having a relaxation time that is a function of pH. The polymeric compositions can include an anionic monomer, a cationic monomer, and a crosslinker. The crosslinker may comprise at least one of a diacrylate crosslinker and a dimethacrylate crosslinker. Also provided herein are methods of pH sensing, and methods of forming a polymeric composition. Kits of parts also are provided that include a polymeric composition. The polymeric compositions may be used to determine the pH of one or more biological tissues and/or liquids.