An increasing amount of evidence indicates that developmental programs are tightly regulated by the complex interplay between signaling pathways, as well as transcriptional and epigenetic processes. Here, we have uncovered coordination between transcriptional and morphogen cues to specify Merkel cells, poorly understood skin cells that mediate light touch sensations. In murine dorsal skin, Merkel cells are part of touch domes, which are skin structures consisting of specialized keratinocytes, Merkel cells, and afferent neurons, and are located exclusively around primary hair follicles. We show that the developing primary hair follicle functions as a niche required for Merkel cell specification. We find that intraepidermal Sonic hedgehog (Shh) signaling, initiated by the production of Shh ligand in the developing hair follicles, is required for Merkel cell specification. The importance of Shh for Merkel cell formation is further reinforced by the fact that Shh overexpression in embryonic epidermal progenitors leads to ectopic Merkel cells. Interestingly, Shh signaling is common to primary, secondary, and tertiary hair follicles, raising the possibility that there are restrictive mechanisms that regulate Merkel cell specification exclusively around primary hair follicles. Indeed, we find that loss of Polycomb repressive complex 2 (PRC2) in the epidermis results in the formation of ectopic Merkel cells that are associated with all hair types. We show that PRC2 loss expands the field of epidermal cells competent to differentiate into Merkel cells through the upregulation of key Merkel-differentiation genes, which are known PRC2 targets. Importantly, PRC2-mediated repression of the Merkel cell differentiation program requires inductive Shh signaling to form mature Merkel cells. Our study exemplifies how the interplay between epigenetic and morphogen cues regulates the complex patterning and formation of the mammalian skin structures.