It’s the preposition + article + noun combination that determines the mutation, which may be different from plain article + noun (with no preposition) as well as preposition + noun (with no article).
do + an puts séimhiú on the following (singular) noun, for example (in the Standard and in many dialects), whether the noun is masculine or feminine (although in the Standard a t is prefixed to an s → ts only for a feminine noun, just as in the nominative). E.g., bád (masculine), do bhád, an bád, don bhád; bean (feminine), do bhean, an bhean, don bhean; sagart (masculine), do shagart, an sagart, don sagart (in the Standard and some dialects; don tsagart in other dialects); sráid (feminine), do shráid, an tsráid, don tsráid. But that’s do, which lenites on its own.
Compare i, which eclipses on its own, but (in the Standard) lenites the following noun when combined with the singular article. For example, bád, i mbád, an bád, sa bhád; buaile (feminine), i mbuaile, an bhuaile, sa bhuaile; sruthán (masculine), i sruthán, an sruthán, sa sruthán; sráid, i sráid, an tsráid, sa tsráid…
…An Pholainn, sa Pholainn, don Pholainn, as an bPolainn, faoin bPolainn, &c.