When it comes to defense and foreign policy issues, the Democratic Party is tired of being the "contras."

For nearly two decades, no matter what the hotly argued issue of the moment -- a weapons system, a Pentagon budget, aid to an anticommunist insurgency -- Democrats seem always to be voting against, voting no.

Lately, they've begun to measure the political cost of their post-Vietnam naysaying, and the tally is stark: four of five presidential elections lost, huge blocks of electoral votes in the South and the West seemingly out of reach, and the party stuck with the rap of being weak, nerveless, irresolute.

"We have a softness image that has hurt us in contemporary times," said Robert Strauss, a former chairman of the Democratic National Committee. "There is a perception that Democrats are unwilling to project our nation's military power," said Carter White House adviser Stuart Eizenstat.

"Too often, the Democrats have been the 'Dr. No' of defense," said Sen. Gary Hart (D-Colo.) in a line borrowed from House Armed Services Committee Chairman Les Aspin (D-Wis.).

As they look toward the next presidential campaign, these and other Democratic leaders are trying to coax the party toward a more muscular posture. They're not ready to take it all the way back to the swaggering "we-will-pay-any-price" oratory of John F. Kennedy's 1961 Inaugural Address, nor will they be as gung-ho for defense spending or as quick to deploy American force as President Reagan is, but that's the way they want to be headed.

On defense spending, Democrats are shooting to become a party of lean hawks. On foreign intervention, they still have trouble articulating a doctrine, but they know what they don't want: knee-jerk isolationism. On arms control and human rights, they remain committed, but inclined to lower the volume.

The effort to craft a more assertive party stance on national security is just beginning. It is not expected to take form fully until after the party nominates a presidential candidate in 1988.

Meantime, it can easily get sidetracked by tough votes and by events -- witness last week's showdown with Reagan over his $100 million aid package for Nicaraguan counterrevolutionaries, or contras, and this week's U.S.-Libyan shootout in the Gulf of Sidra.

The Libyan episode is a reminder that when a popular president deploys force in response to a limited situation and achieves the mission's objectives, there is little an "out" party can do but stand at a distance and applaud. The political "credit" is all Reagan's.

The House vote on contra aid was another matter. The issue goes to the heart of the administration's determination to peel back the borders of communism wherever feasible. Once again, the Democrats said "no."

But even that vote is instructive of a new mood in the party. Although polls show the public squarely on their side, House Democrats seem poised to say "yes" to a compromise aid bill next month. In fact, they were ready to say yes even before reports this week of a Nicaraguan incursion into neighboring Honduras -- reports that strengthened the administration's hand.

Privately, many Democrats say they fear that Central America has their party in a kind of win-the-battle-but-lose-the-war quagmire. "We're right on the policy, we're right on the politics, but it still adds up to an overall impression that we're not for anything," Aspin said.

What should the Democrats be for? Aspin and his ideological partner in the Senate, Sam Nunn (D-Ga.), will attempt to answer that question beginning this spring. They are taking lead roles in drafting defense and foreign policy position papers for the party's two institutional policy shops, the Democratic National Committee's Policy Council and the upstart Democratic Leadership Council (DLC).

Aspin will use both exercises to rally his party around support for the Midgetman, a mobile, single-warhead intercontinental ballistic missile designed to be less vulnerable than the MX to a Soviet first strike. He seems almost to be salivating at the prospect that the Republicans might oppose the Midgetman. If they do, he told a DLC forum in Dallas this month, "we'll rap the window of vulnerability around their necks in 1988."

Nunn, ranking minority member on the Senate Armed Services Committee, will push overhaul of the Joint Chiefs of Staff. It is a way for Democrats to capitalize on the procurement horror stories of recent years, but Nunn wants to go deeper -- to take on rivalry among the services, duplicative weapons systems, inefficient assembly lines.

The coming to prominence of Aspin and Nunn, both 47, as lead Democratic spokesmen on national security is significant. In a sense, it symbolizes the bridging of a schism that had existed in the party since Vietnam.

Aspin hails from the "peace" wing of the party, Nunn from the "strength" wing. Now Aspin has turned toward strength, and he's unabashed about laying out his strategic political road map. "It isn't enough for Democrats to be for some things in the defense area," he said in an interview. "In order to get political credit, we need to go for something that the other side is against."

That kind of talk drives his "peace" colleagues to distraction -- although they're doubtless used to it. Last year, they helped Aspin jump several rungs of seniority and elected him to the chairmanship of the Armed Services Committee -- only subsequently to feel double-crossed by his stances in support of the MX missile and in favor of more funding for the Pentagon than the House had approved.

"He is leading a mad scramble to find some weapon the party can throw its arms around," said Rep. Les AuCoin (D-Ore.). "That doesn't strike me as a very smart approach."

In modern times, the "congressional" Democratic Party has tended to be to the left of the grass-roots party on matters of national defense and security. AuCoin said he would like to make a weapons test ban the centerpiece of the Democratic stance on national security. Aspin said he thinks that the party should confine itself in the arms control area to a more modest, "no undercut" policy toward the unratified SALT II treaty.

On the hustings, the arms control movement has lost the punch it had three years ago. And, as a result, the party's policy councils -- dominated by centrists and by local and state elected officials -- are expected to take Aspin's advice, not AuCoin's.

Meantime, off at his usual distance from the congressional and institutional infighting, but eager to weigh in to the intraparty national security debate, stands Hart.

Next month he will publish a book, "America Can Win," setting forth the military reform proposals he has been articulating for nearly a decade. Hart is still pushing light ships, maneuver warfare, submarines rather than aircraft carriers and nonbureaucratic approaches to Pentagon management -- but he's also ready to assert, as he did in a luncheon with Washington Post reporters and editors last week, that "it may wind up that reforming the military costs more" than the buildup of the Reagan years.

It is perhaps worth remembering that in the 1984 primaries, former vice president Walter F. Mondale maneuvered to the right of Hart on national security and use-of-force issues.

On the other hand, Democratic primary politics tends to be played among activists on the left -- one reason to wonder whether, although the party's right and center are in the ascendancy now on national security issues, it can remain so throughout the 1988 nomination season. "That's when the collision will come," Eizenstat said.

At least two other factors -- both of them ironies of timing and history -- raise the same question.

The first is that, just as the party gears up to be "for" military spending, Americans are turning against it. Only 22 percent of the public wants military spending increased, according to a Washington Post poll last month.

On foreign policy, the Democrats' problem is not so much that they are moving in the opposite direction of public attitudes, but that Reagan and historical circumstance have been moving the whole argument into new terrain. The Democrats never seem to catch up.

In the 1970s, the cutting foreign policy debate was whether the United States should support anticommunist dictatorships with poor human-rights records. In the 1980s, it is whether this country should support insurgencies trying to overthrow communist dictatorships.

The polls show that the public is wary of such foreign involvement. "When we play the Vietnam card, we win," said Democratic Congressional Campaign Committee Chairman Rep. Tony Coelho (D-Calif.).

But when Reagan and the Republicans play their "soft-on-communism" card, they win. At least, they have four out of the last five times.

The Democrats hope that as the terms of the argument move further toward interventionism, they can be the "soft" side and still be in a winner -- for they'll occupy the responsible center. It is only a hope, though. Modern political history has not rewarded the soft side.