The chemical reactions and pathways involving chondroitin sulfate, any member of a group of 10-60 kDa glycosaminoglycans, widely distributed in cartilage and other mammalian connective tissues, the repeat units of which consist of beta-(1,4)-linked D-glucuronyl beta-(1,3)-N-acetyl-D-galactosamine sulfate. They usually occur linked to a protein to form proteoglycans. Two subgroups exist, one in which the sulfate is on the 4-position (chondroitin sulfate A) and the second in which it is in the 6-position (chondroitin sulfate C). They often are polydisperse and often differ in the degree of sulfation from tissue to tissue. The chains of repeating disaccharide are covalently linked to the side chains of serine residues in the polypeptide backbone of a protein by a glycosidic attachment through the trisaccharide unit galactosyl-galactosyl-xylosyl. Chondroitin sulfate B is more usually known as dermatan sulfate.