The government yesterday banned production and sale of children's sleepwear treated with Tris, a flame-retardant feared to cause kidney cancer in humans.

The ban applies to an estimated 18 million size 0 to 14 garments in commercial pipelines and to about 7 million square yards of Tris-treated uncut fabric intended for children's sleepwear.

Consumers who own unwashed Tris-treated children's garments - worn or unworn - are entitled under the Hazardous Substances Act to automatic refunds and to reimbursement of "any reasonable and necessary transportation charges incurred" in returning the garments. Retailers are entitled to reimbursement by manufacturers.

The unwashed garments comprise a tiny share of the estimated 120 million Tris-treated nightgowns pajamas and robes believed to be in consumers' hands. Under the Flammable Standards Act, children's sleepwear size 0 through 6x was required to be flame-resistant starting in 1972 and sizes 7 through 14 starting in 1975. Their labels do not disclose the presence of the chemical.

The Consumer Product Safety Commission said that Tris-treated garments account for at least 40 per cent of all children's sleepwear. Most Tris-treated items are made of 100 per cent polyester, although some polyester garments are treated with other flame-retardants. Other Tris-treated garments are made of acetate, triacetate, or one of those blended with other fibers. All acetate or triacetate in children's sleepwear has been treated with Tris, the commission said.

All five commission members voted for the production and sales bans and for designating unwashed garments with Tris as hazardous substances whose purchasers are entitled to refunds.

But they defeated 3 to 2 an effort originated by the Environmental Defense Fund to order repurchase of all Tris-treated sleepwear in consumers' hands.

The issue that divided the commissioners was whether laundering removes enough loose or so-called surface Tris to eliminate or virtually eliminate the presumed cancer hazard, which arises from absorption by the skin in direct contact with treated fabric or sucking the fabric.

The effectiveness of laundering is controversial. In an official notice to be published today in the Federal Register, the commission cites the removal of more than 95 per cent of surface Tris by three washings of two samples of polyester fabric. The notice also cites data showing that a single laundering removed 21 per cent to 82 per cent of surface Tris from polyester fabrics, and up to 85 per cent from acetate fabrics.

Less assuring figures were cited by Dr. Robert H. Harris, who heads the toxic chemicals program of the EDF, a private, nonprofit group that sounded the first formal alarm to the commission in March, 1976.

Tests by two chemical companies showed a 35 per cent residue of surface Tris after three washings and 10 per cent after 10 washings, Harris said in a phone interview. He said one of the tests was performed by the principal maker of Tris, the Michigan Chemical Co. of Chicago, a division of Velsicol Chemical Co.

A commission majority - chairman S. John Byington and members Barbara H. Franklin and Lawrence M. Kushner - voted against repurchasing laundered sleepwear from consumers. They expressed confidence that it was either safe, or as close to safe as not to warrant saddling manufacturers with hundreds of millions of dollars of repurchasing costs.

Commissioners R. David Pittle and Thaddeus Garrett voted for repurchasing, saying that the majority was operating by "guesstimates and intuition" and that confusion and possibly panic could result among consumers.

The EDF, which last mont sued in U.S. District Court to ban Tris-treated sleepwear, said it will amend its suit today to ask the court to require repurchase. By implying or saying that laundering makes the garments safe, Harris said, the commission may have made it legally possible for the industry try to sell the 18 million garments in supply lines by first having them aundered.

Chairman Byington said he expected the commission actions to survive expected legal attacks by the apparel industry as well as from the EDF. The commissioners acted at a two-hour open meeting where they said they had been besieged by calls from anxious parents. They then held a one-hour press conference.

Afterward, the Environmental Protection Agency said its studies of drinking water have detected no Tris, which theoretically could flow from washing machines through sewer lines and finally into water sources.

The American Apparel Manufacturers Association said that the "very small" children's sleepwear industry "acted in good faith on the basis of available knowledge" before the National Cancer Institute's recent report that cancer developed - mainly in the kidney - mostly in male rats and mice exposed to Tris (2, 3-dibromopropyl).

The association accused the commission of "second-guessing" that could force many manufacturers out of business. Each of the 18 million garments in supply lines can be sold at wholesale for an average of $4 and retail for $6 to $10.

Edith Barksdale-Sloan, consumer affairs chief for the District of Columbia, termed the commission action "belated," urged return of all unwashed garments for a refund, promised to check every seller in the city for compliance, and criticized as "short-sighted and dangerours" the commission's refusal to repurchase laundered sleepwear.

"We are going to urge retailers in the District to accept for refund all Tris-treated sleepwear," she said. "Many have already indicated their willingness to do so."

About 3 million children are born annually. Assuming all of them had an "average" Tris exposure in their first year, about 540 might get kidney cancer, according to the commission staff. A cancer Institute expert estimates 15,000. University of California scientists N. Kim Hooper and Bruce N. Ames say the toll might be 51,000. They found that Tris causes genetic changes as well as cancer.