A versatile photonic crystal sensing motif based on a twodimensional (2D) inverse opal monolayer of stimuli-responsive polyelectrolyte gel with tunable optical properties is reported. The photonic membrane shows prompt response to pH and can be readily
read out from either its optical spectra or interference colours