Salt concentration and confinement effects affect the configuration of polyelectrolyte (PE) brushes due to electrostatic interactions. In this work, we develop a new theoretical model to analyze the electrostatics and swelling-shrinking behavior of two opposing PE brushes. By comparing three length scales, i.e., equilibrium brush height, separation distance, and Debye length, we obtain distinct scaling laws for brush height in different regimes. We provide explanations for the anomalous shrinkage of the PE brush with added salt reported in experiments and simulations, the applicability of the homogeneous brush assumption, and the confinement effect on the brush height. Our model can be used to shed light on the configuration and functionalities of PE-grafted interfaces, which play important roles in ion selective membranes and organism lubrication. We also anticipate that our method will be useful to understand the functionalities of other charged soft matter systems, such as hydrogel swelling and colloidal stability.