YORK, Pa. — A convicted felon-turned-environmental activist registered as a Democrat but running as a Republican defeated the black female Democratic incumbent in York's mayoral race on Election Day last week.

And he did it with a local coalition of Bernie Sanders and Republican supporters and a breakdown of trust in the leadership of the incumbent mayor.

This was perhaps the Keystone State's most eye-catching result, but more broadly, Pennsylvania's off-year election results are worth examining in order to take the voters' temperature one year out from Donald Trump’s historic win here that few predicted, and one year away from the 2018 midterm elections.

Why is Pennsylvania important? Well, because what is brewing here serves as a microcosm of what is brewing across the country. If Republican House candidates, who hold a 13-5 majority in the congressional delegation, are starting to lose favor with voters here, nationally the Democrats are on their way to a celebratory election night one year from now. In short, the path to the House majority in Congress runs straight across Pennsylvania.

But this is also a place where indicators of how state legislative bodies across the country — those key down ballot seats that Republicans have been winning for nearly a decade — will hold up. As well as the Trump coalition.

Democrats won some key local races in the environs of Philadelphia and its suburbs — some of which broke historic records. Those wins were affected by local issues like building a new school in Lancaster, but Republicans nonetheless found themselves on the wrong side of voter sentiment.

Wisdom dictates to a political party’s psyche that you never dismiss local election results having a direct impact on larger races; if you aren’t in touch on the most local level, that's going to affect state House and Senate seats as well as congressional races.

Truth be told, if a wave is coming, you are still going to get swept away by it if your party nationally has lost favor, even if you do everything else right.

Statewide, Democrats suffered a marquee loss here in the Supreme Court race when former Pittsburgh Steeler Dwayne Woodruff lost to Republican Sallie Mundy.

They were also in spirit on the losing side of a statewide referendum on whether local taxing authorities should be able to exempt residents from paying property taxes on their homes. That anti-tax sentiment is a good sign for Republicans.

Where Democrats were really energized was in local races in the Philadelphia collar counties, where candidates ran solid campaigns with good local messaging — a move that was very reflective of the gains that Republicans made in 2009 with a similar local emphasis.

Simply put, when candidates focus on policies that impact localities and accomplishments, and not culture wars, they win elections. One place Democrats did use an anti-Trump sentiment to win was in a Delaware County Council election, where for the first time in history they won two seats. Campaign signs reading read, “Vote Nov 7th Against Trump” and “Vote Nov 7th: Bring Sanity Back” littered the leafy suburban neighborhoods ahead of the race.

But that is really not very much of an indicator that this was a breakdown of the Trump coalition; Delaware County went strong for Hillary Clinton in 2016 giving her nearly 60 percent of their support and those two county council races were razor thin.

So, is it time for the GOP to panic? Have the big Republicans local majorities in Pennsylvania overstayed their welcome? Become complacent? Damaged by Trump? Angered that the Republican Congress ha gotten nothing done?

All of those things are very possible but should also not be overstated. The Philly suburbs may just be continuing their Blue trend. And historically, the party who holds the White House tends to do poorly in the midterms.

Democrats did much better than predicted in local elections like the school board election in Manheim Township in Lancaster, where turnout on the issue of whether the community should build a new middle school or not drove up the turnout to nearly 45 percent in the city (across the state the average turnout was under 25 percent). That makes it really hard to say Democrats were motivated to make an anti-Trump statement.

What that tells you right now is that for Democrats to be successful in down-ballot races across the state is that they need to run candidates who are keyed in locally and focus on an economic message — an anti-Trump campaign will not win them back working-class voters.

They also need to gin up turnout in Eastern Pennsylvania to offset the redder West.

Most importantly, they need to offer a tangible economic benefit that outweighs Trump's successes on the economy — so forget the free stuff and the higher minimum wage and show the voters you have a way to increase wages through job growth and competition.

Democrats also have some serious image problems in this state. They are still fractured between the progressives and the more moderate voices in the party. They also keep electing people who have serious legal problems, such as Allentown Mayor Ed Pawlowski, who won a fourth term in last Tuesday’s election despite facing a 54-count federal indictment for corruption.

Republicans here should take a deep breath. No, there wasn’t a big anti-Trump backlash here, but the shenanigans in the state capitol where they hold a supermajority in the Senate and a comfortable majority in the state House is wearing on voters.

The same goes for the GOP congressional delegation; it is easy to imagine congressional seats in Bucks, Chester, and the Lehigh Valley becoming very vulnerable in six months if Congress doesn't accomplish something.

And if there are signs that is happening here, then it’s also happening in Ohio, Michigan, and Wisconsin. As goes those state delegations, so goes the country.

Salena Zito is a columnist for the Washington Examiner.