What had Hester unknowingly done in fashioning Pearl's outfit?
Hester's actions in regard to dressing her child in beautiful, colorful garments can be interpreted in several ways, and these different interpretations all can be supported by the literature. The psychology of Hester's actions, for instance, should be considered, since Hawthorne's understanding of human psychology shapes so much of the novel and the characters' behaviors. The extravagant way Hester dresses Pearl, in complete contradiction to Puritan values, suggests an emotional rebellion on Hester's part.
Hester endures her terrible punishment on the scaffold. She stays in Boston and wears the scarlet letter. She submits herself to daily humiliation, shame, and ostracism. However, at the first opportunity, she declares her abiding love for Dimmesdale and makes plans with him to leave and start a new life. This indicates clearly that Hester has chosen to remain in Boston only to be near him. There is no genuine repentance in her for having loved Dimmesdale. The stern, punishing Puritans have not broken her spirit.
By dressing Pearl so ornately, Hester rebells against the gray society that represses her. Her actions reveal that, like Dimmesdale and Chillingworth, her outward appearance does not "match" her inner identity. In psychological terms, she makes her "child of sin" beautiful in what seems to be an act of passive aggression. Pearl's appearance reflects her mother's genuine self.
I assume you are talking about Hawthorne's discussion of Pearl's clothing that comes a few pages into Chapter 7.
There, Hawthorne says that Hester had made Pearl's clothing really beautiful -- crimson velvet, cut very nicely, with lots of golden thread. It made Pearl look like the "very brightest little jet of flame that ever danced upon the earth."
But Hester also did something that she didn't mean to do. That was to call attention to her own scarlet letter. Hawthorne says that Pearl's clothes, along with just her whole appearance, really reminded people of the scarlet letter.
Hawthorne says that Hester had probably done this because her guilt had been burned so deeply into her that she wanted to remind herself of it even more.
In the book "The Scarlet Letter" Hester always buys the best materials and adorns her child with beautiful clothing. I am not so sure that each of Pearl's outfits was not a calculated thought on Hester's part. Hester is called to the Governor's place where a tribune of four men wishes to interview her to determine if the child should remain with Hester. The day of the meeting Hester has Pearl dressed in Scarlet garments and a scarlet coat. She resembles the letter assigned to Heater to wear as well as a cardinal.
"The mother herself-as if the red ignominy were so deeply scorched into her brain that all her conceptions assumed its form--had carefully wrought out the similitude, lavishing many hours of morbid ingenuity to create and analogy between the object of her affection and the emblem of her guilt and torture. But in truth Pearl was he one as well as the other; and only in consequence of that identity had HESTER CONTRIVED SO PERFECTLY TO REPRESENT THE SCARLET LETTER IN HER APPEARANCE."(89) Chapter 7